Skip to content

Add collapsible tab groups#5201

Open
AryaanSheth wants to merge 3 commits into
stablyai:mainfrom
AryaanSheth:feat/tab-groups
Open

Add collapsible tab groups#5201
AryaanSheth wants to merge 3 commits into
stablyai:mainfrom
AryaanSheth:feat/tab-groups

Conversation

@AryaanSheth

@AryaanSheth AryaanSheth commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Adds named, colored, collapsible tab groups to the tab bar. Users can group tabs from tab context menus,
add/remove tabs from groups, rename/recolor groups, collapse/expand group chips, ungroup, and close all
tabs in a group. Group membership, name, color, order, and collapsed state persist across app restarts.

Screenshots

Recording_2026-06-11_11-39-09.1.mp4

Testing

  • pnpm lint
    • Blocked by unrelated existing max-lines violations in MobileHero.tsx, McpConfigSection.tsx,
      ThemeStep.tsx, HostedReviewActions.tsx, CodexUsagePane.tsx, OpenCodeUsagePane.tsx, and
      ClaudeUsagePane.tsx.
  • pnpm typecheck
  • pnpm test
    • Focused tab-group/session tests pass.
    • Full suite is blocked by unrelated existing failures in src/main/ipc/pty.test.ts and WorktreeList
      lineage tests.
  • pnpm build
    • Passed with native build permissions; the build logs still show a non-fatal /usr/local/bin/orca-dev
      symlink permission warning.
  • Added or updated high-quality tests that would catch regressions, including group creation, rename,
    recolor, collapse/expand, add/remove, reorder, close grouped tabs, delete empty groups, persistence round-
    trip, hydration cleanup, collapsed chip rendering, and tab/menu compatibility.

AI Review Report

AI review checked the tab data model, tab strip rendering, context menus, drag/drop path, session
persistence/hydration, and compatibility with existing per-tab colors.

Risks checked:

  • Cross-platform compatibility for macOS, Linux, and Windows: no new keyboard shortcuts or Electron
    accelerators were added, so shortcut label/accelerator behavior is unchanged.
  • Paths and shell behavior: no new path handling or shell execution was added.
  • SSH/remote/local compatibility: grouping is renderer/store/session state only and does not assume local
    processes, local paths, credentials, or network locality.
  • Provider/integration neutrality: grouping is implemented against unified tab state and applies
    consistently across terminal, editor, browser, and simulator tabs.
  • Performance: tab bar grouping derives lookup maps with memoized selectors and renders only visible
    entries when groups are collapsed.
  • UI quality: group chips and menus use existing tab strip styling, design tokens, shadcn menu/input
    primitives, lucide icons, and the existing tab color palette.

The review flagged stale group cleanup and group color coverage across all tab types. The implementation
now sanitizes groups during close, move, reconcile, hydration, and persistence, and applies group color
before per-tab color for every tab type.

Security Audit

This PR is UI/state-only. It does not add command execution, IPC handlers, auth flows, credential access,
dependency changes, or filesystem writes beyond existing workspace session persistence.

Reviewed risks:

  • Input handling: group rename input is trimmed and ignored when empty.
  • Command execution: no new command execution paths.
  • Path handling: no new path construction or path parsing.
  • Auth/secrets: no new auth or secret handling.
  • IPC: no new IPC channels or preload APIs.
  • Persistence: persisted group state is sanitized on hydration to drop stale/missing members and empty
    groups.

No security follow-up identified.

Notes

  • Grouped tab color now applies consistently across terminal, editor, browser, and simulator tabs.
  • Collapsed group chips accept tab drops, and expanded group members can be reordered/moved between
    groups.
  • Follow-up: make collapsed group chips draggable as whole groups for full group-level reorder polish.
  • X handle: @aryaan_sheth

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 354d69bc-cc74-4064-9b66-3960eeec0021

📥 Commits

Reviewing files that changed from the base of the PR and between 4f871f1 and 7751e1e.

📒 Files selected for processing (7)
  • src/renderer/src/components/tab-bar/TabFolderGroupChip.test.tsx
  • src/renderer/src/components/tab-bar/tab-color-palette.ts
  • src/renderer/src/components/tab-bar/tab-folder-group-defaults.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/store/slices/tab-folder-group-state.ts
  • src/renderer/src/store/slices/tab-folder-groups.test.ts
  • src/renderer/src/store/slices/tabs.ts
