You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(tui): mouse click and double-click support (#293)
## Summary
- Enables `MouseModeCellMotion` on all three TUI model `View()` methods
so mouse events are delivered to the app
- Left-click on the tab bar switches views (fires same init commands as
keyboard — fixes Tasks showing blank on first click)
- Left-click in list/tree area moves cursor across all views (sessions,
tasks, messages, docs, store); clicks in preview/detail panes are
correctly ignored using each view's actual split-ratio math
- Double-click within 300ms at the same cell synthesizes an Enter key
press (activate session, open doc, etc.)
- `PasteMsg` now routes through `handleFallthrough` so bracketed paste
works in text inputs (new session form, rename modal, etc.)
- Notification modal scrolls on mouse wheel; all other wheel events fall
through unchanged
- `switchToView()` consolidates tab-switching logic — keyboard and mouse
tab-bar click now share one path, eliminating duplication
## Bug fixes caught during review
- `messages.Controller.SelectAt` was validating `idx` against
`displayed` instead of `filteredAt` — with an active filter this put
`cursor` out of bounds for `filteredAt`, making `Selected()` return
`nil`
- `messages.View.SelectAtRow` used wrong split-ratio defaults vs the
renderer (bounds `> 90`, default `40` vs `> 80`, default `25` with
`min-20` floor); click hit regions were misaligned from what was
rendered
- `messages.View.SelectAtRow` ignored the filter line when computing the
row offset, causing off-by-one clicks whenever a filter was active
- `sessions.View.SelectAtRow` bounds-checked against `Items()` instead
of `VisibleItems()`, allowing clicks to select hidden items when the
list was filtered
- `kv_view.SelectAtRow` accepted clicks anywhere in the row, including
the preview pane; now guards against clicks right of the key-list pane
- Tab bar click previously bypassed the `isModalActive()` guard,
silently switching views while modals were open
- Double-click state now resets on view switch to prevent a stale
cross-view double-click
## Test plan
- [ ] `mise run check` passes (0 lint issues, all tests green)
- [ ] Click a session row to select it; double-click to activate (open
in terminal)
- [ ] Click the Tasks/Messages/Docs/Store tab labels to switch views
- [ ] Click a task row; detail pane updates; clicking in the detail pane
does not move the cursor
- [ ] Click a doc in the Docs tree; preview updates in right pane
- [ ] Paste text into the new-session form using terminal paste (Cmd+V /
bracketed paste)
- [ ] Open notification modal, scroll with mouse wheel
- [ ] With a modal open (rename, confirm), click a tab → view should NOT
switch
0 commit comments