Skip to content

feat(tabs): Chrome-style tab groups in the pane tab strip - #24728

Draft
kiendle wants to merge 26 commits into
stablyai:mainfrom
kiendle:kiendle/grouped-tabs
Draft

kiendle wants to merge 26 commits into
stablyai:mainfrom
kiendle:kiendle/grouped-tabs

Conversation

@kiendle

@kiendle kiendle commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

You can now bundle tabs in a pane's tab strip into named, colored groups, like Chrome's tab groups. Highlight a few tabs, right-click, Add to New Group, type a name. Click the group's label to fold its tabs away or bring them back; drag the label to move the whole group.

What Changed

Before: a pane's tab strip was a flat row. The only way to organize it was reordering tabs or splitting panes.

After:

  • Highlight tabs. Cmd-click (Ctrl-click on Windows/Linux) toggles a highlight without switching tabs; Shift-click highlights a range; a plain click or Escape clears it.
  • Group them. Right-click → Add Tab to New Group / Add N Tabs to New Group, Add to Group ▸, Remove from Group. The tabs move next to each other and the name field opens immediately. Pinned tabs can't be grouped; grouping a preview editor tab makes it permanent first.
  • Group label (chip). Click (or Enter/Space) to collapse/expand; a collapsed label shows the member count. Right-click → Rename Group, nine colors, Ungroup (keeps the tabs open), Close Group (closes every member, including hidden ones). The name field also opens by itself right after you create a group.
  • Collapsing keeps your tab. Collapse a group while you're on one of its tabs and that tab stays next to the label even after you switch away. You can switch back to it or close it like any tab (closing it closes only that tab). Collapsing while you're outside the group hides all of its tabs. Expanding resets this.
  • One Close Group warning. If members are still running a command or agent, Close Group shows the existing "Stop running command?" dialog once for the whole group, with plural copy, the group name, and a collapsed Show N running terminals list. Cancel closes nothing; Stop and Close closes every member (unsaved files still ask to save).
  • Moving. Drop a tab inside a group or onto its label to join it; drag a member past the group's edge to leave. Drag the label to move the whole group within the strip, onto another pane's strip, or onto a pane edge to make a new split. The label's menu also has Move Group to New Split ▸ Right/Left/Down/Up.
  • Keyboard. Next/previous tab and Select Tab 1–9 count only tabs you can see; the Ctrl+Tab recent-tabs switcher still lists every tab.
  • Persistence. Groups (name, color, collapsed, kept tab) survive restarts, pane merges, editor file renames/moves, and reopen-closed-tab (it rejoins its group if the group still exists).

Mechanism. Each pane (TabGroup) gets an optional tabClusters list. Internally a group is a "tab cluster" because TabGroup already means a split pane in Orca; the UI says "Group". Each cluster is { id, name, color, collapsed, tabIds, shownTabId? }. The pane's flat tabOrder is unchanged and remains the source of truth, so mobile publication, remote clients, close-to-the-right and every existing tab operation keep working without knowing about groups.

A single repair rule keeps clusters consistent no matter which code path changed the tab order: membership follows position. Stale, pinned and duplicate members are dropped; a single unowned tab placed between two members joins; if a cluster's members end up split into several runs, the longest run keeps the cluster. The rule never reorders tabs. It runs in a store subscriber (tab-cluster-invariant.ts) and in hydration/serialization, so existing mutators (create, close, drop, move, pin, reconcile, hydration repair) did not each need group-aware rewrites. Operations whose intent the rule can't infer (create, drag with membership, moving a whole group, merging panes) write order and membership in one atomic store update, and a dropped or reopened tab that isn't joining a group is placed at that group's edge, never inside it.

Why

Agent-heavy workspaces accumulate many terminals, editors and browser tabs in one strip. Splits are the only grouping today and cost screen space. Named, collapsible groups are the familiar Chrome/Firefox model.

Alternatives considered:

  • Store the group id on each tab. Leaks into every tab builder and wire projection (web/mobile/headless), and a tab moved to another pane would carry a dangling id. Storing membership on the pane keeps the change local to the strip.
  • Nested tree (group contains tabs). Every consumer of the flat tabOrder (keyboard, mobile, close-to-right, remote mirror) would need to flatten it. Keeping the flat order plus a position-derived membership rule avoided touching them.
  • Patch every existing mutator to maintain groups. ~15 mutators plus future ones. One idempotent repair rule is harder to miss.

Linked Issue

Fixes #5194

Visual Proof

All media is from the packaged app driven headlessly (real clicks, drags and keys). Full-length MP4s are linked under each clip.

Before: a flat strip After: named, colored, collapsible groups
All operations: videos and screenshots

Highlight, group, name

highlight and group

MP4

Cmd-click highlight Shift-click range Menu Named group

Color and rename

color and rename

MP4

Group menu Move Group to New Split Inline rename Two groups

Collapse and the kept tab

collapse

MP4

Collapsed on a member Switched away, member kept Kept member closed Collapsed from outside

Moving: join, leave, reorder, split, move across panes

moving

MP4

Tab joins Member leaves Group to new split Group back to first pane

Ungroup and Close Group with running terminals

close

MP4

Ungroup keeps tabs Warning (collapsed) Warning (expanded) Closed

Edge cases: pinned tab, Add to Group, keyboard skipping, dark theme, unavailable split

edge cases

MP4

Pinned: grouping disabled Add to existing group Dark theme Split unavailable tooltip

Persistence across restart

persistence

MP4

Before restart After restart

Decisions

Decisions and the reason for each
Decision Why
Internal name "tab cluster", UI word "Group" TabGroup already means a split pane, in code and in the docs. Users get Chrome's word; code avoids the collision.
Membership on the pane, flat tabOrder untouched Mobile, remote clients, CLI and every existing tab operation read the flat order. Groups are presentation on top of it.
Membership follows position; repair never reorders Any code path that reorders tabs can't leave a group in an invalid state, and repair can't move a tab the user placed.
Collapse hides tabs visually only Hidden tabs stay in tabOrder, so mobile/remote clients still list them and close-to-the-right still includes them.
Collapse keeps the tab you were on (shownTabId) Requested behavior. Chosen only at the moment of collapsing; visiting another hidden member later (e.g. Ctrl+Tab) shows it only while active, and the kept tab doesn't change.
The active tab is never hidden Collapsing never switches tabs and never auto-expands.
Pinned tabs can't be grouped; pinning a member removes it Pinned tabs live in their own front section of the strip (Chrome does the same).
Default name '' + inline rename on create; color = first unused Chrome behavior; avoids a dialog.
Groups on server-hosted workspaces are kept by each client No protocol change. Another client (browser, desktop) won't see them; mobile shows a flat list.
Move Group to New Split disabled for server-hosted workspaces, greyed with a reason The browser/server protocol moves one tab at a time and the server picks the new pane's id, so a whole-group split could end half-moved. The greyed item stays focusable so the reason shows on hover and keyboard focus. Moving a group into an existing pane works everywhere. The floating panel now renders splits (#22302), so groups split there like in the main window.
Close Group: one warning, expandable list, all-or-nothing Cancel One dialog per terminal was tedious, and cancelling one still closed the rest. Reuses the existing dialog so it looks the same.
Next active tab after a close prefers visible tabs Closing a kept tab shouldn't pop another hidden member out. Shared by local close and remote snapshot reconciliation.
Selection (highlights) is transient, per pane, never persisted It's a gesture state, like a text selection.
Rename opens only for a group you just created Requested explicitly by the create action, never inferred, so moves, merges and id rekeys never steal focus.
The group menu uses the ContextMenu primitive Per STYLEGUIDE. The existing tab menus still use a DropdownMenu with a hidden trigger; left unchanged here. ContextMenuItem gained aria-disabled styling so focusable-but-unavailable items look disabled.
Whole-group moves reuse the single-tab drop transaction One move-members-to-pane path carries optional group metadata, instead of two copies of split/layout/MRU/empty-pane handling.

