Skip to content

tui: select a project/archived row before its click toggles it - #1163

Merged
edwin-zvs merged 1 commit into
mainfrom
list-group-click-select-first
Aug 2, 2026
Merged

tui: select a project/archived row before its click toggles it#1163
edwin-zvs merged 1 commit into
mainfrom
list-group-click-select-first

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

What

Clicking a project header or an "N archived" disclosure row in the session list toggled collapse/expand on the very first click, even when that row wasn't selected. Reaching for a project with the mouse — to select it, act on it, or just see it highlighted — folded it as a side effect and shifted every row below out from under the cursor, so the next click landed somewhere the user never aimed at.

Both rows now take two clicks:

Click Behavior
Row not selected Select it. Nothing collapses/expands/reveals.
Row already selected Toggle it (collapse project / reveal archive).

Unchanged:

  • Ordinary session and service rows — still select-only.
  • Column-specific disclosure markers (a session's nested-children marker, a service's children marker) — still toggle on the first click, since aiming at a single column is already an unambiguous intent.
  • Keyboard collapse/expand, which operates on the selection and so is already "selected first".

Notes

  • Spec specs/0178-list-row-click-selects-before-toggling.md records the rule so future full-row toggles follow it.
  • Two new unit tests in crates/cli/src/app.rs cover the select-then-toggle sequence for the project header and the archived row.
  • No recording: the change is mouse-interaction-only with no static visual difference, and vhs tapes can't emit mouse clicks.

Testing

  • cargo test --workspace — all green. One unrelated flake on the first run (pty_render::tests::smith_tool_expand_collapse_rebuilds_only_retained_suffix, a wall-clock perf assertion that tripped while a concurrent cargo build loaded the machine); passes on its own.

Binary

Only touches crates/cli → relevant binary is construct:
/Users/moon/agentd/.claude/worktrees/list-group-click-select-first/target/debug/construct

Clicking a project header or an "N archived" disclosure row toggled it
open/closed on the first click, even when the row wasn't selected.
Reaching for a project with the mouse folded it as a side effect and
shifted every row below out from under the cursor.

Both rows now take two clicks: the first only moves the selection there,
the second toggles. Column-specific disclosure markers (a session's
nested children, a service's children) are unchanged — aiming at those
is already unambiguous.
@edwin-zvs
edwin-zvs merged commit 4b40d48 into main Aug 2, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the list-group-click-select-first branch August 2, 2026 14:09
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