Skip to content

Parent new project tabs to Home, not the active tab - #183

Merged
phil-kremidas-unitedmasters merged 1 commit into
masterfrom
fix-pending-project-tab-parent
Aug 7, 2026
Merged

Parent new project tabs to Home, not the active tab#183
phil-kremidas-unitedmasters merged 1 commit into
masterfrom
fix-pending-project-tab-parent

Conversation

@phil-kremidas-unitedmasters

@phil-kremidas-unitedmasters phil-kremidas-unitedmasters commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

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_tab bound home_id from self.tabs.active_id() — the name was aspirational. A shell tab is rank == AgentRank::Home too, so handle_spawn_agent correctly routes there, but the new tab then got parented under the shell tab instead of Home.

compute_display_order only descends from tabs[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_pending also hardcodes depth: 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 of display_order) and the spawn calls focus_tab, so you land in a live, focused, invisible tab — no number assignment, skipped by NavigateSibling/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_order is left as-is.

Also adds Tabs::home_id() and routes the two inlined tabs.first() lookups in compute_display_order / compute_number_assignments through it — the "Home is tabs[0]" rule now has one definition instead of three copies, which is how the misnamed binding slipped by.

Testing

cargo build clean, cargo test 78 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

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>
@phil-kremidas-unitedmasters
phil-kremidas-unitedmasters merged commit 7f94b94 into master Aug 7, 2026
5 checks passed
@phil-kremidas-unitedmasters
phil-kremidas-unitedmasters deleted the fix-pending-project-tab-parent branch August 7, 2026 16:26
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.

2 participants