Skip to content

feat(tui): switch sessions in two keys (C) - #527

Merged
lg2m merged 8 commits into
mainfrom
feat/eng-1107-switcher
Nov 1, 2026
Merged

lg2m merged 8 commits into
mainfrom
feat/eng-1107-switcher

Conversation

@lg2m

@lg2m lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Change

Section C of the v0.1.11 plan: switch sessions in two keys. Closes ENG-1107.

  • Lists show sessions; a session's agents fold into its row as ↳N. An agent
    whose parent is not loaded is a session.
  • Ctrl-T ("switch session"), /sessions, /resume and /agents open one
    switcher in the dock: glyph, title, ↳N, age, and the latest answer line,
    with a few answer lines under the highlighted row. Typing ranks title
    prefix, then word prefix, then subsequence, then agent titles
    (Session › agent), then answer text; ties go to the most recent. Tab
    unfolds a session's agents, Ctrl-A lists every agent, Ctrl-D deletes.
    The cursor opens on the previous session, so Ctrl-T Enter goes back, and
    falls back to the session when its agent row stops being listed.
  • Ctrl-^ (also Ctrl-6) swaps to the previous session; rebindable as
    previous_session in tui.ron.
  • The rail rolls agents up: NEEDS YOU when any agent waits on you, WORKING
    when any runs, RECENT for idle and done. Rows show inclusive spend. An agent
    gets its own row only when it waits on you or is focused, at most 6, then
    +N more. Rows are clickable, and Alt-1…Alt-9 focus them.
  • One attention order (approvals, failures, unseen finishes, newest first)
    feeds Ctrl-G, Alt-A/Alt-D, /attention and the rule.
  • Audit sessions and everything under them are excluded from every list,
    count, picker, navigation key and attention surface.
  • A forced focus move drops a half-typed answer. A hidden agent's stream no
    longer wakes a frame.

Verification

  • cargo xtask check: passed on b9705cd (1120/1120 tests).
  • New tests: store attention order, audit exclusion, session/agent split,
    roll-up and inclusive spend (qq-client); Alt-1…9, Ctrl-^/Ctrl-6,
    previous-session default, ranking order, cursor fallback, audit exclusion
    across keys, half-typed answer drop, rail click and stale hit, hidden agent
    stream wake, and the 20-agent fanout rail (qq-tui).
  • Goldens: sessions moved deliberately (agents fold into their session, so
    8 sessions becomes 7); new fanout and switcher scenes.

Known impact

Render bench, interleaved base (3c22b867) vs head binaries, three pairs
pinned to CPU 2, 2,000 samples, median of medians. These are over the plan's
5% gate:

Scene Base Head Change
switcher_50_open_filter_3_close_cycle 132.8 µs 154.9 µs +16.6%
picker_open_close_cycle 45.5 µs 52.2 µs +14.7%
streaming_run_on_32kb_delta_to_frame 392 µs 421 µs +7.4%
resize_ultra_480x120_full_frame 502 µs 535 µs +6.6%

The switcher and picker costs come from the richer rows (age, answer preview,
ranking). The 32 KB stream and resize scenes don't touch the changed code, so
they are likely noise. Faster: rail with 200 agents and 8 streaming −10.4%,
rail frame −4.1%.

Not in this PR: one-release notices for removed spellings (section D; C
removes none).

@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T21:25:07.588760Z b0ad15d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9705cd13e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/app/pickers.rs Resolved
Comment thread crates/qq-tui/src/view/sidebar.rs Resolved
Comment thread crates/qq-client/src/state.rs Resolved
Comment thread crates/qq-tui/src/app.rs Resolved
Configured Alt-digit bindings win over numbered focus; orphan sessions
sort with roots; the rail anchors on a focused agent; a prefetched body
refreshes the open switcher's rows.
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c37ad4614b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/view/sidebar.rs Resolved
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c897c9483

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/qq-tui/src/app.rs Resolved
Comment thread crates/qq-client/src/state.rs Resolved
@lg2m

lg2m commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b0ad15da7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lg2m
lg2m merged commit e53f45b into main Nov 1, 2026
15 checks passed
@lg2m
lg2m deleted the feat/eng-1107-switcher branch November 1, 2026 21:27
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