Skip to content

mecatui: rationalize mouse selection and activation across modals and surfaces #769

Open

Description

@Derek2Tu

Goal

Decide one coherent mouse interaction contract for mecatui modals and surfaces, document it in docs/tui.md, then reconcile the implementations and tests. This issue owns both missing mouse support and inconsistent selection/activation semantics.

MCP picker PR #2763 merged on 2026-11-18 as bb7767e16. It ships single-click selection without activation, clickable argument Cancel/Submit, and an incremental mouse-support standard in docs/tui.md. It does not complete this cross-surface rationalization.

Recommended next UI slice: refresh the survey on current main, settle the row-click contract with the operator, then reconcile surfaces in small batches. The current guide's select/reveal-only behavior is the starting proposal, not approval of a final cross-surface contract. Explicitly resolve the Tool calls inspector's immediate-detail exception and repeated/double-click behavior before changing implementations. Missing row-click support and visible keyboard-only action buttons are separate adoption gaps.

Survey: historical baseline (refresh before implementation)

Surveyed 2026-11-11 against ecf9a23ae. This is source/test evidence, not a fresh interactive test of every surface.

All source paths below are under cmd/mecatui/ui/.

Surface Single/repeated left-click on a row Production/test evidence
Models Selects/reveals only. Choose applies the model selection. Re-clicking the selected row does not activate. models_surface.go:147-183; bounded_scroll_adoption_test.go:544-613
Reflections Selects only, including wrapped continuations. Open/Choose fetches detail; lifecycle action buttons enter confirmation before mutation. reflections.go:185-206,433-451,497-548; reflections_test.go:451-492
Dream targets Selects only. Choose starts generation and model/token spend. dream.go:149-151,229-237,325-345; dream_test.go:801-855
MCP resources/prompts Selects/reveals only. Choose reads a resource, gets a prompt, or opens required arguments. mcp.go:540-558; mcp_manual_geometry_test.go:14-139
Tool calls inspector Selects and immediately opens read-only detail, even for an already-selected row. toolcalls.go:87-117,921-930; toolcalls_inspector_scenario_test.go:709-747
Skills No row-click support; external inventory is scroll/filter-only. skills.go:125-175,567-607
Sessions No row-click support. Choose opens/loads a transcript; fork/rename/delete are separate actions. sessions_surface.go:374-397,537-620
Schedule and run lists No row-click support. Choose opens schedule/run detail; mutations have separate keyboard actions. schedule.go:452-591,727-743; schedule_surface_test.go:567-595
Agents: subagents, parallel groups/branches, teams No row-click support. Choose focuses detail; cancel is a separate action. agents_overlay.go:214-452,706-731; team.go:172-225
Usermodel No row-click support. Choose fetches read-only detail. usermodel.go:84-153,236-300; usermodel_bounded_more_test.go:503-507
Connect No row-click support. Choose enters confirmation before restart/sign-in intent. connect.go:141-168,222-249,356-425; connect_surface_test.go:175-205

Buttons are a separate interaction

  • Approval verdict buttons resolve Allow/Deny/Always through the same resolveAsk path as keyboard verdicts (approval_surface.go:80-168; approval_surface_migration_test.go:271-292).
  • Reflections buttons perform the named Open/Approve/Reject/Undo action; consequential operations use confirmation (reflections.go:497-548).
  • MCP argument Cancel/Submit buttons use keyboard cancellation and validation/submission (mcp.go:551-555).
  • Schedule Create/Cancel and Connect confirmation are keyboard-only despite visible controls (schedule_create.go:428-482; connect.go:356-425).

No modal double-click convention

Modal routing consumes clicks before transcript multi-click counting (update.go:4389-4402 versus 4430-4483). Repeated selected-row clicks are independent clicks, not an activation gesture. There is no implemented modal-wide double-click-to-activate contract.

Documentation discrepancy

docs/tui.md:103-108,121-145 prescribes enabled-row selection/reveal without activation and mouse support as surfaces are added or modernized. Models, Reflections, Dream, and MCP follow those semantics; Tool calls is an actual semantic exception. Surfaces with no row clicks are adoption gaps, not evidence for either activation convention.

