Skip to content

Add mouse wheel scrolling to Expert Panel#67

Merged
Cassin01 merged 1 commit into
mainfrom
feat/scroll_by_wheel
Apr 19, 2026
Merged

Add mouse wheel scrolling to Expert Panel#67
Cassin01 merged 1 commit into
mainfrom
feat/scroll_by_wheel

Conversation

@Cassin01
Copy link
Copy Markdown
Owner

Summary

  • Route MouseEventKind::ScrollUp/ScrollDown over the Expert Panel rect to a new handle_mouse_wheel helper; first wheel-up enters scroll mode via capture_full_history (mirroring PageUp), subsequent ticks advance scroll_offset by WHEEL_SCROLL_LINES = 3. Wheel down re-enables auto-scroll at the bottom.
  • Suppress wheel events while modals own the screen (help, role selector, report Detail) and when the cursor is outside the panel. Focus is preserved — wheel scrolling never calls set_focus.
  • Add 7 property tests in src/tower/app.rs::tests covering hit-test scope, direction, focus preservation, and modal/hidden-panel suppression.

Includes pre-existing branch commit 4908e16 (remove pending status write-back after expert exit).

Design: .macot/specs/expert-panel-mouse-wheel-scroll-design.md
Tasks: .macot/specs/expert-panel-mouse-wheel-scroll-tasks.md

Test plan

  • make ci — 820 tests passed, clippy clean under -D warnings, fmt-check green
  • Manual smoke test (design §5.3): wheel up enters [SCROLL MODE], [N/M] indicator moves, wheel down re-pins at bottom
  • Wheel over TaskInput / help modal open → no panel state change (focus preservation, modal suppression)
  • Verify on iTerm2 / Terminal.app / tmux that ScrollUp/ScrollDown events are emitted

Extend the Event::Mouse dispatcher to route ScrollUp/ScrollDown events
to a new handle_mouse_wheel helper. Wheel up over the panel enters
scroll mode on the first tick (via capture_full_history, mirroring
PageUp), then advances scroll_offset by WHEEL_SCROLL_LINES=3 per tick.
Wheel down scrolls forward and re-enables auto-scroll at the bottom.

Wheel events are suppressed when modals own the screen (help, role
selector, report Detail view) and when the cursor is outside the
panel rect. Focus is preserved — wheel events do not call set_focus.

Add 7 property tests covering hit-test scope, direction, focus
preservation, and modal/hidden-panel suppression.
@Cassin01 Cassin01 merged commit a4ef6c6 into main Apr 19, 2026
1 check 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