Skip to content

[CPLAT-12912] Keyboard-first mouse convention: wheel 3, Clicks, picker mouse, overlay ownership - #178

Merged
gavin-jeong merged 2 commits into
masterfrom
CPLAT-12912-mouse
Oct 20, 2026
Merged

gavin-jeong merged 2 commits into
masterfrom
CPLAT-12912-mouse

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-12912

Brings ccx to the fleet keyboard-first mouse convention. The existing mouse.go (split-border drag, list click, viewport wheel, copy-mode scroll) is kept; this closes the gaps.

Changes

  • Wheel step is 3 (tuikit mouse.WheelRows), was 1. Applies to lists, previews, fold block cursor and the execution rail.
  • Hand-rolled double click (doubleClickThreshold, lastClickY/Time) replaced by tuikit mouse.Clicks, keyed by the clicked item (session ID / list index / preview block). A second click on the same item runs the Enter path; a click on empty rows never counts.
  • RunPicker (urls/files/refs/changes/conversation pickers) now has mouse: click selects (multi-line rows hit via mouse.BlockHit), second click is Enter, wheel moves 3, preview wheel scrolls 3, the ref sub-picker owns the mouse, search line ignores it. View and the hit test share renderListLines.
  • Every overlay in internal/tui (21 entries in mouseOverlays) owns the mouse while open: scrollable ones follow the wheel via their own up/down keys, others swallow it, a click outside is the overlay's Esc, nothing reaches the base. Overlay bounds are measured from View (with vs without the overlay) so there is no second copy of the layout math.
  • All tea.NewProgram calls use mouse.ProgramOptions(). tuikit bumped to c905dce.
  • New code lives in mouse_clicks.go, mouse_overlay.go, internal/cli/picker_mouse.go; app.go only swaps two fields for one.

Not done

  • Wheel does not move focus between panes (existing behaviour kept; changing it alters fold-preview scrolling).
  • Clicking menu rows is not wired: those menus select by letter, not by row.

Tests

go vet, go test -race, ko_KR locale run, gofmt clean. TestDayCursorMoveCost (a 60fps timing test) failed once when the whole repo ran in parallel under load and passes alone and on rerun; unrelated to this change.
Mutations (all compile) and the test that fails: picker scroll offset dropped -> TestPickerClickRespectsScrollOffset; list page start dropped -> TestClickOnSecondPageSelectsThatRow; overlay rect = whole screen -> TestOverlayOutsideClickClosesAndIsolatesBase/*; wheel step 1 -> TestWheelScrollsFocusedPreviewByThreeLines; overlay wheel falls through -> TestOverlayWheelNeverReachesBaseOrDismisses/config_actions; click key ignores item -> TestSecondClickOnDifferentRowOnlySelects.

Security checklist (Infrastructure code)

  • I have checked below conditions:
    • This PR doesn't contain any SecurityGroup rule changes which are not allowed via INF Jira ticket
    • This PR doesn't contain any public open SecurityGroup inbound rules(0.0.0.0/0) except the predefined service port
    • This PR doesn't contain any resources in a public subnet except those are needed with a specific technical reason
    • This PR doesn't contain any credentials (AWS Secret key, password, API tokens, etc)
    • This PR doesn't contain any IAM users which are not allowed via UAC Jira approval

- wheel steps 3 (tuikit mouse.WheelRows) instead of 1
- double click uses tuikit mouse.Clicks keyed by item; empty-area clicks never activate
- picker (RunPicker) gets mouse: click selects, second click is Enter, wheel moves 3
- every overlay owns the mouse while open: wheel drives scrollable ones, outside click is its Esc
- program options come from mouse.ProgramOptions()
- bump tuikit to c905dce
@upwind-code-us

upwind-code-us Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Upwind Upwind Code Scan - ✅ Passed

0 newly introduced vulnerabilities · 0 resolved · 2 total in this PR vs master

Total breakdown: 🔶 2 High

View full analysis in Upwind Console

Scan completed in 9s

Scan history (2 scans)
Commit Scanned at New Resolved Net
fe52488 2026-10-20 02:39 UTC 0 0 0
ab53805 < 2026-10-20 02:59 UTC 0 0 0

Last scanned: ab53805 · 2026-10-20 02:59 UTC

Codex found on the ccproxy rollout that click, j, k, click on the same row
read as a double click and fired Enter, because only mouse presses touched
the detector. Reset it in the KeyMsg arm of the app and the picker.
@gavin-jeong
gavin-jeong requested a review from Kairo-Kim October 20, 2026 08:25
@Kairo-Kim Kairo-Kim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Oct 20, 2026
@gavin-jeong
gavin-jeong merged commit 4f376d4 into master Oct 20, 2026
5 checks passed
@gavin-jeong
gavin-jeong deleted the CPLAT-12912-mouse branch October 20, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants