feat: subagent tab bar with fork agents, useTab hook, and FRANKENCODE.md - #34
Merged
Conversation
added 3 commits
March 22, 2026 18:26
Tab bar at top of session view showing Main, +, subagents (S1-S4), and fork agents (F1-F2): - Tab toggles focus between tab bar and chat prompt - Left/Right navigates tabs and immediately shows selected session - Enter/Space on + forks Main's conversation into a new F-labeled child - x kills selected agent, Ctrl+C double-press exits app - Shift+Tab cycles agent type (Build/Plan/Docs) - Click on any tab focuses tab bar and navigates Fork agents (F1, F2, ...): - Created via + button, copy Main's conversation history - Cannot spawn subagents (task permission denied + system prompt) - Colored yellow, distinct from LLM-spawned subagents (S1, S2) - Manually promptable, persist until user kills with x Architecture: - useTab hook (tab.ts) — single source of truth for all tab state and actions - TabBar (tabbar.tsx) — pure renderer with single onClick prop - session/index.tsx — thin keyboard dispatcher delegating to hook - 22 unit tests for buildTabs + useTab actions - 12 E2E tmux flows (2 new: tab-bar-navigate, tab-bar-fork) - Permission prompts hidden when tab bar focused, Main blinks when pending - Session.fork() accepts parentID parameter Docs: - New docs/FRANKENCODE.md — overview of all Frankencode features - Updated FRANKENCODE_DIFFERENCES.md — TUI changes, keybinding changes - Updated agents.md — visibility table with tab bar columns, fork agent row - Updated README.md — doc map, architecture diagram - Cross-linked all docs (link, don't copy)
…anup and doc issues - Merged FRANKENCODE_DIFFERENCES.md into FRANKENCODE.md (single doc) - Deleted FRANKENCODE_DIFFERENCES.md, updated all cross-references in 8 docs - Fixed duplicate See Also links in agents.md - Fixed missing onCleanup for ctrlc timer in tab.ts (memory leak) - Fixed "Build/Plan/Docs" → "Build/Plan/etc." in docs (Docs agent may not exist)
Unit tests (tab.test.ts — 30 total, 8 new): - blur() sets focused false - paginate() updates page - click on spawn tab calls spawn - cycle with single session is no-op - kill on current tab navigates to remaining - kill on non-current tab removes without navigation - pending signal (focused + permissions) - select clamps to valid range E2E tmux flows (14 total, 2 new): - tab-bar-kill: create fork, navigate to it, x to kill, verify gone - ctrl-c-hint: Ctrl+C shows hint, auto-clears after 3s - Fixed tab-bar-fork: verify Left navigation back to Main - Fixed slash-threads: lenient wait (ephemeral output) - Fixed agent-cycle + multi-agent-verify: use Shift+Tab (BTab)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a tab bar to the TUI for navigating between the main agent, LLM-spawned subagents, and user-created fork agents. Refactors all tab state into a single
useTabhook. Consolidates docs intoFRANKENCODE.md.Tab bar (
tab.ts+tabbar.tsx)Main │ + │ S1 │ S2 │ F1+forks Main's conversation history into a new F-labeled childxkills selected agent, Ctrl+C requires double-press to exit (first press aborts + shows hint)Fork agents
+button — copies Main's full conversation historytaskpermission denied + system prompt tells LLM)xuseTabhook refactorsession/index.tsxtabbar.tsxsimplified to pure renderer with singleonClickpropDocs
FRANKENCODE_DIFFERENCES.mdintoFRANKENCODE.md— single consolidated docFRANKENCODE.mdFRANKENCODE.mdagents.mdwith tab bar columnsOther fixes
Session.fork()acceptsparentIDto create child forksdefaultPreventedcheck in command dialog handleronCleanupfor ctrlc hint timer (memory leak fix)parentIDparameterTest plan
npx tsgo --noEmit— 0 errors (packages/opencode)bun test --timeout 30000— 1553 pass, 0 fail (+30 new unit tests)bun test/cli/tui/tmux-tui-test.ts— 14 E2E flows pass (+4 new: tab-bar-navigate, tab-bar-fork, tab-bar-kill, ctrl-c-hint)tmux capture-pane: Tab, Left/Right, Enter on +, Down, Ctrl+C double-press, Shift+Tab agent cycling