State analysis

State variables, one-group visibility matrix, transitions and coverage

State

Scope State Invariant
Group id, name, color, collapsed, tabIds, shownTabId? Members: unpinned, owned by the pane, contiguous in tabOrder, in tabOrder order, each in at most one group; no empty groups; shownTabId only on collapsed groups and only a current member. Name trimmed, ≤80 chars; invalid color → grey.
Pane tabOrder, activeTabId, recentTabIds, pinned/preview tabs tabOrder includes hidden members. The active tab is always visible.
Transient highlight selection + anchor, inline rename draft, auto-rename, chip menu, drag kind (tab vs group), pending close warning Selection is pruned to live tabs of the pane and never persisted.
Environment local / SSH / folder workspace; server-hosted (browser or paired desktop) workspace; floating panel; restart/hydration; older build reading newer data Server-hosted: no group-to-new-split. Older builds drop the field (groups lost, tabs kept).

Visibility of one group's members

A = active tab, S = shownTabId.

Collapsed S A Visible members
no — any all
yes unset outside none
yes unset member X {X}
yes set outside {S}
yes set S {S}
yes set other member X {S, X}

Impossible states (S on an expanded group, S not a member, empty group, non-contiguous members, pinned member) are removed by normalization and by the schema on load.

Transitions

Event Result
Create group from selection Selected unpinned tabs gathered at the first one's position (or, if that would split their old group, right after its remaining members, so untouched tabs keep their group); previews made permanent; they leave old groups; new group expanded, unnamed, first unused color, rename opens.
Add to / Remove from group Tabs moved to the group's end and joined / moved just past its end and removed.
Rename (Enter / blur / Escape / IME) Enter and blur commit (trimmed); Escape cancels; an IME composition-confirming Enter never commits.
Collapse / expand Collapse records S if A is a member; expand clears S.
Activate (click, next/prev, Select Tab N, Ctrl+Tab, reopen, new tab) Never changes collapsed state or S. Next/prev and Select Tab N skip hidden members.
Close a member Leaves the group; the last member closing removes the group; if it was S, S is cleared. Next active tab prefers visible tabs.
Close others / left / right Use tabOrder, so hidden members are included; pinned tabs survive.
Close Group Probe all member terminals once (4s cap). None busy → close all. Busy → one warning; Cancel closes nothing; confirm closes every member (unsaved files still prompt).
Ungroup Group removed; tabs stay in place.
Pin a member Leaves the group. Unpin doesn't rejoin.
Drag a tab Inside a group's span → joins; at its edge → keeps membership only if already a member; onto the label → appended; to another pane → same rules there, leaves the source group; to a pane edge → new split, ungrouped.
Drag a group label Whole group (incl. hidden) moves within the strip, to another pane's strip (never nested inside another group), or to a pane edge (new split; blocked where unavailable).
Merge pane into sibling Groups carried with their members; id collisions rekeyed.
Editor file rename / move / id migration Members and S rekeyed.
Reopen closed tab Rejoins its group if that group still exists in that pane.
Restart / hydration Groups normalized against the repaired tab order; corrupt group fields dropped without dropping the pane.
Remote snapshot rebuild (server-hosted workspace) The client's groups for that pane are kept; stale members cleaned by normalization. If the snapshot removes the active tab, the next active tab prefers visible tabs (same rule as local close).

Affected surfaces

Every part of Orca this touches
Surface Impact
Desktop tab strip (all tab types: terminal, editor, browser, agent session, simulator) New: highlighting, group label, member underline, menus, drag targets.
Split panes (drag, Move Tab to Split, merge) Groups move/merge with panes; new whole-group split.
Floating terminal panel Same as the main window on main's shared workspace surface (#22302): groups, whole-group split, Close Group warning; Select Tab N and next/prev skip hidden members.
Keyboard: next/prev tab, Select Tab 1–9, Ctrl+Tab Skip hidden members (first two); Ctrl+Tab lists all.
Running-terminal close warning Group variant of the existing dialog; single-tab dialog unchanged except it no longer flips its text while fading out.
Recently closed (Cmd+Shift+T) Reopened tab rejoins its group.
Editor file rename/move Group membership follows the file.
Session persistence (zod schema, SQLite profile domains) New optional tabClusters on panes; field-level fallback. Older builds ignore it.
Browser client and desktop paired with a Remote Orca Server Groups are client-local; whole-group split disabled with a tooltip; no wire/protocol change.
Headless server (orca serve) Keeps persisted tabClusters when it rewrites a pane (orca-runtime-move-headless-mobile-session-tab.ts).
Mobile Unchanged: flat tab list.
CLI (orca terminal list, browser tab commands) Unchanged: their projections don't include groups.
SSH and folder workspaces Same as local; groups are renderer state.
Design tokens Nine --tab-cluster-* colors (light/dark) and a highlight surface in main.css.
i18n New English strings; other languages fall back to English.
Docs docs/site/content/docs/model/tabs-panes-splits.mdx "Grouping tabs".