✅ Files skipped from review due to trivial changes (1)
  • src/renderer/src/components/tab-bar/tab-folder-group-defaults.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/renderer/src/components/tab-bar/TabFolderGroupChip.test.tsx
  • src/renderer/src/components/tab-bar/tab-color-palette.ts
  • src/renderer/src/store/slices/tab-folder-group-state.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/store/slices/tabs.ts

📝 Walkthrough

Walkthrough

This PR adds tab folder groups, a feature enabling users to visually and functionally group related tabs within split-pane layouts. The implementation introduces the TabFolderGroup type to the shared data model, extends the store with folder-group state and lifecycle actions, adds new UI components for group visualization and interaction (TabFolderGroupChip, TabFolderMenuItems), and integrates folder-group context into existing tab components. The TabBar component is refactored to render and manage grouped tabs, including folder header entries and member tab expansion/collapse. Drag-and-drop is extended to support moving tabs into/out of folder groups. Session persistence is updated to save and restore folder-group state across workspace restores.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title "Add collapsible tab groups" clearly summarizes the main change—introducing collapsible tab grouping functionality to the tab bar.
Description check ✅ Passed The description comprehensively covers all required template sections: user-visible changes (collapsible tab groups with naming, coloring, persistence), a demo video link, testing status with explanations for blockers, AI review covering cross-platform compatibility and security, and notes on follow-up work.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/renderer/src/store/slices/tabs.ts (1)

1262-1287: 💤 Low value

Feature interaction recorded even when no ungroup occurs.

If findFolderGroupAndWorktree returns null, the set callback returns {} (no-op), but recordFeatureInteraction on line 1286 is still called unconditionally. Other actions in this file (e.g., createTabFolderGroup, addTabsToFolderGroup) only record the interaction when the operation succeeds.

Suggested fix
   ungroupTabFolderGroup: (folderGroupId) => {
+    let ungrouped = false
     set((state) => {
       const found = findFolderGroupAndWorktree(state.tabFolderGroupsByWorktree, folderGroupId)
       if (!found) {
         return {}
       }
+      ungrouped = true
       const { folderGroup, worktreeId } = found
       // ... rest of implementation
     })
-    get().recordFeatureInteraction?.('terminal-tabs')
+    if (ungrouped) {
+      get().recordFeatureInteraction?.('terminal-tabs')
+    }
   },

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6224e5d6-c616-4cca-b476-8d135574d8f3

📥 Commits

Reviewing files that changed from the base of the PR and between 3607180 and 4f871f1.

📒 Files selected for processing (30)
  • src/renderer/src/components/sidebar/folder-workspace-composer-submit.ts
  • src/renderer/src/components/tab-bar/BrowserTab.test.tsx
  • 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.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.tsx
  • src/renderer/src/components/tab-bar/TabBar.tsx
  • src/renderer/src/components/tab-bar/TabFolderGroupChip.test.tsx
  • src/renderer/src/components/tab-bar/TabFolderGroupChip.tsx
  • src/renderer/src/components/tab-bar/TabFolderMenuItems.tsx
  • src/renderer/src/components/tab-bar/tab-color-palette.ts
  • src/renderer/src/components/tab-bar/tab-folder-group-defaults.ts
  • src/renderer/src/components/tab-group/useTabDragSplit.ts
  • src/renderer/src/lib/workspace-session-browser-history.test.ts
  • src/renderer/src/lib/workspace-session-editor-drafts.test.ts
  • src/renderer/src/lib/workspace-session-liveness.test.ts
  • src/renderer/src/lib/workspace-session-patch.test.ts
  • src/renderer/src/lib/workspace-session-patch.ts
  • src/renderer/src/lib/workspace-session-relevant-fields.test.ts
  • src/renderer/src/lib/workspace-session-unified-tabs.ts
  • src/renderer/src/lib/workspace-session.ts
  • src/renderer/src/store/slices/tab-folder-group-state.ts
  • src/renderer/src/store/slices/tab-folder-groups.test.ts
  • src/renderer/src/store/slices/tabs-hydration.ts
  • src/renderer/src/store/slices/tabs.ts
  • src/shared/types.ts
  • src/shared/workspace-session-schema.ts

Comment thread src/renderer/src/components/tab-bar/tab-color-palette.ts
Comment thread src/renderer/src/components/tab-bar/tab-folder-group-defaults.ts Outdated
Comment thread src/renderer/src/components/tab-group/useTabDragSplit.ts
Comment thread src/renderer/src/store/slices/tab-folder-group-state.ts
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