Parent new project tabs to Home, not the active tab - #183
Merged
phil-kremidas-unitedmasters merged 1 commit intoAug 7, 2026
Conversation
Hitting the control-prefix + space from a shell tab spawned a pending project tab that appeared nowhere in the tab bar. `spawn_pending_project_tab` bound `home_id` from `self.tabs.active_id()` — the name was aspirational; a shell tab is `rank == Home` too, so the new tab was parented under it. `compute_display_order` only descends from `tabs[0]` and prunes non-claude tabs without walking their children, so the tab was unreachable in both passes. It still rendered in the main pane (driven by `active_id`) and was focused, leaving the user typing a prompt into an invisible tab with no number assignment and no way to navigate back to it. Fetch the actual Home tab instead. Shell tabs having no children is the invariant; this call site was the one violating it. Also add `Tabs::home_id()` and route the two inlined `tabs.first()` lookups in `compute_display_order` / `compute_number_assignments` through it, so the "Home is tabs[0]" rule has one definition rather than three copies. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
Hitting the control prefix + space from a shell tab spawns a pending project tab that appears nowhere in the tab bar.
spawn_pending_project_tabboundhome_idfromself.tabs.active_id()— the name was aspirational. A shell tab isrank == AgentRank::Hometoo, sohandle_spawn_agentcorrectly routes there, but the new tab then got parented under the shell tab instead of Home.compute_display_orderonly descends fromtabs[0], and its tail loop appends non-claude tabs without walking their children — so a claude tab hanging off a shell tab is unreachable in both passes.new_pendingalso hardcodesdepth: 1, which only makes sense with Home as the parent.The failure mode was worse than a missing tab-bar row: the main pane renders from
tabs.active()(independent ofdisplay_order) and the spawn callsfocus_tab, so you land in a live, focused, invisible tab — no number assignment, skipped byNavigateSibling/NextIdle, and permanently unreachable once you navigate away.Fix
Fetch the actual Home tab. Shell tabs having no children is the invariant; this call site was the one violating it, so
compute_display_orderis left as-is.Also adds
Tabs::home_id()and routes the two inlinedtabs.first()lookups incompute_display_order/compute_number_assignmentsthrough it — the "Home istabs[0]" rule now has one definition instead of three copies, which is how the misnamed binding slipped by.Testing
cargo buildclean,cargo test78 passed. Not exercised in a running app — worth a manual check that control prefix + space from a shell tab now lands the pending project tab under Home.🤖 Generated with Claude Code