Testing

  • Unit: group model and normalization (idempotence, sandwich join, longest run, sticky), every store action, persistence round-trip including corrupt data, drag/drop decisions (incl. same-id groups in two panes), keyboard skipping incl. kept tab and mixed tab types, close scopes across collapsed groups, Close Group guard (busy/idle/timeout/skip setting/cancel), dialog disclosure, editor rekeys, reopen-closed, remote snapshot rebuild and successor, floating Close Group history.

  • End-to-end (tests/e2e/tab-clusters.spec.ts, 8 tests): highlight → group → rename → collapse/expand → Escape-cancelled rename; ungroup and Close Group; one warning for two running terminals with expandable list, Cancel and confirm; kept tab after collapse, switching back, closing it; next/prev and Select Tab N across a collapsed group; Ctrl+Tab switcher into a hidden member; restart persistence; move to new split and merge back.

  • Existing e2e: tabs, rename, drag, close navigation, browser tab, floating rename, running-close confirms, split identity/layout, paired split placement, editor selection (68 passed together with the group tests).

  • Failing on origin/main too, unrelated: tab-strip-active-dock.spec.ts on a 5K display (40 tabs never overflow the strip twice) and terminal-tab-close-restart-persistence.spec.ts (orphaned PTYs after restart; failed 3/3 on a clean origin/main checkout).

  • pnpm typecheck, oxlint, changed-code quality, React Doctor, selector fan-out, dead classes, max-lines/ts-nocheck/electron ratchets, localization extraction/catalogs/coverage: pass. audit:code-quality:native reports 5 pre-existing mobile/ import cycles, unchanged by this branch.

  • Full pnpm test: all failures are outside this change: config/scripts/mobile-web-app-* (Playwright browsers not installed locally), browser-manager-tab-identity, skill-recipe-shell, palette performance budget (timing; passes on rerun).

  • Manually exercised the packaged macOS arm64 build through the browser client.

  • Platforms: macOS only.

  • I manually tested these changes locally

  • Automated tests added/updated

AI Disclosure

Implemented with Claude (orchestrating sub-agents) under human direction. Reviewed by an independent state-completeness audit, Codex (gpt-6-astra, xhigh), a Grok review, and two rounds of Codex gpt-6-astra at max effort; every finding was fixed or is listed under Notes with its reason.

Review

AI review summary (Claude orchestration, independent state audit, Codex gpt-6-astra at xhigh and max effort, Grok; all findings fixed or listed under Notes):

  • Cross-platform: highlight uses Cmd-click on macOS and Ctrl-click elsewhere via a runtime platform check; keyboard paths reuse the existing per-platform bindings (Select Tab 1–9 is Ctrl+digit on macOS, Alt+digit elsewhere); no file paths, processes or OS APIs added. Tested on macOS only.
  • SSH / remote / local: groups are renderer state, so local, SSH and folder workspaces behave the same. Remote Orca Server workspaces (browser client or paired desktop) keep groups per client with no wire or RPC change; whole-group split is disabled there with an explanation, because the one-tab-at-a-time protocol can't target a pane the server creates. The headless server preserves persisted groups when it rewrites a pane.
  • Agents and integrations: agent terminals are ordinary member tabs; the group close warning uses the existing agent-status store to word "Stop these agents?" and the existing running-process check (4s cap; no answer counts as running). No provider- or git-provider-specific code.
  • Performance: the membership repair runs in a store subscriber that exits immediately when no pane has groups and otherwise only re-normalizes panes whose order, groups or pin state changed; selector fan-out check passes; Close Group probes all member terminals in one parallel call.
  • UI quality: STYLEGUIDE tokens (nine --tab-cluster-* colors, light/dark) and shadcn primitives (ContextMenu, Collapsible, Tooltip); design-system lints pass; verified in light and dark.
  • Security: no new IPC, network or file access; group names render as React text (escaped) and are trimmed and capped at 80 characters; persisted data is validated by zod with field-level fallback.
Review findings and fixes
  • Correctness: Close Group confirmations keyed by worktree + pane + group; creating a group never ungroups untouched members; moving the active tab to another pane (or closing it) never reveals a hidden member while a visible tab remains; a pinned tab dropped into a group's middle, or a reopened tab whose group is gone, lands outside other groups instead of splitting or joining them; the New Group menu counts only tabs it will group; keyboard focus returns to the group label when its menu closes.
  • Simplification (Grok): one-call modules folded into the files they serve; the group label's click/keyboard handling is one small hook; rename-after-create goes through a store field instead of a window event; Close Group finds terminals through one lookup; drag and cross-layer tests that re-asserted store outcomes were removed. Double-click-to-rename was dropped (Chrome model) because expanding a collapsed group moved the second click onto a tab.
  • Earlier: shared move transaction for whole groups; ContextMenu primitive for the group menu; IME-safe rename; pane-qualified drag ids; floating-panel Close Group records closed terminals for reopen.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Caveats

  • Server-hosted workspaces: whole-group split is disabled (tooltip explains); groups are per client and not shared; mobile shows a flat list. Lifting the split limit needs a capability-negotiated protocol addition.
  • Unreachable hosts in the Close Group warning: a terminal whose check doesn't answer within 4s counts as running. A check that answers immediately with an error (e.g. host disconnected) counts as idle. This is the existing single-tab policy, unchanged.
  • Close Group isn't one transaction with unsaved files: after you confirm the running-terminal warning, terminals and clean tabs close before an unsaved file's save prompt; cancelling that prompt keeps only that file.
  • Close Group closes the members captured when you chose it. A tab another client adds to the group while the warning is open isn't closed.
  • Moving a group into an existing pane of a server-hosted workspace is sent as one move per member; ordering under concurrent remote changes isn't covered by tests.
  • Older Orca builds reading a newer profile drop groups (tabs kept).
  • Collapsed groups don't show agent-attention badges of hidden tabs (Chrome doesn't either).
  • Translations: English only, per config/i18n-translation-source.md (feature PRs change English; target locales fall back to English until the translation pass).
  • The label for an unnamed group falls back to "Unnamed group" in menus and the dialog.
  • Only one tab between two members of the same group joins it automatically. Every UI path inserts one tab at a time (new tab after the active one, reopen) or sets membership explicitly (drag, create, move), so wider gaps don't arise from user actions. If something ever inserts two or more tabs into a group's middle at once, the group keeps its longest part and the tabs stay open. This is intentional, not a bug to "fix" by absorbing wider gaps.

Cross-platform / SSH / mobile / compatibility: shortcuts use the existing platform bindings (Cmd vs Ctrl highlight; Select Tab N is Ctrl+digit on macOS, Alt+digit elsewhere); no paths or processes added; SSH and folder workspaces behave like local; no wire or RPC change; persistence change is an optional field with field-level fallback.

Future development: Orca CLI for tab groups

Not in this PR. A follow-up could let agents organize tabs through the orca CLI, like they already drive terminals (orca terminal …) and browser tabs (orca tab …): orca tab-group list|create|add|remove|rename|color|collapse|expand|move|ungroup|close … [--json]. It would add runtime RPC methods that call the store actions this PR adds (createTabCluster, addTabsToCluster, setTabClusterCollapsed, moveTabCluster, …), return stable tab ids in --json output, keep the running-terminal warning on close (refuse or require --force), and document the commands in the bundled orca-cli skill. Groups that every client sees on server-hosted workspaces would need host-owned group state, a capability-negotiated protocol addition (docs/reference/remote-wire-compatibility.md).

Checklist

  • This PR is small and focused — it's one feature, but large (~3.9k production lines added / ~0.9k removed, ~7.4k test lines). Splitting it would leave each piece without the membership repair that keeps groups valid.
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • 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) — see Testing for the unrelated local failures.

