You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(chat): keep Home first with a floating identity banner - #45421
An agent's page always shows its main chat (Home) as the first, pinned tab. Side chats can no longer be pinned ahead of it. Home also gets a small floating name pill that opens the agent's Activity.
Files
Added
Deleted
Net
Test
6
$\color{#1a7f37}{\Huge{\mathbf{+}}}$595
$\color{#cf222e}{\Huge{\mathbf{−}}}$5
$\color{#1a7f37}{\Huge{\mathbf{+}}}$590
Prod
18
$\color{#1a7f37}{\Huge{\mathbf{+}}}$518
$\color{#cf222e}{\Huge{\mathbf{−}}}$31
$\color{#1a7f37}{\Huge{\mathbf{+}}}$487
What Changed
Scope: agents hosted on this computer only. Paired-server agents are unchanged here; remote support is the next follow-up.
Before: Home was found by session id only. Restored side chats could stay pinned in front of Home, any chat could be pinned, and duplicate Home views could pile up after a restore.
After: Home stays first and pinned. Side chats in the agent's workspace are unpinned on restore, and the pin action is removed for them (the store's pinTab refuses them too). When duplicate Home views exist, the oldest ready view is kept (previews never win over ready views). The extra views close without ending the conversation, and if one of them was focused, focus moves to Home.
Banner: Home gets a tab accent and a floating identity pill. The pill shrinks to its avatar as the transcript scrolls and is hidden when the header content width is 260 CSS px or less.
Mechanism: a shared Home rule (src/shared/bots/bot-home-tab.ts) identifies Home by the agent's chat session, workspace and host, never by tab label or order. Placement, pin rules, close locks and the banner all use it. Placement waits for workspaceSessionReady, so restore ordering can't race it.
Why
Home is where the agent's memory, automations and requests land, so it should always be easy to find. One identity rule keeps placement, pinning and presentation consistent, so they can't disagree about which tab is Home. Remote hosts are left out because their tab restore and ownership need their own design.
Linked Issue
N/A (maintainer change; no pre-existing issue).
Visual Proof
Synthetic fixture data, dark theme.
Local Home, header content exactly 260px (banner hidden, Home pinned)
Paired-server Home (unchanged, banner not rendered)
Testing
Focused unit tests cover: Home identity and selection (ready before preview, then age, then id), placement and duplicate cleanup, Home chat reopen gating, focus after a split restore, the pane header banner (local vs paired), the side-chat pin rule, and mobile tab close. Locally: those 6 test files (23 tests), pnpm typecheck:web, pnpm typecheck:node and pnpm lint pass. Platform: macOS only.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
Reasoned from the code; nothing was measured.
Placement: this subscriber already runs when tabs, groups or layout change. It now also runs once when workspaceSessionReady flips. Each run does a filter and sort over one workspace's tabs for each local agent, which is tiny. A reentrancy guard stops its own pin, unpin and close writes from triggering nested passes.
Selectors: the new store selectors return booleans, so they only re-render when the answer changes. Tab rows check whether Home is local in O(1). Each visible chat pane header and each agent page does one find or some over that workspace's tabs.
Banner: shrinking uses a CSS scroll-driven animation (scroll-timeline), and hiding uses a container query. There's no scroll listener, resize observer or per-frame JS.
No new costs elsewhere: no IPC, polling, timers or main-process work. The pinTab guard does one tab lookup per pin, and pins are user-initiated.
Risk
The riskiest part is that placement automatically closes duplicate Home views and unpins side chats in a local agent's workspace. If the identity rule were wrong, users would see a chat tab close or unpin on that page. It is guarded three ways: it only runs after session restore, a preview never replaces a ready Home, and closes use preserveAgentSession. Placement is the only caller of preserveAgentSession, so other close paths behave as before. Paired, SSH and non-agent workspaces don't change. No saved data or settings format changes. Back out with a plain revert.
Level: Low
Review
Cross-platform: renderer-only UI and store logic, with no OS-specific paths or shortcuts. Only verified on macOS; Linux and Windows not exercised.
SSH/remote: paired and SSH agent pages keep their existing Home placement and get no banner. Local-only gating is checked by executionHostId and the agent's hostId.
Agent/integration compatibility: Home identity uses the agent's chat session pointer. It doesn't depend on agent type, labels or order. Reopening Home after an agent change still works.
Performance: see above. Only cheap boolean selectors, plus a CSS-only scroll effect.
UI quality: the pill has an accessible label, a focus ring and a tooltip, uses theme tokens, and hides at narrow widths.
Security: no new IPC, inputs or persistence.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Keep the Home tab first and prevent side chats from being pinned. Unpin restored side chats on pages owned by this window and use one Home identity rule for placement and presentation.
Add the Home tab accent and a floating identity pill that shrinks on scroll and opens Activity.
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Codex <[email protected]>
Wait for restored local Home tabs, retain the oldest duplicate view without retiring its conversation, and re-resolve Home when its identity changes or its tab disappears. Keep paired and SSH pin behavior unchanged and hide the floating identity banner in narrow panes.
Co-authored-by: Codex <[email protected]>
Use one deterministic selection for cleanup and placement: published views before previews, then creation time and stable tab id. Keep the oldest published Home when an older preview exists, and wait if all matching views are previews.
Co-authored-by: Codex <[email protected]>
Document that scrolling shrinks the Home banner to its avatar while header content widths at or below 260 CSS pixels hide the entire banner. Add synthetic local-breakpoint and paired-server Home fixtures and restore the header store import required for eligibility rendering.
Co-authored-by: Codex <[email protected]>
When a focused duplicate Home view closes, focus is handed to the surviving Home only after Home's final move to the top-left group. Moving a tab keeps the destination group's selection, so activating Home before the move left a side chat selected after a split restore.
Co-authored-by: Claude Opus 5.5 <[email protected]>
The changes add shared predicates for identifying bot Home, local bot chat, and side-chat tabs. Renderer logic uses them to reconcile local Home tabs after workspace readiness, preserve matching sessions when closing duplicates, and control tab pinning and presentation. Bot Home chat creation now checks readiness and existing tabs. The native chat header can display a bot banner that opens the bot activity panel.
Merge Risk: Low · up to 97d95
Home stays first and pinned for local agents in the normal case. Two edge cases should be fixed or accepted: restored local Home tabs without a host may not be recognized, and automatic cleanup of a duplicate Home group can shift focus away from the group the user was in. Neither is likely to block ordinary use.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(chat): keep Home first with a floating identity banner" names the two main changes: Home placement and the floating banner. Both are present in the changeset. It is specific and follow…
Description check
The description follows the template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Risk, Review, Agent skill upstream boundary, and Checklist sections. It explains the before a…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat(chat): keep Home first with a floating identity banner" names the two main changes: Home placement and the floating banner. Both are present in the changeset. It is specific and follows conventional commit form. Scope is local agents only, which the title does not state, but that is a detail rather than a mismatch.
Full details: Description check
Explanation
The description follows the template. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Risk, Review, Agent skill upstream boundary, and Checklist sections. It explains the before and after, the mechanism, and the risk with a back-out path. It includes before/after images in a table. Gaps: the Risk section has no explicit Level value beyond 'Low', which is filled in. The Linked Issue section says N/A rather than linking an issue, and the template says there should always be one for outside contributors, but the author is a maintainer. The AI Disclosure section is omitted, which is acceptable for internal contributors. The final lint/typecheck/test/build checklist item is unchecked, and the Testing section says only some checks passed. The Testing item 'Every added test fails without this change' is unchecked.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Keep the active group when an inactive group's last tab closes. · tabs-close-actions.ts:178-180
src/renderer/src/store/slices/tabs/tabs-close-actions.ts:178-180 Minor · Functional Correctness · Quick win
Keep the active group when an inactive group's last tab closes.
When the last tab of a group closes, the code replaces activeGroupIdByWorktree with the collapsed sibling group. It does this even when the closed group was not the active group. For example, in split(split(A, B), C) with focus in C, closing the last tab of B makes A the active group. The surface then switches to A.
Use the collapsed fallback only when the removed group was active. Otherwise keep the current active group, provided it still exists.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
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.
ELI5
An agent's page always shows its main chat (Home) as the first, pinned tab. Side chats can no longer be pinned ahead of it. Home also gets a small floating name pill that opens the agent's Activity.
What Changed
Scope: agents hosted on this computer only. Paired-server agents are unchanged here; remote support is the next follow-up.
pinTabrefuses them too). When duplicate Home views exist, the oldest ready view is kept (previews never win over ready views). The extra views close without ending the conversation, and if one of them was focused, focus moves to Home.src/shared/bots/bot-home-tab.ts) identifies Home by the agent's chat session, workspace and host, never by tab label or order. Placement, pin rules, close locks and the banner all use it. Placement waits forworkspaceSessionReady, so restore ordering can't race it.Why
Home is where the agent's memory, automations and requests land, so it should always be easy to find. One identity rule keeps placement, pinning and presentation consistent, so they can't disagree about which tab is Home. Remote hosts are left out because their tab restore and ownership need their own design.
Linked Issue
N/A (maintainer change; no pre-existing issue).
Visual Proof
Synthetic fixture data, dark theme.
Testing
Focused unit tests cover: Home identity and selection (ready before preview, then age, then id), placement and duplicate cleanup, Home chat reopen gating, focus after a split restore, the pane header banner (local vs paired), the side-chat pin rule, and mobile tab close. Locally: those 6 test files (23 tests),
pnpm typecheck:web,pnpm typecheck:nodeandpnpm lintpass. Platform: macOS only.Performance
Reasoned from the code; nothing was measured.
workspaceSessionReadyflips. Each run does a filter and sort over one workspace's tabs for each local agent, which is tiny. A reentrancy guard stops its own pin, unpin and close writes from triggering nested passes.findorsomeover that workspace's tabs.scroll-timeline), and hiding uses a container query. There's no scroll listener, resize observer or per-frame JS.pinTabguard does one tab lookup per pin, and pins are user-initiated.Risk
The riskiest part is that placement automatically closes duplicate Home views and unpins side chats in a local agent's workspace. If the identity rule were wrong, users would see a chat tab close or unpin on that page. It is guarded three ways: it only runs after session restore, a preview never replaces a ready Home, and closes use
preserveAgentSession. Placement is the only caller ofpreserveAgentSession, so other close paths behave as before. Paired, SSH and non-agent workspaces don't change. No saved data or settings format changes. Back out with a plain revert.Level: Low
Review
executionHostIdand the agent'shostId.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)