Skip to content

Add full TUI mouse support across panels, modals, and status bar. - #2

Merged
FGH-2 merged 1 commit into
mainfrom
feat/tui-mouse-support
Jul 3, 2026
Merged

FGH-2 merged 1 commit into
mainfrom
feat/tui-mouse-support

Conversation

@FGH-2

@FGH-2 FGH-2 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

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

  • Per-frame hit regions (src/ui/layout.rs) for categories, commands, preview, jobs, and modals
  • Click-to-focus panels and click-to-select list rows
  • Splash click dismisses startup splash
  • Modal backdrop click dismisses modals (Esc-equivalent)

Phase 2 — Scroll wheel

  • Wheel over main categories / commands / jobs lists moves cursor
  • Wheel over preview scrolls rendered command text
  • Wheel in modals: help, search (match list), job log, CVE list and CVE detail

Phase 3 — Double-click & Shift+click

  • Commands: double-click → run; Shift+click → toggle multi-select
  • Jobs: double-click → open job log
  • Modals: single-click selects row; double-click activates (search commit, engagement/target/ap/pivot/creds switch, variables → edit, CVE detail)
  • Double-click detection via LastMouseClick / MouseClickTarget (~450ms window)

Phase 4 — Status bar & edit modal

  • Status bar chips: click engagement / target / AP / pivot / creds → open modal; jobs segment → focus jobs panel
  • Edit modal: click to place cursor, wheel scroll, single/double-click path suggestions (double-click applies completion)
  • New src/ui/textarea_mouse.rs for textarea scroll/cursor mapping

Architecture

  • App.hit: HitRegions updated each frame in ui::draw
  • Central handlers in App::handle_mousehandle_mouse_click / handle_mouse_scroll
  • Panel/modal renders record list bounds and scroll offsets for accurate hit-testing
  • Help modal documents new mouse bindings

Files changed

  • New: src/ui/layout.rs, src/ui/textarea_mouse.rs
  • Core: src/app.rs, src/ui/mod.rs
  • Panels: categories, commands, jobs, preview, status_bar, splash
  • Modals: ap, creds, cve, edit, engagement, help, job_log, pivot, search, target, variables

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>
@FGH-2
FGH-2 merged commit 7200543 into main Jul 3, 2026
1 check passed
@FGH-2
FGH-2 deleted the feat/tui-mouse-support branch July 3, 2026 17:48
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