kiendle added 12 commits October 2, 2026 06:51
Highlight tabs (Cmd/Ctrl-click, Shift-click), group them into named, colored,
collapsible groups, rename/recolor/ungroup/close groups, and drag a whole group
within a strip, across panes or into a new split. Groups survive restarts,
pane merges, editor renames, reopen-closed and paired-web mirror rebuilds;
keyboard tab cycling skips tabs hidden in collapsed groups.
… ids, close parity, IME rename, keyboard coverage
…, explicit rename, shared move transaction, ContextMenu, dead code removed
@kiendle
kiendle marked this pull request as ready for review October 2, 2026 11:57
@kiendle
kiendle requested a review from brennanb2025 as a code owner October 2, 2026 11:57
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change adds named, colored tab clusters that can be collapsed, expanded, moved, and closed. The tab strip supports multi-tab selection, cluster menus, drag-and-drop, and cluster-aware navigation and shortcuts. Cluster membership is normalized and carried through session persistence, hydration, pane moves, editor rekeying, and recently closed tab restoration. Closing a cluster checks running terminal processes and can show one confirmation listing affected terminals. The documentation and tests cover these behaviors, including split restrictions in remote workspaces and the floating terminal panel.

Priority: ⬇️ Low

Merge Risk

Merge Risk: 🔵 Low · up to 51d17

Tab groups are broadly in good shape. A press on a group chip while renaming it may start a drag and commit a partial name. Moving a tab to a specific position inside another pane's group may unintentionally add it to that group. Both are small, bounded follow-ups.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 51d17

Grouping changes saved workspace state and allows one action to close multiple terminals, including hidden members. The inspected paths retain worktree-scoped targeting and running-command confirmation. No introduced security vulnerability was established, but delayed identity changes and partial-close recovery remain incompletely verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The demonstrated destructive scope is a snapshot of cluster members routed through existing tab-close operations. Explicit main-pane targets are resolved only inside the captured worktree, and the new coordinated pane-move implementation rejects cross-worktree transfers.

Trust Boundaries and Controls

  • observed — Grouped confirmation unions and deduplicates PTYs from both liveness and layout records. Live or timed-out probes request confirmation; cancellation does not invoke closure. Explicit opt-out and exception fallback behavior remain, with the fallback predating this PR.
  • observed — User-supplied cluster names enter the inspected chip label and tooltip as React text, not interpreted HTML. Creation and rename actions trim names and limit them to 80 characters.

Resilience and Maintainability Implications

  • observed — Confirmation subjects include worktree, pane, and cluster identity. The existing queue advances before executing callbacks and guards rapid actions between prompts, containing re-entry and accidental confirmation of a subsequent request.

Hardening Proposals

  • proposed — Consider explicitly binding grouped confirmation to stable terminal identities and defining handling for stale or moved members and partial-close failures. Preserve the intended snapshot semantics rather than automatically extending an accepted confirmation to newly added members.
