fix(dashboard): use browser scrollback for chat wheel (#28029)#28584
Merged
Conversation
Contributor
🔎 Lint report:
|
19 tasks
briandevans
added a commit
to briandevans/hermes-agent
that referenced
this pull request
May 30, 2026
…eachable The dashboard chat wheel handler in `web/src/pages/ChatPage.tsx` unconditionally divided pixel deltas by 50 to compute its scroll step. For a typical browser mouse-wheel click (`deltaY ≈ 100`, `deltaMode = DOM_DELTA_PIXEL`) that produces 2 lines per tick. Combined with the 5000-line `scrollback` introduced by NousResearch#28584, a resumed session ends up needing ~2500 wheel ticks to reach the top, so users see only the tail of the conversation and report it as "history is missing" (NousResearch#32561). Branch on `deltaMode` instead: * `DOM_DELTA_LINE` (1) — already in lines, scroll 1:1. * `DOM_DELTA_PAGE` (2) — scale by `term.rows` for a full-page jump. * `DOM_DELTA_PIXEL` (0) — divide by ~16 (default xterm cell row height), giving ~6 lines per typical 100px click. Matches the browser-native scroll feel and brings a 5000-line scrollback down to ~85 wheel ticks (still bounded by xterm's own scrollback cap, not by this formula). Builds on the wheel routing established by NousResearch#28584 (afffb8d) — only the step calculation changes; `term.scrollLines` continues to drive the in-terminal scrollback so PTY traffic is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #28029 by @YuanHanzhong.
What: Dashboard chat embedded the TUI with
scrollback: 0(delegating all scroll behavior to the inner Hermes TUI). In practice, mouse-wheel scrollback in the browser felt broken because xterm.js had no buffered history to scroll through.How:
hermes_cli/web_server.pysetsHERMES_TUI_INLINE=1so the embedded TUI runs in inline mode (no alternate-screen buffer hijack).web/src/pages/ChatPage.tsxraisesscrollbackfrom 0 to 5000 so xterm.js keeps the transcript history the wheel can scroll.tests/hermes_cli/test_web_server.pyconfirms the dashboard scroll env is wired.Original PR: #28029
Fixes #19084.