Repository navigation
feat(tui): open the first busy tab when the picker opens with down - #64972
Conversation
User decisions: - Pressing down opens the first picker tab that has something in it
There was a problem hiding this comment.
Works as described. With only a background shell running, ↓ now opens the picker on Shell instead of Subagents' "No active subagents". I checked this with an opencode-drive run on the base and on this PR, using a session-owned shell started through the SDK. The composer-tabs test and tsc -b in packages/tui pass.
Public API: unchanged. This is TUI-internal; the keybind and the plugin dispatch argument behave as before.
One small maintainability point inline: only the tab order is shared, so the busy checks are still written twice.
| item.delivery === "queue" ? [{ id: item.id, text: item.payload.text, payload: item.payload }] : [], | ||
| ), | ||
| ) | ||
| const openingTab = () => { |
There was a problem hiding this comment.
This re-derives the footer's scripts/subagents/shells checks from feature-plugins/prompt/footer.tsx, so only the tab order is shared between ↓ and the pill. If either copy changes (for example, how subagent jobs or shells are counted), the two paths will open different tabs again. Could the busy flags come from one shared helper, maybe next to busyTab, that both places call?
User decisions: - Address the review on the down-key PR
There was a problem hiding this comment.
The new commit fixes the earlier point: the footer and ↓ now both use busyCounts, so the pill and the picker can't drift apart. I re-ran the drive check on the new head: with only a background shell running, ↓ still opens Shell. The composer-tabs test and tsc -b in packages/tui pass. Public API: unchanged. No new concerns.



Issue for this PR
Follow-up to #64956.
Type of change
What does this PR do?
Pressing ↓ (
session.child.first) always opened the picker on Subagents, so with only a script or shell running it showed "No active subagents". Clicking the footer pill already opened the first tab with something in it.Both paths now use one helper,
busyTabinroutes/session/composer/tabs.ts: Scripts, else Subagents, else Shell (the order the pill already used), falling back to Subagents when nothing is running. A tab passed by a command or plugin still wins. No flag: this is a small change to an existing keybind.How did you verify your code works?
bun run typecheck:tscin packages/tuibun test --timeout 30000 test/routes/composer-tabs.test.tsx(newbusyTabcase)Screenshots / recordings
Drive recording made locally.
Checklist