feat(tui): add inbox session workflow - #40051
Conversation
There was a problem hiding this comment.
Requesting changes for four concrete regressions:
-
packages/tui/src/config/v1/keybind.ts:88addsctrl+ttosession_new, whilevariant_cyclestill owns the same default at line 142. Both commands are registered in the global app layer, so this shadows an existing default action. Keepctrl+ton one command only or explicitly migrate the variant shortcut. -
packages/tui/src/component/session-inbox.tsx:104-119hides attention whenever a session is busy and renders the ordinary activity spinner instead. Sessions remain busy while blocked on permission/form input, so the inbox loses the signal that user action is required. Attention should override busy, matching the top-tab implementation. -
packages/tui/src/component/session-inbox.tsx:184-190andpackages/tui/src/context/session-tabs.tsx:121-125group and order rows from cachedSessionInfo.time.updated. Live input/message/execution events update the local message/status stores but not that timestamp, so a background session can complete new work and fall back to an old position or remain under Yesterday/Earlier. Use a live activity timestamp or advance cached recency on relevant events. -
packages/tui/src/app.tsx:1242-1253consumes a 28-40 column rail, butpackages/tui/src/routes/session/index.tsx:202-209still computes the wide breakpoint, sidebar visibility, and content width from the full terminal width. At widths just over 120 this can auto-open the 42-column sidebar after the inbox has already consumed roughly a third of the viewport, and downstream rendering receives a width larger than its actual container. Base those calculations on the post-inbox viewport or account for the rail centrally.
Non-blocking style cleanup: session-inbox.tsx:208 adds an else if; the repository guide asks us to avoid else. Return after the top-scroll branch, then check the bottom branch.
Validation: packages/tui has 591 passing tests, 5 skipped, and bun typecheck passes locally. git diff --check also passes.
There was a problem hiding this comment.
Reviewed the follow-up at dbd9346: the ctrl+t collision is removed, attention now overrides busy presentation, inbox recency tracks live activity, and session layout calculations use the post-inbox viewport. The else branch was also removed. Local packages/tui validation: 593 passed, 5 skipped; bun typecheck passed; scoped oxlint reported no errors.
There was a problem hiding this comment.
One remaining correctness gap before merge: packages/tui/src/context/session-tabs.tsx:227 hydrates a root with data.session.sync(sessionID, { children: true }), but that API fetches only sessions whose parentID is the root. updated() can fold every loaded family member, yet after a restart grandchildren and deeper descendants are absent, so nested-subagent completion recency is still lost. This is a supported shape—the data context explicitly indexes arbitrarily deep families. Please either hydrate descendants recursively (and add a root -> child -> grandchild restart test) or roll terminal activity up to ancestors in the projector so loading the root is sufficient. Everything else in 7295315 looks good; all GitHub checks pass, and local TUI tests/typecheck plus the core projector test pass.
There was a problem hiding this comment.
Re-reviewed 094dac1. Terminal execution activity now rolls up through the full ancestor chain, guards against cycles, and only advances timestamps; the new root/child/grandchild projector test covers the restart gap. Local core projector suite passes (14/14). This resolves my remaining finding; code is ready once the current CI run is green.
Summary
tabs.layout: \"inbox\"presentation with Active/Today/Yesterday/Earlier groups, recency ordering, assistant previews, unread state, and stable numberingInteraction
leftfrom an empty prompt focuses the inboxup/down/tab/shift+tabmove through visible sessionsenteropens the selected sessionspacetwice to mark a tab done and close itoption/alt+1-9selects the matching visible inbox row;ctrl+x, then1-9remains availableoption/alt+torctrl+x, thenncreates a new tab and focuses its prompt/tabsswitches between inbox and top-strip layoutsTesting
packages/tui:bun test(595 passed, 5 skipped)packages/tui:bun typecheckpackages/core:bun test test/session-projector.test.ts(14 passed)packages/core:bun typecheck