Add mouse support to TUI: click to select, drag to copy, scroll wheel#2705
Add mouse support to TUI: click to select, drag to copy, scroll wheel#2705domenkozar wants to merge 1 commit into
Conversation
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code: Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2026-04-08T09:41:50.203Z |
| if is_double_click { | ||
| *last_click.write() = None; | ||
| if let Ok(mut ui) = ui_state.write() { | ||
| ui.selected_activity = Some(activity_id); |
There was a problem hiding this comment.
This branch never switches to ViewMode::ExpandedLogs, so a double-click only selects the activity instead of expanding it. It also means the first click never selects anything, because selected_activity is only written in the double-click path.
| } | ||
| } | ||
| } | ||
| MouseEventKind::ScrollDown | MouseEventKind::ScrollUp => { |
There was a problem hiding this comment.
I think this wheel handler duplicates ScrollView's own mouse scrolling. view() already wraps the activity list in ScrollView, and iocraft handles ScrollUp/ScrollDown there, so each wheel tick over the list should scroll twice.
| let canvas_height = activity_area_height + SUMMARY_BAR_HEIGHT as i32; | ||
| // Canvas starts at initial_cursor_row, but if it would overflow the | ||
| // terminal, the terminal scrolls so canvas_bottom = terminal_height - 1. | ||
| let canvas_top = (initial_cursor_row as i32).min(terminal_height as i32 - canvas_height); |
There was a problem hiding this comment.
I don't think terminal-level canvas_top math is valid here. use_terminal_events rewrites FullscreenMouse coordinates into the component's local coordinate system before MainView sees them, so subtracting initial_cursor_row / canvas_top again shifts hit testing and drag selection.
Enable mouse capture for process views (up/processes up). Supports double click to expand an activity, drag to select and copy activity names via OSC 52, and scroll wheel navigation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a296068 to
4950713
Compare
Deploying devenv with
|
| Latest commit: |
4950713
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f0df531f.devenv.pages.dev |
| Branch Preview URL: | https://tui-mouse-support.devenv.pages.dev |
Enable mouse capture for process views (up/processes up). Supports double click to expand an activity, drag to select and copy activity names via OSC 52, and scroll wheel navigation.
It has a bug of calculating y axis wrong.