Skip to content

feat(tui): mouse-wheel scrolling for the dashboard viewport - #951

Merged
iamtoruk merged 1 commit into
mainfrom
feat/tui-wheel-scroll
Aug 10, 2026
Merged

feat(tui): mouse-wheel scrolling for the dashboard viewport#951
iamtoruk merged 1 commit into
mainfrom
feat/tui-wheel-scroll

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

The dashboard's ScrollableViewport only answered keyboard keys; on the alternate screen the terminal never sends wheel events unless mouse reporting is on, so mouse scrolling did nothing.

The viewport now enables SGR mouse reporting (DECSET 1000+1006) while mounted and scrolls three lines per wheel tick. wheelDelta() parses only wheel buttons 64/65; clicks, drags, and modified wheel events contribute nothing. Tracking is disabled on unmount, so quitting or switching views restores the terminal.

Known tradeoff, documented at the code site: while tracking is on, click-drag text selection needs Shift held in most terminals.

Verified live in a pty drive against real data: tracking enabled on mount, wheel-down re-renders the scrolled frame, a click press/release at a digit-bearing coordinate does NOT leak into Ink's key parser (period tabs unchanged), and quit emits the tracking-off sequence. Unit tests cover the wheel parser (ticks, mixed directions, clicks/drags/modified wheels ignored, partial sequences); tsc clean; dashboard suite green.

@iamtoruk
iamtoruk merged commit e7a3313 into main Aug 10, 2026
5 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