Add full TUI mouse support across panels, modals, and status bar. - #2
Merged
Merged
Conversation
Introduce per-frame hit regions and a centralized mouse event loop so clicks and scroll wheel mirror existing keyboard actions: panel focus and list selection, double-click to run commands or open job logs, Shift+click multi-select, modal row activation, backdrop dismiss, wheel scrolling in preview and modals, clickable status bar chips, and edit modal cursor placement with path suggestion picks. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Introduce per-frame hit regions and a centralized mouse event loop so clicks and scroll wheel mirror existing keyboard actions: panel focus and list selection, double-click to run commands or open job logs, Shift+click multi-select, modal row activation, backdrop dismiss, wheel scrolling in preview and modals, clickable status bar chips, and edit modal cursor placement with path suggestion picks.
Summary
Adds comprehensive mouse interaction to the chronosphere TUI while keeping the keyboard as the primary input. Mouse actions reuse existing command paths (run, focus, modal activate, dismiss) rather than duplicating logic.
Phase 1 — Focus, selection, dismiss
src/ui/layout.rs) for categories, commands, preview, jobs, and modalsPhase 2 — Scroll wheel
Phase 3 — Double-click & Shift+click
LastMouseClick/MouseClickTarget(~450ms window)Phase 4 — Status bar & edit modal
src/ui/textarea_mouse.rsfor textarea scroll/cursor mappingArchitecture
App.hit: HitRegionsupdated each frame inui::drawApp::handle_mouse→handle_mouse_click/handle_mouse_scrollFiles changed
src/ui/layout.rs,src/ui/textarea_mouse.rssrc/app.rs,src/ui/mod.rs