🚥 Pre-merge checks | ✅ 4 | ❓ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ❓ Inconclusive Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 132 functions across 95 files. (15 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #5194 requests named, collapsible, renamable, color-coded groups across tab types and supported platforms. The PR adds pane-level group state, colored chips, rename and collapse controls, and sh…
Out of Scope Changes check ✅ Passed The changes support #5194. Persistence, drag and pane movement, keyboard navigation, close confirmation, editor-tab rekeying, localization, documentation, and tests implement or validate tab groups. S…
Title check ✅ Passed The title clearly and concisely identifies the main change: Chrome-style tab groups in pane tab strips.
Description check ✅ Passed The description covers the required sections, explains the change and rationale, links issue #5194, includes visual proof and testing details, and records platform limits and known failures.
Full details: Docstring Coverage

Explanation

Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 132 functions across 95 files. (15 skipped: 3 unsupported, 12 over the file limit.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e61baeb6-e573-4a0b-900a-9babfaf4a2e9

📥 Commits

Reviewing files that changed from the base of the PR and between 4e46969 and 6cd62f5.

📒 Files selected for processing (129)
  • docs/site/content/docs/model/tabs-panes-splits.mdx
  • src/main/runtime/orca-runtime-move-headless-mobile-session-tab.ts
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx
  • src/renderer/src/components/floating-terminal/FloatingWorkspaceTabDragContext.tsx
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.ts
  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.ts
  • src/renderer/src/components/tab-bar/BrowserTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.test.tsx
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabLeadingIcon.tsx
  • src/renderer/src/components/tab-bar/SortableTab.rename-shortcut.test.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx
  • src/renderer/src/components/tab-bar/TabBar.context-menu.test.ts
  • src/renderer/src/components/tab-bar/TabBar.tsx
  • src/renderer/src/components/tab-bar/TabClusterChip.test.tsx
  • src/renderer/src/components/tab-bar/TabClusterChip.tsx
  • src/renderer/src/components/tab-bar/TabClusterContextMenu.split-blocked.test.tsx
  • src/renderer/src/components/tab-bar/TabClusterContextMenu.tsx
  • src/renderer/src/components/tab-bar/TabClusterMemberIndicator.tsx
  • src/renderer/src/components/tab-bar/TabClusterMenuSection.test.tsx
  • src/renderer/src/components/tab-bar/TabClusterMenuSection.tsx
  • src/renderer/src/components/tab-bar/tab-bar-cluster-items.test.ts
  • src/renderer/src/components/tab-bar/tab-bar-cluster-items.ts
  • src/renderer/src/components/tab-bar/tab-bar-item-model.ts
  • src/renderer/src/components/tab-bar/tab-bar-item-surface.tsx
  • src/renderer/src/components/tab-bar/tab-bar-props.ts
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • src/renderer/src/components/tab-bar/tab-bar-windows-shell-launch-test-harness.ts
  • src/renderer/src/components/tab-bar/tab-cluster-colors.ts
  • src/renderer/src/components/tab-bar/tab-cluster-menu-rename-focus.test.tsx
  • src/renderer/src/components/tab-bar/tab-cluster-menu-targets.ts
  • src/renderer/src/components/tab-bar/tab-cluster-rename-request.ts
  • src/renderer/src/components/tab-bar/tab-context-menu-consistency.test.tsx
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.test.tsx
  • src/renderer/src/components/tab-bar/tab-strip-pointer-activation.ts
  • src/renderer/src/components/tab-bar/tab-strip-selection.test.ts
  • src/renderer/src/components/tab-bar/tab-strip-selection.ts
  • src/renderer/src/components/tab-bar/use-sortable-tab-rename.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-cluster-interactions.test.tsx
  • src/renderer/src/components/tab-bar/use-tab-bar-cluster-interactions.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-item-projection.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-runtime-model-worktree-write-probe.ts
  • src/renderer/src/components/tab-bar/use-tab-cluster-menu-close-action.ts
  • src/renderer/src/components/tab-bar/use-tab-strip-rename.ts
  • src/renderer/src/components/tab-group/TabDragPreview.tsx
  • src/renderer/src/components/tab-group/TabGroupPanel.tsx
  • src/renderer/src/components/tab-group/TabGroupSplitLayout.tsx
  • src/renderer/src/components/tab-group/tab-cluster-drag-geometry.test.ts
  • src/renderer/src/components/tab-group/tab-cluster-drop-target.test.ts
  • src/renderer/src/components/tab-group/tab-cluster-drop-target.ts
  • src/renderer/src/components/tab-group/tab-cluster-split-availability.test.ts
  • src/renderer/src/components/tab-group/tab-cluster-split-availability.ts
  • src/renderer/src/components/tab-group/tab-drag-data.ts
  • src/renderer/src/components/tab-group/tab-drag-drop-commit.test.ts
  • src/renderer/src/components/tab-group/tab-drag-drop-commit.ts
  • src/renderer/src/components/tab-group/tab-drag-hover-preview.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.test.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-activation.ts
  • src/renderer/src/components/tab-group/tab-drag-preview-target.ts
  • src/renderer/src/components/tab-group/tab-group-panel-split-target.ts
  • src/renderer/src/components/tab-group/tab-insertion.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.test.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.test.tsx
  • src/renderer/src/components/tab-group/useTabGroupWorkspaceModel.ts
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.test.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalGroupList.tsx
  • src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.test.tsx
  • src/renderer/src/components/terminal-pane/RunningTerminalCloseDialog.tsx
  • src/renderer/src/components/terminal/running-terminal-close-guard.ts
  • src/renderer/src/components/terminal/running-terminal-group-close-guard.test.ts
  • src/renderer/src/components/ui/context-menu.tsx
  • src/renderer/src/hooks/ipc-tab-switch-clusters.test.ts
  • src/renderer/src/hooks/ipc-tab-switch.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/tab-number-shortcuts.test.ts
  • src/renderer/src/lib/tab-number-shortcuts.ts
  • src/renderer/src/lib/workspace-session-unified-tabs.ts
  • src/renderer/src/runtime/web-session-client-owned-tab-placement.test.ts
  • src/renderer/src/runtime/web-session-client-owned-tab-placement.ts
  • src/renderer/src/runtime/web-session-tab-clusters.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync-client-owned-placement.test.ts
  • src/renderer/src/runtime/web-session-terminal-recovery-snapshot-validation.test.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/running-terminal-close-confirm.ts
  • src/renderer/src/store/slices/editor-tab-cluster-rekey.test.ts
  • src/renderer/src/store/slices/editor/actions/restored-editor-owner-transition.ts
  • src/renderer/src/store/slices/editor/actions/restored-editor-tab-clusters.ts
  • src/renderer/src/store/slices/editor/file-ids/hydrated-editor-file-ids.ts
  • src/renderer/src/store/slices/editor/file-ids/open-file-path-rekey.ts
  • src/renderer/src/store/slices/recently-closed-tab-clusters.test.ts
  • src/renderer/src/store/slices/recently-closed-tab-position.ts
  • src/renderer/src/store/slices/recently-closed-tabs.test.ts
  • src/renderer/src/store/slices/restored-editor-tab-clusters.test.ts
  • src/renderer/src/store/slices/store-test-helpers.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/store/slices/tabs-legacy-hydration.ts
  • src/renderer/src/store/slices/tabs/create-tabs-slice.ts
  • src/renderer/src/store/slices/tabs/tab-close-successor.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-invariant.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-model.test.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-model.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-persistence.test.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-transfer.ts
  • src/renderer/src/store/slices/tabs/tabs-close-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-collapse-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-move-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-move-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-strip-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-transfer-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-create-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-drop-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-move-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-secondary-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-slice-contract.ts
  • src/shared/tab-types.ts
  • src/shared/workspace-session-schema.test.ts
  • src/shared/workspace-session-schema.ts
  • src/shared/workspace-session-tab-cluster-schema.ts
  • tests/e2e/tab-clusters.spec.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/tab-bar/tab-context-menu-consistency.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…opy, restore menu consistency test, keep unrelated runtime catalog keys
@kiendle

kiendle commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai Addressed the pre-merge checks in a699a85:

  • Out of Scope Changes: tab-context-menu-consistency.test.tsx is restored unchanged from main (it passes with this branch), and en-runtime-required.json now differs from main only by this feature's keys — components.native-chat.subagents.unnamed is back.
  • Docstring Coverage: intentionally not addressed. This repo's AGENTS.md asks for concise WHY-only comments and no comments that restate the code, so adding docstrings to reach an 80% threshold would conflict with the project's guidelines.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Use neutral copy for mixed terminal groups. · CloseTerminalDialog.tsx:134-152

src/renderer/src/components/terminal-pane/CloseTerminalDialog.tsx:134-152
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use neutral copy for mixed terminal groups.

When a grouped close contains both command and agent terminals, the aggregate isAgent value remains true. The dialog labels the entire action as “Stop these agents?”, shows the agent resume warning, and uses “Stop Agent”. The expanded list does not correct this copy.

Use neutral group copy for mixed copyKind values. Show the agent warning and confirmation only when every grouped terminal is an agent.

Suggested fix
+  const hasMixedCopyKinds = terminals
+    ? terminals.some((terminal) => terminal.copyKind === 'agent') &&
+      terminals.some((terminal) => terminal.copyKind !== 'agent')
+    : false
+
...
-          {isAgent
+          {hasMixedCopyKinds
+            ? translate(
+                'auto.components.terminal.pane.CloseTerminalDialog.stop_mixed_group_title',
+                'Stop these running terminals?'
+              )
+            : isAgent
...
-      {isAgent ? (
+      {isAgent && !hasMixedCopyKinds ? (
...
-          {isAgent
+          {isAgent && !hasMixedCopyKinds

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 5b125c7f-3df0-4c5d-95c5-cd2d04da666e

📥 Commits

Reviewing files that changed from the base of the PR and between 6cd62f5 and a699a85.

📒 Files selected for processing (6)
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.test.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalGroupList.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/components/terminal-pane/CloseTerminalGroupList.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/components/tab-bar/tab-bar-surface.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.test.tsx
  • src/renderer/src/components/terminal-pane/CloseTerminalDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
fd -H '^AGENTS\.md$|^tab-context-menu-consistency\.test\.tsx$|^en-runtime-required\.json$' . --exclude .git
if [ -f AGENTS.md ]; then cat AGENTS.md; fi
base=""
if git rev-parse --verify origin/main >/dev/null 2>&1; then
  base="origin/main"
elif git rev-parse --verify main >/dev/null 2>&1; then
  base="main"
fi
while IFS= read -r file; do
  printf '\n--- %s ---\n' "$file"
  ast-grep outline "$file" --items all || true
  sed -n '1,65p' "$file"
  if [ -n "$base" ]; then git diff "$base" HEAD -- "$file"; else echo "Main reference unavailable"; fi
done < <(fd '^tab-context-menu-consistency\.test\.tsx$' .)
printf '\n--- Runtime locale diff ---\n'
if [ -n "$base" ]; then
  git diff "$base" HEAD -- src/renderer/src/i18n/en-runtime-required.json
else
  echo "Main reference unavailable"
fi
python - <<'PY'
import json
from pathlib import Path
p = Path("src/renderer/src/i18n/en-runtime-required.json")
data = json.loads(p.read_text())
key = "components.native-chat.subagents.unnamed"
def walk(obj, prefix=""):
    if isinstance(obj, dict):
        for k, v in obj.items():
            path = f"{prefix}.{k}" if prefix else k
            if path == key:
                print(f"{key}: {v!r}")
            walk(v, path)
walk(data)
PY

Length of output: 20375


@kiendle Thanks for the cleanup and the guidance.

  • Out-of-scope changes: Verified that tab-context-menu-consistency.test.tsx matches main. The en-runtime-required.json diff contains only tab-group feature keys, and components.native-chat.subagents.unnamed is restored to "Subagent". I did not rerun tests.
  • Docstring coverage: AGENTS.md requires concise, non-obvious comments that explain WHY, not HOW. I withdraw the request to add docstrings solely to reach 80% coverage. No such additions are needed for this PR.

✏️ Learnings added
Learnt from: kiendle
URL: https://github.com/stablyai/orca/pull/24728

Timestamp: 2026-10-02T12:31:14.622Z
Learning: In stablyai/orca, AGENTS.md requires concise, non-obvious comments that explain WHY rather than HOW, preferably in one line. Do not request docstrings that restate code solely to meet a docstring-coverage threshold.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

You are interacting with an AI system.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the full Chrome-style tab-group feature at a699a856. The core mechanisms hold up: the position-derived membership rule and its store subscriber, the atomic cluster mutators, Close Group's single all-or-nothing prompt, the highlight/chip/drag/keyboard surfaces, and the persistence/hydration/rekey round-trip.

  • Model & invariant — normalizeTabClusters is idempotent and enforces the documented invariants (unpinned members, contiguous longest-run, single ownership, no empty clusters, shownTabId only on collapsed member sets); the subscriber's change detection does not skip an affected pane.
  • Cluster mutators — every order-changing operation (buildTabClusterStripMove, moveTabsToPane, moveTabCluster, mergeGroupIntoSibling, recreate-via-anchor) writes tabOrder and tabClusters in one update and normalizes before returning; cross-pane and same-id-in-two-panes cases rekey correctly.
  • Close Group — hidden members are included, probes use the terminal entityId while closes use unified ids, one prompt covers the group, Cancel closes nothing, and every production host suppresses the per-tab re-prompt.
  • Collapse semantics — shownTabId is only set for a collapsed member, cleared on expand, pruned when the member leaves, and the active tab is never hidden.
  • Persistence — tabClusters including shownTabId survives restart, pane merge, editor rekey/move, reopen, and the headless rewrite; the renderer normalizes on both the read and the write boundary.
  • Keyboard — next/prev, Select Tab N, and terminal cycling skip hidden members; Ctrl+Tab still lists all.

ℹ️ Structured agent-session members are outside the Close Group running-work prompt

The documentation added here says the group warning covers "a command or agent", but closeCluster only collects members whose unified tab is contentType === 'terminal'. A structured agent-session member is closed with no running-work prompt.

Technical details
# Close Group running-work prompt skips structured agent sessions

## Affected sites
- `src/renderer/src/components/tab-bar/use-tab-bar-cluster-interactions.ts` — `closeCluster`'s `terminals` collection filters to `contentType === 'terminal'` / legacy item `type === 'terminal'`.
- `src/renderer/src/components/terminal/running-terminal-close-guard.ts` — `guardRunningTerminalGroupClose` only receives those terminals.
- `docs/site/content/docs/model/tabs-panes-splits.mdx` — the added sentence says the warning covers "a command or agent".

## Required outcome
- Confirm the exclusion is intentional, or make the doc wording match the behavior.

## Open questions for the human
- Is a structured `agent-session` tab expected to raise the "Stop these agents?" prompt on Close Group? It has no PTY to probe, and the existing single-tab close of an `agent-session` never used the running-process guard, so this is most likely the intended policy — flagging only so the doc sentence and behavior can be reconciled.

ℹ️ Headless pane rewrite persists cluster membership verbatim

persistHeadlessTabGroups copies each pane's tabClusters by pane id without stripping members that the same write moved to another pane, so the persisted record can reference a tab owned elsewhere until hydration normalizes it. This self-heals; calling it out so the host-preserves / client-normalizes split is explicit.

Technical details
# Headless cluster records copied without member filtering

## Affected sites
- `src/main/runtime/orca-runtime-move-headless-mobile-session-tab.ts` — `persistHeadlessTabGroups` re-emits `previousGroupsById.get(group.id)?.tabClusters` unchanged, keyed by pane id.
- `src/main/runtime/headless-tab-group-split-layout.ts` — the move/split builders update `tabOrder` only.
- `src/renderer/src/store/slices/tabs-hydration.ts` — `normalizeTabGroupClusters` repairs the stale member on the next read.

## Required outcome
- Keep the current division (host preserves, client normalizes) and add a test that a headless move of a cluster member converges after hydration, so the reliance on normalization is pinned.

## Open questions for the human
- Should the host strip moved members itself, or is renderer normalization the intended single repair point? No headless test currently exercises a pane that has `tabClusters` when a member moves.

ℹ️ Nitpicks

  • src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.ts calls guardRunningTerminalGroupClose with the unified tab id directly, bypassing closeCluster; it would not catch a regression in the unified-id → terminal-entityId mapping that closeCluster performs.
  • No test covers a headless mobile tab move (or split) on a pane that has cluster members.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

# Conflicts:
#	src/renderer/src/components/tab-bar/tab-bar-item-surface.tsx
#	src/renderer/src/components/tab-bar/use-tab-bar-item-projection.ts
#	src/renderer/src/components/tab-group/useTabDragSplit.test.ts
@kiendle

kiendle commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (including #24261) and resolved the conflicts in 81c4ea2. Tab groups now go through the new row:

  • The tab click that highlights tabs (selectTab) is part of TabBarItemActions, so every row gets the same stable actions object.
  • The highlighted state and group colour are passed to TabBarItemRow as plain value props (isHighlighted, clusterColor), so the memo comparator still covers them.
  • The strip's sortable ids keep perf(tab-bar): a change to one tab no longer re-renders every tab #24261's stable-identity guard and now include collapsed group chips.

I added a case to TabBarItemRow.test.tsx. Highlighting one tab re-renders only that tab, and a tab that skipped its render still calls the current selection handler. Typecheck, the changed-code gate, the tab-bar/tab-group/store unit tests (9237 passed), and the tab and tab-group e2e specs (17 passed) are all green locally.

@kiendle

kiendle commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-reviewed PR #24728 at 81c4ea25, scoped to the delta since the prior pullfrog review at a699a85: a merge of origin/main (18b99ac7) whose conflict resolution adapted the tab-cluster feature onto main's newly memoized tab-row structure.

  • Merged main's refactored tab row — tab-bar-item-surface.tsx now routes every tab kind through the memoized TabBarItemRow and forwards the cluster clusterColor, the highlight isHighlighted, and the canonical allItems index used for close-scope neighbors; tab-bar-surface.tsx interleaves cluster chips with the visible rows.
  • Added selectTab to the stable actions object — use-tab-bar-item-actions.ts gained selectTab, wired from clusterInteractions.selectTab in TabBar.tsx, so the highlight gesture still runs through the strip's single activation fan-out without changing the actions identity.
  • Rebuilt the strip projection on main's identity-stable sortableIds — use-tab-bar-item-projection.ts produces stripItems / visibleItems / clusterByUnifiedTabId and keys sortableIds to stripIds; tabStripLayoutKey folds in each cluster's name, color, collapsed flag, and member count.
  • Extended tests — sensor-stability coverage plus a chip-drag-over-strip/edge case in useTabDragSplit.test.ts, and a TabBarItemRow test asserting a highlight re-renders only the affected row and selects through the current handler.

The resolved TabBarItemRow comparator includes clusterColor and isHighlighted, so cluster/highlight writes are not swallowed by the memo, and the full tab-bar + tab-group suites pass (809 tests).

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

# Conflicts:
#	src/renderer/src/store/slices/tabs/tabs-close-actions.ts

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-reviewed PR #24728 at 2f31d76, scoped to the delta since the prior pullfrog review at 81c4ea25: a merge of origin/main (752871b) whose only conflict resolution touching branch logic is in tabs-close-actions.ts.

  • Adopted main's structured-agent-session ownership resolution — closeUnifiedTab now resolves the owning runtime via structuredAgentSessionTargetForTab(state, tab) and clears focus intent through structuredAgentSessionFocusOwner(target), replacing the removed LOCAL_STRUCTURED_SESSION_OWNER / getActiveRuntimeTarget(...) path; retirement starts only when a runtime target resolves, else it warns and closes the tab locally. This matches origin/main exactly.
  • Retained the cluster-aware close successor — pickTabCloseSuccessor (hidden-member-aware next-active selection) is untouched by the merge, so collapsing groups still steer the successor away from hidden members.

No cluster production or test file changed in this delta, so the previously reviewed feature surface is unaffected.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

…ingle chip gesture, store rename request, dedupe tests
…name via menu only, count only groupable tabs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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 indexed moves outside unrelated destination clusters. · tabs-move-actions.ts:43-47

src/renderer/src/store/slices/tabs/tabs-move-actions.ts:43-47
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep indexed moves outside unrelated destination clusters.

When opts.index falls inside a destination cluster, moveUnifiedTabToGroup inserts the tab there. The store invariant then adds the tab to that cluster instead of preserving it as a nonmember. Use the cluster-aware insertion helper and normalize the destination:

Suggested fix
-import { applyTransferredTabClusterMembership } from './tab-cluster-model'
+import {
+  applyTransferredTabClusterMembership,
+  getTabClusterInsertionIndex
+} from './tab-cluster-model'
...
-        const targetIndex = Math.max(
-          0,
-          Math.min(opts?.index ?? targetOrder.length, targetOrder.length)
+        const targetIndex = getTabClusterInsertionIndex(
+          targetOrder,
+          targetGroup.tabClusters,
+          opts?.index ?? targetOrder.length
         )
...
-            return {
-              ...group,
-              activeTabId: opts?.activate ? tabId : group.activeTabId,
-              tabOrder: targetOrder,
-              recentTabIds: opts?.activate
-                ? pushRecentTabId(sanitizedTargetRecent, tabId)
-                : sanitizedTargetRecent
-            }
+            return applyTransferredTabClusterMembership(
+              {
+                ...group,
+                activeTabId: opts?.activate ? tabId : group.activeTabId,
+                tabOrder: targetOrder,
+                recentTabIds: opts?.activate
+                  ? pushRecentTabId(sanitizedTargetRecent, tabId)
+                  : sanitizedTargetRecent
+              },
+              [tabId],
+              null,
+              pinnedTabIds
+            )

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9b317a6e-b1de-4b6f-9e37-2275e76a7fb7
📥 Commits

Reviewing files that changed from the base of the PR and between 2f31d76 and 51d17b3.

📒 Files selected for processing (67)
  • docs/site/content/docs/model/tabs-panes-splits.mdx
  • src/renderer/src/components/floating-terminal/FloatingTerminalPanel.shortcuts.test.tsx
  • src/renderer/src/components/floating-terminal/use-floating-terminal-panel-items.ts
  • src/renderer/src/components/tab-bar/EditorFileTab.tsx
  • src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx
  • src/renderer/src/components/tab-bar/SortableTab.tsx
  • src/renderer/src/components/tab-bar/TabClusterChip.test.tsx
  • src/renderer/src/components/tab-bar/TabClusterChip.tsx
  • src/renderer/src/components/tab-bar/TabClusterContextMenu.tsx
  • src/renderer/src/components/tab-bar/TabClusterMenuSection.test.tsx
  • src/renderer/src/components/tab-bar/TabClusterMenuSection.tsx
  • src/renderer/src/components/tab-bar/TabDragPreview.tsx
  • src/renderer/src/components/tab-bar/tab-bar-cluster-items.ts
  • src/renderer/src/components/tab-bar/tab-cluster-chip-gesture.test.tsx
  • src/renderer/src/components/tab-bar/tab-cluster-chip-gesture.ts
  • src/renderer/src/components/tab-bar/tab-strip-selection.ts
  • src/renderer/src/components/tab-bar/use-tab-bar-cluster-interactions.ts
  • src/renderer/src/components/tab-bar/use-tab-cluster-menu-close-action.ts
  • src/renderer/src/components/tab-group/tab-cluster-drag-geometry.test.ts
  • src/renderer/src/components/tab-group/tab-cluster-drop-target.test.ts
  • src/renderer/src/components/tab-group/tab-drag-drop-commit.test.ts
  • src/renderer/src/components/tab-group/tab-insertion.ts
  • src/renderer/src/components/tab-group/useTabGroupCloseScopeCommands.test.tsx
  • src/renderer/src/components/ui/context-menu.tsx
  • src/renderer/src/hooks/ipc-tab-switch-clusters.test.ts
  • src/renderer/src/hooks/ipc-tab-switch.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/floating-workspace-terminal-actions.test.ts
  • src/renderer/src/lib/floating-workspace-terminal-actions.ts
  • src/renderer/src/lib/tab-number-shortcuts.test.ts
  • src/renderer/src/lib/tab-number-shortcuts.ts
  • src/renderer/src/runtime/web-session-client-owned-tab-placement.ts
  • src/renderer/src/runtime/web-session-tab-clusters.test.ts
  • src/renderer/src/runtime/web-session-tabs-sync/apply-preparation-groups.ts
  • src/renderer/src/runtime/web-session-tabs-sync/layout-groups.ts
  • src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts
  • src/renderer/src/store/index.ts
  • src/renderer/src/store/slices/editor-tab-cluster-rekey.test.ts
  • src/renderer/src/store/slices/editor/file-ids/open-file-path-rekey.ts
  • src/renderer/src/store/slices/recently-closed-tab-clusters.test.ts
  • src/renderer/src/store/slices/recently-closed-tab-position.ts
  • src/renderer/src/store/slices/restored-editor-tab-clusters.test.ts
  • src/renderer/src/store/slices/tab-group-state.test.ts
  • src/renderer/src/store/slices/tab-group-state.ts
  • src/renderer/src/store/slices/tabs/create-tabs-slice.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-model.test.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-model.ts
  • src/renderer/src/store/slices/tabs/tab-cluster-persistence.test.ts
  • src/renderer/src/store/slices/tabs/tabs-close-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-collapse-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-move.test.ts
  • src/renderer/src/store/slices/tabs/tabs-cluster-transfer-actions.test.ts
  • src/renderer/src/store/slices/tabs/tabs-create-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-drop-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-focus-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-move-actions.ts
  • src/renderer/src/store/slices/tabs/tabs-slice-contract.ts
  • src/renderer/src/store/terminals/terminal-tab-creation.ts
  • src/shared/tab-close-successor.test.ts
  • src/shared/tab-close-successor.ts
  • src/shared/tab-group-history.ts
  • src/shared/tab-types.ts
  • src/shared/workspace-session-terminal-tab-close.test.ts
  • src/shared/workspace-session-terminal-tab-close.ts
  • tests/e2e/tab-clusters.spec.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/runtime/web-session-tabs-sync/state-equality-core.ts
  • src/renderer/src/store/slices/tab-group-state.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes

Re-reviewed PR #24728 at 51d17b3, scoped to the delta since the prior pullfrog review at 2f31d76: a batch of fix(tab-clusters) branch commits plus a merge of origin/main.

  • Unified successor/history into shared — pickNextActiveTab/pickTabCloseSuccessor now live in src/shared/tab-close-successor.ts (rewritten to handle legacy duplicate orders), pushRecentTabId in src/shared/tab-group-history.ts, and getHiddenClusterTabIds in src/shared/tab-types.ts; every close, cross-pane move/drop, headless close, and editor-rekey path shares them and records the chosen successor.
  • Insertion snapping — added getTabClusterInsertionIndex so a non-joining insert lands outside another cluster's span, applied in moveTabsToPane and restoreRecentlyClosedTabPosition; applyTransferredTabClusterMembership folded into tab-cluster-model.ts.
  • Chip rework — one useTabClusterChipGesture, rename requested through the store field renamingTabCluster instead of a window event, double-click rename dropped (menu only), and useMountedRef focus handling that lets Radix restore focus to the chip.
  • Floating panel — collapsed-cluster members skipped in visibleFloatingTabOrder and switchFloatingWorkspaceTab; the chip is marked data-floating-terminal-no-drag.
  • Consolidation — folded tab-cluster-menu-targets into tab-strip-selection, tabs-cluster-move-actions into tabs-cluster-actions, and tab-group/TabDragPreview into tab-bar/TabDragPreview; the New Group menu counts only groupable tabs.

ℹ️ Nitpicks

  • moveUnifiedTabToGroup (src/renderer/src/store/slices/tabs/tabs-move-actions.ts:43) inserts at a raw index without getTabClusterInsertionIndex, so an interior-index move would let the membership invariant absorb the tab into a cluster, diverging from dropUnifiedTab, which snaps to the nearest edge. Latent today — the only production caller (web-runtime-terminal-placement-settlement.ts:62) passes no index, and the shared test (tabs-cluster-transfer-actions.test.ts:168) covers only boundary indices — but worth aligning the two entry points.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Comment thread src/shared/tab-close-successor.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Re-reviewed PR #24728 at 06e5904, scoped to the single commit since the prior pullfrog review at 51d17b3: two fix(tab-clusters) corrections that close out both findings from the last review, each with a regression.

  • Indexed cross-pane moves now snap to the cluster edge — moveUnifiedTabToGroup (tabs-move-actions.ts:46) routes its target index through getTabClusterInsertionIndex, so a move aimed at another pane's cluster interior lands just outside it instead of being absorbed by the position-derived membership rule. This aligns the move path with dropUnifiedTab; the drop path still passes joiningClusterId for explicit joins, while the move path intentionally joins by position only. The new it.each in tabs-cluster-transfer-actions.test.ts drives interior indices 2 and 3 through both drop and move and asserts the destination cluster keeps its original members.
  • Close-successor guard now counts survivors, not entries — src/shared/tab-close-successor.ts:57 changed visibleOrder.length > 1 to visibleOrder.some((tabId) => tabId !== closingTabId). The old guard counted the closing id (and legacy duplicates of it), so a collapsed group with a duplicated active id fell through to pickNextActiveTab on a two-entry list and returned null, leaving activeTabId null while a hidden member remained. The regression in tab-close-successor.test.ts pins ['a','a','b'] closing 'a' → 'b'. The prior inline thread is resolved by the author.

No other production file changed in this delta; both corrections are accurate and covered.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

# Conflicts:
#	src/renderer/src/components/floating-terminal/FloatingTerminalPanelSurface.tsx
#	src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.ts
#	src/renderer/src/components/floating-terminal/use-floating-terminal-panel-items.ts
#	src/renderer/src/components/tab-bar/EditorFileTabContextMenu.test.tsx
#	src/renderer/src/components/tab-bar/EditorFileTabContextMenu.tsx
#	src/renderer/src/components/tab-bar/TabBarItemRow.tsx
#	src/renderer/src/components/tab-bar/tab-bar-surface.tsx
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/lib/floating-workspace-terminal-actions.test.ts
#	src/renderer/src/store/slices/tabs/tabs-close-actions.ts
@kiendle
kiendle force-pushed the kiendle/grouped-tabs branch from 669eff4 to 1b015b0 Compare October 7, 2026 07:10
# Conflicts:
#	src/renderer/src/components/floating-terminal/use-floating-terminal-close-actions.test.tsx
#	src/renderer/src/components/tab-bar/SortableTabContextMenu.tsx
#	src/renderer/src/components/tab-bar/TabBar.tsx
#	src/renderer/src/i18n/locales/en.json
#	src/renderer/src/store/slices/editor/actions/restored-editor-owner-transition.ts
#	src/renderer/src/store/slices/store-test-helpers.ts

This branch has not been deployed

No deployments
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.

[Feature]: Tab groups: merge tabs into named, collapsible folders

1 participant