Slide the main screen over a session with a right swipe
Switching conversation was a step back to the list and a step down into another, which disposed the session being left and refetched its whole transcript over the tunnel on the way back. A right swipe now pulls MainScreen itself over the open session -- the screen Back would have shown, moved over the session instead of replacing it -- and swiping it back off returns to a live stream, an unsent draft and the scroll position it had. Tapping the session already open is that same swipe back; tapping another is a screen of its own; deleting the one underneath closes the screen, since there is nothing left to return to. One gesture drives both this and the subagent panel (SidePanels.kt, now the home of the drag and animation SubagentPanel had): two draggables over the same content cannot share a horizontal drag, so the position is a single signed reveal, negative left and positive right, which also makes it impossible to have both open. The panels exist only inside a session, so nothing on the main screen swipes anywhere. Full width and no tonal step for this one, because a screen standing in for another must be the same colour as it; the subagent panel keeps its 88% and its sliver. The list keeps its rows while it asks again -- the panel refetches on every open, and blanking it each time handed the reader an empty screen about something never in doubt -- with a bar over the top while an answer is outstanding. Where the panel has got to is read from draw lambdas only: it changes every frame of a drag, and a body that reads it recomposes the session beneath once per frame. Composition sees booleans that change twice per gesture, the same correction the keyboard inset needed. Verified on the emulator against the sandbox with ui-trace: the panel opens and closes on the two swipes, tapping another session replaces the screen, deleting the open one leaves for the list, the subagent panel is unchanged, and neither swipe does anything on the main screen. ktfmt, compile, lint and the unit tests are clean.
This commit is contained in:
1 parent
ef788b0405
commit
c8bfc958ad
8 files changed
+418
-126
No files matched your search
@@ -235,10 +235,44 @@ fun AppRoot(
|
||||
else Modifier
|
||||
)
|
||||
) {
|
||||
SubagentPanel(
|
||||
settings = current,
|
||||
summary = here.summary,
|
||||
onOpenSubagent = { screen = here.copy(subagent = it) },
|
||||
// The two panels this session can be pulled aside for: its subagents
|
||||
// from the right, and the whole main screen from the left. Both are here
|
||||
// rather than screens of their own for the same reason the explorer is --
|
||||
// the session under them stays composed. The main panel exists only
|
||||
// inside a session, which is what makes it unswipeable until one has been
|
||||
// opened.
|
||||
SidePanels(
|
||||
left = { active, close ->
|
||||
MainPanel(
|
||||
settings = current,
|
||||
sessionId = here.summary.id,
|
||||
active = active,
|
||||
onOpen = { screen = Screen.Session(it) },
|
||||
onSpawn = { screen = Screen.Spawn },
|
||||
onImported = { imported ->
|
||||
reloadToken++
|
||||
screen = Screen.Session(imported)
|
||||
},
|
||||
onSettings = { screen = Screen.Settings },
|
||||
onProvider = { machineId, provider ->
|
||||
screen = Screen.ProviderSettings(machineId, provider)
|
||||
},
|
||||
onClose = close,
|
||||
onGone = goToMain,
|
||||
)
|
||||
},
|
||||
// The whole width: it stands in for the screen Back would have shown,
|
||||
// rather than sitting over the session the way the subagents do.
|
||||
leftFraction = 1f,
|
||||
right = { active, close ->
|
||||
SubagentPanel(
|
||||
settings = current,
|
||||
summary = here.summary,
|
||||
active = active,
|
||||
onClose = close,
|
||||
onOpenSubagent = { screen = here.copy(subagent = it) },
|
||||
)
|
||||
},
|
||||
) {
|
||||
CompositionLocalProvider(
|
||||
LocalFileLinkHandler provides fileLinkHandler
|
||||
|
||||
Reference in new issue
Block a user