Skip to content

feat(tui): add inbox session workflow - #40051

Open
R44VC0RP wants to merge 10 commits into
v2from
tui-inbox-tabs
Open

feat(tui): add inbox session workflow#40051
R44VC0RP wants to merge 10 commits into
v2from
tui-inbox-tabs

Conversation

@R44VC0RP

@R44VC0RP R44VC0RP commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an optional tabs.layout: \"inbox\" presentation with Active/Today/Yesterday/Earlier groups, recency ordering, assistant previews, unread state, and stable numbering
  • add keyboard and pointer workflows for focusing the inbox, moving through visible rows, opening sessions, confirming tab completion, creating new tabs, and returning focus to the prompt
  • keep top-strip behavior as the default and fall back to it on narrow terminals
  • remove deferred session-mount scroll corrections that caused a visible tab-switch jump
  • roll terminal execution timestamps through the full session ancestor chain so nested subagent activity preserves parent inbox recency after restart

Interaction

  • left from an empty prompt focuses the inbox
  • up / down / tab / shift+tab move through visible sessions
  • enter opens the selected session
  • press space twice to mark a tab done and close it
  • option/alt+1-9 selects the matching visible inbox row; ctrl+x, then 1-9 remains available
  • option/alt+t or ctrl+x, then n creates a new tab and focuses its prompt
  • /tabs switches between inbox and top-strip layouts

Testing

  • packages/tui: bun test (595 passed, 5 skipped)
  • packages/tui: bun typecheck
  • packages/core: bun test test/session-projector.test.ts (14 passed)
  • packages/core: bun typecheck
  • repository pre-push monorepo typecheck (33 packages)

@R44VC0RP
R44VC0RP marked this pull request as ready for review August 1, 2026 15:05

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for four concrete regressions:

  1. packages/tui/src/config/v1/keybind.ts:88 adds ctrl+t to session_new, while variant_cycle still owns the same default at line 142. Both commands are registered in the global app layer, so this shadows an existing default action. Keep ctrl+t on one command only or explicitly migrate the variant shortcut.

  2. packages/tui/src/component/session-inbox.tsx:104-119 hides 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.

  3. packages/tui/src/component/session-inbox.tsx:184-190 and packages/tui/src/context/session-tabs.tsx:121-125 group and order rows from cached SessionInfo.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.

  4. packages/tui/src/app.tsx:1242-1253 consumes a 28-40 column rail, but packages/tui/src/routes/session/index.tsx:202-209 still 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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

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