Repository navigation
feat(terminal): add a jump-to-bottom button while scrolled up in history - #1036
Conversation
When herdr's shared history viewport is above the bottom and the pane is interactive, the terminal lens shows a round ArrowDown button over the grid's bottom-right corner, left of the history gutter. It sends the same pane.scroll offset 0 as the scrollbar's End key, keeps focus in the terminal, and uses the Chat lens' round button form with design tokens (--touch-target on coarse pointers). The anchor is clipped to the mount's client area so an adopted grid (a mirrored PC, an observer) that is wider than the mount keeps the button inside the overlay. Closes devswha#1034
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
Main removed the terminal history scrollbar (devswha#1113): anchor the jump button to the grid's bottom-right corner without the gutter, drop the scrollbar's aria-controls, page up with the shortcut in the regression step, and update DESIGN.md and the changelog fragment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @m16khb! Main removed the terminal history scrollbar in #1113 after this branch was cut, so I pushed a merge of main (c11817f) that rebuilds the button on top of it:
With the scrollbar gone this button is now the one-tap way back to the live bottom on a phone, so it's a welcome addition. |
…kept history (#2859) ## What The terminal's round "Jump to bottom" button (#1036) only read herdr's viewport metrics (`pane.scroll`). On a herdr-core server (`terminal-history`, the desktop app's runtime) nothing on the server scrolls: xterm keeps the replayed history itself, the wheel and a swipe scroll it locally, and herdr-core reports no scroll metrics. So the button never appeared there, and the only way back to the newest output was to wheel or swipe all the way down. Now `TerminalViewportTools` also follows xterm's own viewport (`buffer.viewportY < buffer.baseY`, read on `onScroll` and `onRender`): - While xterm's view is above its bottom, the same button shows, at the same corner and in the same form. Clicking it calls `terminal.scrollToBottom()`; herdr's shared viewport is only written when herdr's metrics say it is scrolled (unchanged behaviour on a herdr server). - The local case shows in read-only views too: that scroll belongs to this browser alone and moves nothing for other clients. herdr's case keeps its `interactive` gate. - Pressed from the keyboard (Tab, Enter), the button hands focus back to the terminal instead of leaving it on a button that disappears. A pointer press still never moves focus. - On a herdr server xterm keeps `scrollback: 0`, so `baseY` stays 0 and nothing changes there. Design follows VS Code's integrated terminal, whose history scrolls locally and returns to the bottom on demand; the button keeps the existing chat-lens round form (DESIGN.md entry updated). ## Screenshots (herdr-core server, scrolled up in history) | 1280 | 390 | |---|---| | <img src="https://raw.githubusercontent.com/devswha/ovis/68a7b958830933f5346f4f824828ebbc67600780/jump-bottom-1280.png" width="640"> | <img src="https://raw.githubusercontent.com/devswha/ovis/68a7b958830933f5346f4f824828ebbc67600780/jump-bottom-390.png" width="260"> | ## Validation - `scripts/core-history-scroll-demo-regression.ts` gains the button checks (appears after a wheel up, click returns to `viewportY === baseY` and the button goes, Enter on the focused button does the same). On origin/main it fails waiting for `.terminal-jump-bottom`; on this branch both cases pass (`PASS core`, `PASS herdr`). - `bun run check fast`: passed (typecheck, build, 11427 unit tests, generated files, workflow syntax). - Skipped: `bun run check full` (left to CI's Integration and browser job).
Change
Closes #1034
In the Terminal lens, scrolling herdr's shared history up leaves the pane with no one-tap way back to the live bottom: the history scrollbar's End key is the only shortcut, and it is out of reach on a phone. Chat already has a round "Jump to latest" button for this.
While herdr reports
offset_from_bottom > 0and the pane is interactive, a round ArrowDown "Jump to bottom" button now floats over the grid's bottom-right corner, left of the history gutter. Tapping it sends the samepane.scrolloffset 0 as the scrollbar's End key, through the existing coalescedwriteRefpath inTerminalViewportTools. A failed write falls back to the existingScroll failederror. The button:enabled && interactive);onPointerDownpreventDefault, the same pattern as the input row's buttons;--control-h,--touch-targeton coarse pointers,--radius-pill,--shadow-pop,--icon-size), no color literals, no new animation;No new state, polling, endpoint, WS frame or protocol type;
site/demo/transport.tsalready answerspane/scroll. New stringJump to bottomis translated in ko, ja, zh and tr.DESIGN.md(terminal history section) and achangelog.dfragment are updated.Heads-up: #945 (phone scrollbar toggle) also edits
TerminalViewportTools.tsxandDESIGN.md. There is no functional dependency, only a possible textual conflict.Validation
bun run check fast: generated types fresh, typecheck, build and unit tests (3470 pass, 0 fail, includesi18n.test.ts,conventions.test.ts,motion.test.ts).scripts/terminal-viewport-regression.tsgains a step: no button at the native bottom, button visible after Home and left of the gutter, with the terminal textarea focused a click returns herdr to offset 0, the button detaches, focus stays on the textarea and no input frame is sent.main, so I could not run it end to end here. With that one block removed in a throwaway copy the whole script, including the new step, printsPASS native history scrollbar, .... Please rely on the CI browser lane for the full script.createServer({ terminalAttach: false }), adopted grid). In both the button is 40x40, inside the mount's client area and left of the gutter.