Skip to content

feat(session): add an up arrow that jumps to the previous user message - #182

Open
Tarquinen wants to merge 2 commits into
devfrom
jump-previous-message
Open

Tarquinen wants to merge 2 commits into
devfrom
jump-previous-message

Conversation

@Tarquinen

Copy link
Copy Markdown
Member

When you've scrolled up in a session, an up arrow now sits just above Jump to latest. Each tap brings the previous user message to the top of the transcript, so repeated taps walk back through your prompts, like /timeline in the TUI.

jump-previous-message.mp4
Light Dark
Two buttons, light Two buttons, dark
  • When it shows: only together with Jump to latest, and only while an earlier user message is loaded. On the first prompt it leaves. It looks and moves like the down arrow (raised 34dp button, 8dp gap, microIn/microOut), and the down arrow stays where it is. No haptic, to match the down arrow.
  • Where it lands: the message's top lands at the top of the visible area, clear of the header. The jump reuses Jump to latest's glide, including the cut when the target is far. While scrolled up, streaming content still doesn't move the view.
  • Older history: it jumps only within loaded messages. Near the top, the existing load-earlier paging takes over, and later taps keep walking back.
  • Motion frequency: occasional. The button appears and leaves a few times a day, when someone scrolls back through a long session.

Android-only (iOS doesn't have it). Recorded in docs/parity/session.md and docs/parity/transcript.md.

Verified on the emulator with session-lab: scripts/check.sh :feature:transcript :feature:session; walking back on the long and paged-history checkpoints; a jump during a streaming turn; keyboard up, landscape, font scale 2.0, light and dark, animations off; a short session showing no up arrow; the TalkBack label "Scroll to previous message".

When the transcript is scrolled up, an up arrow now sits just above Jump
to latest (same 34dp raised button, 8dp gap, OpenCodeSpacing.stack). Each
tap glides the nearest loaded user message that starts above the view to
the top of the visible area, so repeated taps walk back through the
person's prompts, like the TUI's /timeline. It shows only with the down
arrow and only while an earlier user message is loaded; when none is left
it leaves on the down arrow's microIn/microOut presence. The down arrow
doesn't move: the up arrow is placed above it without taking layout space.

The jump reuses Jump to latest's glide (timing, easing, cut when far) via
a shared glide helper; glideToEnd behaves as before. It doesn't hold
earlier history, so near the top the existing load-earlier paging takes
over and later taps keep walking back. Scroll state stays in
TranscriptListScroller and SessionScrollEdgeBridge, as for the down arrow.

Verified on the shared VM emulator with session-lab: scripts/check.sh
:feature:transcript :feature:session; long checkpoint walk from detail 12
to the first prompt, then the arrow leaves; history checkpoint walking
back across loaded pages; jump during a streaming turn keeps the view
still; keyboard up, landscape, font scale 2.0, light and dark, animations
off, pill row with a subagent pill; short session shows no up arrow;
"Scroll to previous message" appears in the accessibility tree.
@Tarquinen

Copy link
Copy Markdown
Member Author

Do we like this? I'm not sure

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant