Skip to content

feat(app): group tabs by project or server in Consolidated (opencode#66350) - #1215

Merged
Hona merged 9 commits into
devfrom
upstream-g/group-tabs
Nov 25, 2026
Merged

Hona merged 9 commits into
devfrom
upstream-g/group-tabs

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Port of official anomalyco/opencode#66350 (204d38da8d): Settings › Group tabs (None / By project / By server) for Consolidated's open tabs. Official paths below are under packages/app/src/.

flowchart LR
  S["Settings: Group tabs<br/>none | project | server"] --> M["auto_groups::build<br/>(autoTabGroups)"]
  T["open tabs, not pinned"] --> M
  C["window row tabs.autoGroups<br/>collapsed groups"] --> M
  M --> SIDE["side tabs: header + strip per group,<br/>divider before the tabs with no project"]
  M --> TOP["top tabs: one strip in group order"]
  M --> KEYS["tab keys, Close other tabs"]
  M --> ORD["poll: saved tab order keeps<br/>each group's tabs together"]
Loading

What it does

Behaviour Official Ours
Setting appearance.tabGrouping, default none, effective only under Consolidated settings/model.tsx:159-160, :538-543 features/settings/src/{prefs,lib,stored}.rs
Row Group tabs under Tab position, only with navigation Tabs settings/general/interface-mode.tsx:42-52, runtime/i18n/en.ts:924-927 features/settings/src/pages/general.rs, navigation_mode.rs, search/mod.rs
Groups in the order their first tab appears; tabs with no project last, under no header; by server only with two or more servers; one project on two servers is two groups that name their server shell/titlebar/auto-tab-groups.ts:34-76 apps/desktop/src/shell/tabs/auto_groups.rs build
Pinned tabs are in no group shell/titlebar/titlebar.tsx:680, auto-tab-sections.tsx:53 auto_groups.rs grouped
The saved tab order is rewritten so each group's tabs stand together; tabs in no group keep their places auto-tab-groups.ts:82-88, auto-tab-sections.tsx:71-79 auto_groups.rs grouped_order, poll
Collapsed groups are the window's (tabs.autoGroups); only side tabs collapse; a collapsed group shows only the open page's tab auto-tab-sections.tsx:17, :34, :66-68; auto-tab-groups.ts:72 auto_groups.rs restore, toggle, groups
Side tabs: a 28 pt header per group (project icon or server glyph, name, the server's tag, a collapsed group's mark: ring, amber, accent; chevron on hover or keyboard focus), 8 above a header that is not first, project groups hide their tabs' avatars, a divider before the tabs with no project auto-tab-sections.tsx:83-181, :197-204; tab-strip.tsx:1060-1069 new apps/desktop/src/shell/view/sidebar/auto_sections.rs, pinned_area.rs side_tabs
Top tabs: no headers, nothing collapses, the groups in order auto-tab-sections.tsx:194-195 shell/view/titlebar.rs
A tab moves only inside its group: a drop in another group puts it back tab-strip.tsx:943, :1205-1206 shell/view/tab_strip.rs on_reorder
The tab keys step through the pinned rows, then the shown tabs in group order tab-strip.tsx:715-719, :849-853, :917 shell/tabs/actions.rs nav_order
Close other tabs and Close tabs below act on the tabs the strip shows, in its order (not the pinned sessions' tabs, not a collapsed group's hidden tabs) tab-strip.tsx:948-954 features/session-menu/src/{host,lib}.rs strip_tabs, apps/desktop/src/session/menu.rs
A tab hidden in a collapsed group keeps its status and background load tab-strip.tsx:869-895 already so: apps/desktop/src/session/meta/status.rs:381-395 reads every open tab (by reading)
  • A fault of ours that the port corrects: under Consolidated, Close other tabs also closed the open tabs of pinned sessions, which the strip does not show (official counts only the strip's tabs: shell/titlebar/tab-strip.tsx:715-719, :948-954). Case 9.
  • No plugin sees the setting: the plugin contract is not touched.
  • No manifest, lock or profile change.
  • Three scenes for looking at it: sidebar-grouped, sidebar-grouped-collapsed, top-grouped.

Cases to run (headless, on this PR's Windows x64 build; before = a build without the change)

  1. Settings. Consolidated, navigation Tabs, Settings › Preferences. See: a row settings-tab-grouping titled "Group tabs" under "Tab position", showing "None"; its menu lists None, By project, By server. With navigation List the row is gone. Before: no such row.

  2. Side tabs by project. Scene sidebar-grouped. See, top to bottom: the pinned session; a header lumen over "Fix flaky reconnect in the event stream" (the open tab), "Add keyboard shortcuts to the command palette", "Profile scroll jank in long transcripts"; harbor over two tabs; tidepool over one; quill over one; a divider auto-group-divider; then "A session with no project". Sizes: each header 28 high; a header's top 11 under the tab above it; tabs 3 apart; the divider 1 high, 11 above and 11 below; tabs under a project header show no avatar, the last tab shows its own. Before (scene sidebar-consolidated): one flat list in the tabs' own order.

  3. Collapsed. Scene sidebar-grouped-collapsed (or press the three headers in case 2). See: lumen keeps only the open tab under it; harbor shows no tab and a ring after its name (the fixture has one of its sessions working); tidepool shows no tab and an amber dot (the fixture has a permission waiting in it); lumen shows an accent dot only if one of its hidden sessions is unread; the three chevrons point to the side when shown (pointer over a header, or Tab onto it); quill is open. Ctrl+1 opens the pinned session, Ctrl+3 opens "Fix footnote numbering in exported PDFs" (the hidden tabs take no number). Pressing a header again shows its tabs.

  4. Top tabs and the saved order. Scene top-grouped. See the strip's tabs in this order: the three lumen sessions, the two harbor, tidepool, quill, then "A session with no project"; no header, nothing collapsed. Then set Group tabs to None: the order stays (the saved order was rewritten). Before (scene top-consolidated without the change): the tabs' own order, lumen and harbor mixed.

  5. Close other tabs. Scene sidebar-grouped-collapsed, right-click "Fix footnote numbering in exported PDFs", Close other tabs. See: the open tab under lumen and "A session with no project" close; the pinned session and the tabs hidden under lumen, harbor and tidepool stay (press the headers to see them); the page, which was the open tab under lumen, is now "Fix footnote numbering in exported PDFs", the tab the menu was on (official shell/tabs/tabs.tsx:671-680). Before: every other tab closes.

  6. Drag. Scene top-grouped: drag the second lumen tab one place to the right: it trades places with the third. Drag the first lumen tab onto a harbor tab: it goes back. Scene sidebar-grouped: drag a lumen tab down one place: it trades places inside its group.

  7. By server. Group tabs › By server with one server: no header, the list as with None. With a second server added by address and a tab open on each: two headers with the server glyph and the servers' names. By project with the same project open on both servers: two headers for it; the one that is not the app's own server has the server's tag after the name (official runtime/server/registry.tsx:345-348: no tag for the app's own server).

  8. Kept across a restart. Collapse a group, close the window with its close button, start again: the group is still collapsed.

  9. Close other tabs leaves pinned sessions alone (no grouping). Scene sidebar-consolidated. Press a pinned row whose session also has an open tab, so the page is a pinned session's. Right-click any tab of the strip under the pinned area, Close other tabs. See: the strip's other tabs close and the page stays on the pinned session. Before: the pinned session's tab closes too, so the page leaves it.

What has run

Headless, on this PR's Windows x64 CI builds, scenes, no server. The before build is the Rune pin bump's own PR build (#1192, run 45629508899, head cc991c6505): dev at the new pin; dev has since gained changes this PR's cases do not look at.

The heads: 4f9e83703 (the old pin); 5ce06ccd8 (the new pin taken in); e1663f565 (the fix of case 5's page); 1170f8b9f (dev with #1211 taken in, which shares four files with this change).

Case Head it ran on Result
1 (the row and its menu; gone with navigation List; the default) the row and its menu: 5ce06ccd8 (before that 4f9e83703, read equal); the default, from a default profile: e1663f565 holds: from defaults the row is there and shows "None"
2 1170f8b9f (the head that merges), read equal to 5ce06ccd8's; before that 4f9e83703 holds
3 (at rest; Ctrl+1, Ctrl+3; a header pressed again shows its tabs) at rest and the keys: 5ce06ccd8 (before that 4f9e83703, read equal); the header: e1663f565 holds. Not run: the chevrons under the pointer or Tab
4 (the order; Group tabs to None keeps it) 5ce06ccd8 holds
5 (which tabs close; the hidden tabs stay; the page) 1170f8b9f (the closing and the page), as on e1663f565; the headers pressed after it: e1663f565 holds: the open tab under lumen and the tab with no project close; every hidden tab and the pinned session stay; the page and the selected tab are the menu's tab. On 5ce06ccd8 the closing held and the page went to the pinned session: this change's own fault, corrected in e1663f565
Close tabs below (the page's tab among the closed) e1663f565 holds: everything below the menu's tab closes; the page is the menu's tab
6 (three drags) 5ce06ccd8 holds
9 1170f8b9f, as on e1663f565; before cc991c6505 holds: the strip's other tabs close and the page stays on the pinned session. Before: the page leaves it
7, its first sentence (By server with one server: no header, the list as with None) e1663f565, top tabs, a default profile holds. The side form: not run yet
7 (By server with two servers; By project with the same project on both) 1170f8b9f, after the merge, with the test server and a second server holds: By server: two headers, a server glyph and the server's name each; By project: two headers for the project, the second server's with its tag. Seen beside it: a draft tab of the first server stood below the divider while the page was the second server's tab: a fault of this change, fixed forward in #1258
8 (the choice and the collapsed groups kept across a restart) 1170f8b9f, after the merge, with the test server holds: after the window's close button and a new start, By project is still on and the collapsed group still collapsed

Not run (by reading)

  • A project that loads after its tab joins its group where the tab was (auto-tab-groups.ts:79-80; ours grouped_order leaves a tab with no project in place).

  • A permission or question waiting in the open tab counts for its collapsed group's amber mark (auto-tab-sections.tsx:107-129 reads every tab's own state; ours auto_groups.rs mark).

  • A finger's drag (which does not select the tab it lifts) reorders inside a group but draws no lift in a group's strip: the groups' strips share the window's one gesture and tell whose it is by the open tab (tab_strip.rs strip).

  • A tab dragged in from another window while grouped: ours only (official keeps a drag inside its list: tab-strip.tsx:1175); it lands by the pointer and then joins its group.

  • A narrow window shows no groups, as official: its drawer is a strip given no sections, every tab in the saved order (shell/titlebar/titlebar.tsx:840-855); ours' tab keys and Close other tabs there stay as they were before this change (auto_groups.rs groups, session/menu.rs strip_tabs).

Open differences

Difference Official Needs Size
Top tabs draw no 16 × 1 divider between groups, and the tab after it keeps its own hairline tab-strip.tsx:1060-1068, tab-nav.css:260-261 the kit's tab strip has no place between two slots: an addition in anomalyco/rune (a section boundary before a slot), a pin bump, then a few app lines S in Rune
Top tabs: during a drag the tabs of other groups step aside, though the drop there is refused tab-strip.tsx:118-123, :943 the same addition (the drag's lane ends at the boundary) with the above
Side tabs: the arrow keys stop at a group's last tab (one tab list per group; official has one list) tab-strip.tsx:1040-1047 one strip with sections (the same addition, plus a header before a slot) M
The server's tag gives way at the name's rate, not twice as fast auto-tab-sections.tsx:156 a shrink factor in Rune; shows only in a sidebar too narrow for both XS
Close other tabs while the page is no tab's (Home, opened from tab A; the menu is tab B's; A closes). Official remembers B as the tab to come back to: its landing page and the title bar's Back with nothing behind it show B (restoreTab). Ours: Home's button, pressed again, stays on Home, as A is gone; B opens by a press on its tab. By reading shell/tabs/tabs.tsx:673, :684, :452-467 the tab Home goes back to (apps/desktop/src/shell/tabs/actions.rs toggle_home) re-aimed at the kept tab XS
The chevron shows and turns at once, not over 150 ms auto-tab-sections.tsx:174 the per-member curves already merged in anomalyco/rune, after the pin that has them XS

Hona added 6 commits November 25, 2026 21:53
…66350)

Settings > Group tabs (None / By project / By server), effective under Consolidated: side tabs get a collapsible header per group, top tabs stand in group order, the saved tab order keeps each group's tabs together, pinned tabs stay out of every group, and the tab keys and Close other tabs follow what the strip shows.
Hona added 3 commits November 26, 2026 01:27
When the page's own tab was among the closed, each closed tab handed the page to a neighbour in turn; with tabs the strip does not show still open (a pinned session's, a collapsed group's) the page ended on one of those. Official goes to the kept tab (packages/app/src/shell/tabs/tabs.tsx:671-680).
@Hona
Hona marked this pull request as ready for review November 25, 2026 18:17
@Hona
Hona merged commit 3bdfea8 into dev Nov 25, 2026
7 checks passed
@Hona
Hona deleted the upstream-g/group-tabs branch November 25, 2026 18:17
Hona added a commit that referenced this pull request Nov 25, 2026
No new official commit since b6973f1b7b. UP-235 (Settings > Group tabs) is ported by #1215: the row has what ran, the two cases that wait for a server, and the open differences with their official lines.
Hona added a commit that referenced this pull request Nov 25, 2026
Hona added a commit that referenced this pull request Nov 25, 2026
Hona added a commit that referenced this pull request Nov 25, 2026
Hona added a commit that referenced this pull request Nov 25, 2026
…breaks

dev now holds #1215 as one commit, #1258's fix and the Rune pin with TabStrip::breaks (rune#2291). The four files this branch rewrote keep this branch's side, with #1258's one line in auto_groups.rs project_of.
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.

1 participant