Skip to content

feat: the mouse works on every screen, not only the list - #48

Merged
bspeelm merged 2 commits into
mainfrom
feat/mouse-every-screen
Nov 26, 2026
Merged

bspeelm merged 2 commits into
mainfrom
feat/mouse-every-screen

Conversation

@bspeelm

@bspeelm bspeelm commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

The mouse already switched tabs, selected list rows and scrolled. It stopped at the plain list: the pipeline and job screens passed clicks to the list beneath them, Deploys and Merged selected the wrong row, Armed ignored clicks, and nothing went back.

What a click does now

Every click presses the key that already does the thing, so nothing is mouse-only and nothing new is drawn (design/ and tests/golden/ are untouched).

where click double-click wheel
list selects the row; the preview pane is not a row Enter moves the selection
Armed, Deploys, Merged selects the row, never a heading Enter (the pipeline in Deploys) moves the selection
detail view focuses the pane (h / l); top row is q scrolls the pane under it, stopping where the keys stop
F file list selects the file Enter moves the selection
pipeline selects the job; top row is q Enter moves the selection
job steps: focus and select; log: focus; top row is q on a step, Enter steps move, the log scrolls and stops following

Confirm prompts, the command line, a filter and ? still take keys only, so a stray click cannot answer or cancel a merge.

How

Each frame records which item its rows show (App::hits), written by the code that lays the rows out, so a click is resolved against what was drawn. That replaces the copy of the list's layout the mouse kept.

The second commit is a separate fix: a panic left mouse reporting on, because ratatui's hook only leaves raw mode and the alternate screen.

Proof

  • make check passes: fmt, clippy, tests, and the budgets (code 11,375 of 11,500).
  • 12 new tests in crates/pullpen-ui/src/app/mouse/tests.rs, each named in the table added to wiki/Keys.md. The two tests that were there gained a draw before the click, since rows now come from the frame; their assertions are unchanged.
  • Run against the release binary in a pseudo-terminal with SGR mouse sequences: row click, double-click into a PR, pane focus, breadcrumb back, tab click, and a click at the x prompt leaving it for y to answer.
  • PULLPEN_TEST_PANIC=1 in a pseudo-terminal: ?1004l ?1006l ?1015l ?1003l ?1002l ?1000l are written before ?1049l, exit 101.

Not verified: a real mouse in a real terminal emulator, and Windows Terminal.

🤖 Generated with Claude Code

bspeelm and others added 2 commits November 26, 2026 12:45
A click selects the row under it and a second opens it in the grouped
views, the pipeline, a job's steps and the file list; a click on a pane
focuses it; the top row of a PR, pipeline or job goes back; the wheel
scrolls the pane under the pointer and stops where the keys stop.

Each frame records which item its rows show, so a click is resolved
against what was drawn. Before, the pipeline and job screens passed
clicks to the list beneath them, Deploys and Merged selected the wrong
row, and a click in the preview pane selected a row.

Every click presses the key that already does the thing; prompts and
typed lines still take keys only.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…inal back

ratatui's panic hook leaves raw mode and the alternate screen only, so a
crash left focus and mouse reporting and the keyboard flags on, and the
shell printed an escape sequence for every move of the pointer.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@bspeelm
bspeelm enabled auto-merge (squash) November 26, 2026 17:50
@bspeelm
bspeelm merged commit e3b9cf1 into main Nov 26, 2026
15 checks passed
@bspeelm
bspeelm deleted the feat/mouse-every-screen branch November 26, 2026 17:51
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