The infrastructure already provides opaque, current-frame ClickableRegion IDs and parent-owned coordinate mapping (surface.go:281-298, hit_regions.go:3-20). Do not assume a new HandleClick framework is necessary; the older issue's suggested mechanism predates these paths.

Decisions to make before implementation

  • What does a single row click mean: highlight only, activate, or a documented distinction between read-only navigation and applying a choice/starting work?
  • Should repeated clicks or double-clicks activate anything? Do not assume existing transcript multi-click behavior applies to modals.
  • Which actions require a separate explicit control or confirmation, including model spend, permission decisions, server mutations, and prompt replacement?
  • What mouse behavior is required for visible form controls and action buttons? Preserve keyboard parity and validation.
  • Define border/padding/overflow/disabled/compact/pending behavior and which exceptions, if any, are intentional.

Delivery checklist

  • Refresh the survey against the implementation baseline and identify affected surfaces.
  • Agree the interaction contract and document the rationale and any intentional surface-specific exceptions.
  • Update docs/tui.md to state that contract, including row selection versus activation, visible buttons, keyboard parity, wheel behavior, and safety boundaries.
  • Reconcile all affected modals/surfaces with the agreed contract; implement missing pointer support without unrelated backend/API expansion.
  • Reuse current-frame surface regions and parent placement; preserve --no-mouse, debug mouse conventions where applicable, and modal isolation from underlying controls.
  • Add routed Model.View/Model.Update regressions for normal and already-selected clicks, multiline/wrapped/partially visible and scrolled rows, buttons/validation, confirmation, misses, empty/disabled/loading states, stale hits/resize, compact restoration, and any chosen multi-click semantics.
  • Verify consequential actions occur only as specified, with duplicate/stale action protection; keep keyboard-only operation available.

Related scope

This updates the existing mouse-selection issue rather than opening an overlapping rationalization issue.

Activity

  1. added
    enhancement
    tui
    on Aug 26, 2026
  2. self-assigned this
    on Aug 26, 2026
  3. changed the title [-]mecatui: click-to-select a row in the TUI picker/overlay lists (skills, models, agents, MCP, schedule, etc.)[/-] [+]mecatui: rationalize mouse selection and activation across modals and surfaces[/+] on Nov 11, 2026
  4. jbeda commented on Nov 21, 2026

    @jbeda
    Contributor

    Saved memory list/detail (C01) is implemented in #2948, commit 656193dc8. The PR is open, not merged; this does not close this umbrella.

    • Entry rows select/reveal only, including wrapped keys and partial description continuations. Repeated clicks never inspect.
    • Explicit Inspect/Close and detail Back share keyboard semantics, configured binding availability, and current-frame routing. Wheel browsing retains the selected key; Inspect uses that exact key even offscreen.
    • Existing read-only operations, async ownership, independent list/detail windows, compact fallback, and no-mouse keyboard operation are preserved. No memory mutation UI, adjacent-modal migration, or new framework is included.
    • Evidence: usermodel_mouse_test.go real root View/Update regressions cover row/button routing, wrapped controls at both label endpoints, unavailable states, late replies and stale targets, compact restoration, no-mouse, and inert non-targets. Existing exact-detail/history/rail regressions remain. Five intentional Saved memory golden frames were reviewed.
    • Passed focused Saved memory/markings tests, full bounded + UI package suites, task test:golden, task lint, and independent review with targeted rechecks. Interactive terminal checks were not available; automated coverage is not usability verification.

    Coordination correction to the historical issue text: the operator has settled enabled-row clicks as select/reveal-only, including repeated selected-row clicks; activation uses a separate explicit control or existing keyboard binding. The existing docs/tui.md now states that contract. Tool calls, Effort, Worktrees, Connect, and Models have already been assessed as reference implementations, so the old Tool calls immediate-detail exception and “settle before implementation” wording are historical, not pending decisions for C01. This slice needed no guide change.

    Remaining scope stays modal/subview-specific. C02 Sessions inventory wheel browsing and then inventory pointer controls are possible next slices, not started here. Rename/delete, transcript reader assessment, maintenance, startup recovery, and the other modal families remain separate work; #1896 remains completed bounded-history context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementtui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions