Skip to content

fix(tui): scroll the transcript while the transcript itself is focused - #674

Merged
mohitranka merged 1 commit into
mainfrom
fix/sidebar-wheel-paging-scroll
Sep 14, 2026
Merged

mohitranka merged 1 commit into
mainfrom
fix/sidebar-wheel-paging-scroll

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Clicking the transcript focuses FocusBlock::Sidebar, whose wheel arm was a v1 no-op; its keys are owned by the background-task strip. So the wheel and PageUp/PageDown only ever reached the conversation while the composer held focus — the state the operator leaves the moment they click the pane they want to read.

Changes

  • mouse.rs — Sidebar joins the Composer arm: both own the conversation column, so both scroll it. The _ => {} bucket now records TaskStrip as a deliberate no-op instead of claiming the transcript has no scroll target.
  • Page size — shift+wheel pages by the measured conversation_page_rows() instead of the file tree's fixed WHEEL_PAGE = 5, so the mouse and the keyboard agree with §8.6. The file tree keeps its own step, and WHEEL_PAGE's comment is corrected to say what it actually does.
  • SemanticCommand::PageConversation(bool) — Sidebar's PgUp/PgDn are declared in its key table (commands.rs) rather than handled inline, so every binding for the block stays declarative and covered by the exact-mapping test.
  • Hints unchanged — the > Chat title marker and the accent scrollbar thumb already signal ownership of the pane.

Behaviour change worth reviewing

Shift+wheel over the transcript used to move 5 rows; it now moves a full measured page. That is deliberate (§8.6: the wheel matches the keyboard page/step size), but it is the most visible thing in this diff.

Tests

  • New: wheel over the focused transcript; shift+wheel paging by the measured page; shift+wheel displacing the transcript exactly as PageDown does; and TaskStrip's wheel staying a no-op.
  • Replaced shift_wheel_pages_conversation_like_pagedown — it never called draw_app, so it asserted against the pre-draw fallback of 5 and passed for the wrong reason. The replacements draw first and assert against area.height - 2, as the keyboard test already did.
  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets --locked -- -D warnings clean. Targeted suites green: wheel 10, paging 3, sidebar_key_bindings 1, focus 66, scroll 12, conversation 121, transcript 22.

No FORGE-DESIGN.md change: §8.6 already specified this behaviour, and the code was what disagreed.

Clicking the transcript focuses `FocusBlock::Sidebar`, whose wheel arm was a
v1 no-op and whose keys are owned by the background-task strip. So the wheel
and PageUp/PageDown only reached the conversation while the composer held
focus — the one state the operator leaves the moment they click the pane they
want to read.

- Route Sidebar through `mouse_scroll_conversation`, merging its arm with
  Composer's: both own the conversation column.
- Page by the measured `conversation_page_rows()` on shift+wheel rather than
  the file tree's fixed 5 rows, so the mouse and the keyboard agree with
  §8.6. The file tree keeps its own step.
- Declare Sidebar's PageUp/PageDown as `SemanticCommand::PageConversation`, so
  every binding for the block stays in one table.
- Record `TaskStrip` as a deliberate wheel no-op, in the comment that used to
  claim the transcript had no scroll target.

`shift_wheel_pages_conversation_like_pagedown` was replaced: it never drew, so
it asserted against the pre-draw fallback and passed for the wrong reason.

Hints are unchanged; the `> Chat` marker and the accent scrollbar thumb
already signal ownership of the pane.
@mohitranka
mohitranka merged commit 678143f into main Sep 14, 2026
3 checks passed
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