Return from files to explorer

This commit is contained in:
iris committed 2026-09-11 12:40:27 -04:00
1 parent 57e1cec09c
commit 2ff0b13950
2 files changed
+12 -11

No files matched your search

+8 -7
View File
@@ -208,18 +208,19 @@ absence the signal. Back with unsaved changes asks, and says the edits will
be lost. The explorer draws over the session, which deliberately has no be lost. The explorer draws over the session, which deliberately has no
`imePadding`, so the explorer's own box adds it. `imePadding`, so the explorer's own box adds it.
### 10. The explorer draws over the session, and the two back controls differ ### 10. The explorer draws over the session, and back follows what is open
`Screen.Session` in `AppRoot` gains a `files: FilesTarget?`. When set, the `Screen.Session` in `AppRoot` gains a `files: FilesTarget?`. When set, the
`FilesScreen` is composed **on top of** the session in the same `Box`, and `FilesScreen` is composed **on top of** the session in the same `Box`, and
the session stays composed under it: its event stream keeps flowing, its the session stays composed under it: its event stream keeps flowing, its
scroll position and draft stay where they were, and returning from a file scroll position and draft stay where they were, and returning from a file
costs nothing. The header's back button clears `files` and returns directly to costs nothing. From an open file, both the header's back button and Android back
the session. Android back returns from an open file to its containing directory, return to its containing directory. From a directory, the header's back button
then walks to the parent directory until the root; at the root it returns to the clears `files` and returns to the session, while Android back walks to the parent
session. The `..` row remains as the visible, tappable form of the same directory directory until the root and only then returns to the session. The `..` row
movement. An editor with unsaved changes asks before either route discards them. remains as the visible, tappable form of the same directory movement. An editor
"Back returns; it does not exit." with unsaved changes asks before either route discards them. "Back returns; it
does not exit."
Rejected: a `Screen.Files` beside `Screen.Session`. Every route back from a Rejected: a `Screen.Files` beside `Screen.Session`. Every route back from a
leaf screen goes to Main today, and a session disposed and re-created on each leaf screen goes to Main today, and a session disposed and re-created on each
@@ -81,9 +81,9 @@ private enum class UnsavedDestination {
* The files on the machine a session runs on: browse them, read one, change one. * The files on the machine a session runs on: browse them, read one, change one.
* *
* Drawn **over** the session rather than instead of it (see [AppRoot]), so its event stream keeps * Drawn **over** the session rather than instead of it (see [AppRoot]), so its event stream keeps
* flowing and coming back from a file costs nothing. Android back returns from a file to its * flowing and coming back from a file costs nothing. Both back controls return from a file to its
* directory, then walks up the directory tree. The header's back button closes the explorer and * directory. In a directory, Android back walks up the directory tree while the header's back
* returns directly to the session. * button closes the explorer and returns to the session.
* *
* Every directory that has been visited is kept for as long as this is open; the refresh glyph is * Every directory that has been visited is kept for as long as this is open; the refresh glyph is
* how one gets asked again on purpose, and creating something refetches the directory it was * how one gets asked again on purpose, and creating something refetches the directory it was
@@ -194,7 +194,7 @@ fun FilesScreen(settings: ServerSettings, target: FilesTarget, onClose: () -> Un
editing = editing, editing = editing,
onEditing = { editing = it }, onEditing = { editing = it },
onDirty = { dirty = it }, onDirty = { dirty = it },
onBack = { leave(UnsavedDestination.Session) }, onBack = { leave(UnsavedDestination.Directory) },
) )
} }
} }