Let the reader put the session list in its own order
Nothing sorts the sessions tab any more. The order is the server's `sessions` list, which is the reader's arrangement: holding a row puts the screen in selection mode -- the same gesture and the same bottom bar as the import tab -- and each card grows a burger handle at its right edge that drags the row to a new place, with a tick of haptic feedback for each one it passes. The two attempts this replaces, sorting by activity and then by when each agent was turned on, were both looking for an order a session could not move itself out of; no rule computed from what a session is doing can be one. `POST /sessions/order` rewrites the config's order, so it is the same on every device and survives a backend restart, and `SessionConfig::started` goes with the sort that needed it. Rearranging is independent of the selection: the handle moves the row it is on, picked out or not. The click moved off the card and onto its contents so that a press landing on the handle cannot also select the row it is about to move. Selection's one action is Delete, which now takes the whole set. Two traps in `Reorder.kt`, both measured on the emulator and written down in `this-machine-android`: a crossing is decided from how far the finger has travelled, because a lazy list animates an item into its new place and its `offset` reports the old one for several frames; and the viewport is pinned with `requestScrollToItem` around each move, because a lazy list keeps its place by the key of the top item and would otherwise follow the row being dragged. Verified on the emulator against the sandbox: the order survives an app restart and a backend read-back, a two-row drag moves exactly two rows, a drag to the bottom edge scrolls the list and lands the row last, pressing the handle without moving changes nothing, and deleting two selected sessions leaves the rest in place.
This commit is contained in:
1 parent
942edd6b31
commit
b7fd18b195
12 files changed
+801
-339
No files matched your search
@@ -141,7 +141,10 @@ Module-by-module intent is in PLAN.md's "Backend layout".
|
||||
and what it has running beside the turn -- its background tasks over its
|
||||
subagents (`BackgroundTasks.kt`, `SubagentPanel.kt`) -- from the right, both keeping
|
||||
the session composed underneath; `MainScreen.kt` the root's three tabs
|
||||
(sessions, import, machines); `MachineModels.kt` the models on one machine
|
||||
(sessions, import, machines); `Reorder.kt` the drag that moves a row of a
|
||||
lazy list, used by the session list's handles -- **the order of that list is
|
||||
the reader's own and nothing sorts it** (`POST /sessions/order`);
|
||||
`MachineModels.kt` the models on one machine
|
||||
and the downloads putting them there, drawn inside `ProviderScreen.kt` for a
|
||||
provider that serves files off that machine's disk; `Api.kt`/`EventStream.kt`
|
||||
the REST + SSE clients; `Events.kt` the event model mirror; `ServerConfig.kt` settings and
|
||||
|
||||
Reference in new issue
Block a user