Skip to content

cmux-tui: closing a screen, pane or workspace keeps its tab groups for reopen (cx-gzh.31) - #20736

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
fix/close-keeps-tab-groups
Oct 15, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
fix/close-keeps-tab-groups

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Until now, only Close Group kept its group in closed history (#20630, #20723). If you closed a screen, pane or workspace, or closed a group's last tab, the groups inside were dropped, and Cmd-Shift-T brought the tabs back loose.

  • capture_closed now records every live tab group that holds a closing tab, whether the tab closes by itself or inside a closing screen or workspace. Each group goes on the closed-history record as an entry in tab_groups, naming only its closed tabs in strip order. Groups in ephemeral (incognito) workspaces are never recorded. The lookup lives in the new state/closed_tab_groups.rs.
  • Reopen forms each group again around the tabs it brought back, keeping the id, name, color and icon. If the group is still open, the reopened tabs join it instead. Groups none of whose tabs came back are skipped.
  • Close Group now uses the same capture, so StripEdit.closed_group and attach_closed_tab_group are removed. Records stored with the older single tab_group still reopen.
  • Behavior change: Cmd-Shift-T on a tab closed out of a still-open group puts it back in that group (as Chrome does), at the group's end.

Testing

  • Red: c8b0dd908718 adds a_closed_screen_reopens_with_its_tab_group (screen.close on a 3-tab screen holding a 2-tab group).
  • Green: on the fix head with the reopen filter, which also covers the existing Close Group, ungroup and partial-reopen tests. Results to follow in a comment.

Changelog

Fixed: Reopening a closed screen, pane or workspace brings back the tab groups it held.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Reopening a closed screen, pane, or workspace now restores the tab groups it held, instead of bringing the tabs back loose.

  • Closing a tab records every live tab group holding it (directly, or inside a closing screen, pane, or workspace) in closed history, naming the group's closed tabs in strip order. Only memberships of tabs still in the group's pane are recorded; groups in ephemeral (incognito) workspaces are never recorded.
  • Reopen forms each recorded group again around the tabs it brought back, preserving the group's id, name, color, and icon; if the group still holds an open tab, the reopened tabs join it instead. A leftover group row whose pane closed holds no open tab, so it is not live and forms again.
  • Close Group now uses the same capture path, replacing its separate attach step; records stored with the older single tab_group field still reopen.
  • Behavior change: Cmd-Shift-T on a tab closed from a still-open group now puts it back in that group (as Chrome does), at the group's end.

Written for commit 8c2bb84. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 14, 2026 13:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ps for reopen (cx-gzh.31)

A close records every live tab group holding a closing tab (directly, or in
a closing screen or workspace) on its closed-history group, naming the
group's closed tabs. Reopen forms each group again around the tabs it
brought back, or adds them to the group if it is still open. Close Group
now goes through the same capture, which replaces its separate attach step;
records stored with the older single tab_group still reopen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 20:48 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6a8e1a6c-2ec8-4795-a386-0ea86da479b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@blacksmith-sh

This comment has been minimized.

- A group row a screen, pane or workspace close left behind is not live:
  reopen forms the group again instead of adding to a group whose pane is
  gone. Every strip edit prunes such rows before it runs, so the id is
  free again.
- Capture the groups before capture_workspace forgets which closing
  workspaces are ephemeral, so incognito group names are never recorded.
- Record only memberships of tabs still in their group's pane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 21:12 — with GitHub Actions Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

The review subagent found defects in 15f3127aad11; they are fixed in 9150fae695e7:

  1. Stale group row (blocking): a screen, pane or workspace close leaves the closing group's row in place, still naming a pane that is gone, so reopen called tab_group_add on it and failed. A group now counts as live only if it holds an open tab, and every strip edit prunes stale rows before it runs, so tab_group_create can reuse the id.
  2. Privacy: groups were captured after capture_workspace had already forgotten which closing workspaces are ephemeral. They are now captured before it, so incognito group names are never recorded.
  3. Moved tabs: membership rows now count only for tabs still in their group's pane (t.pane_id = g.pane_id).

Not covered here (already a gap before this PR): close-tab-group with end_terminals:true takes the batch path, which writes the pruned groups before the patch is captured, so no group is recorded. It stays on cx-gzh.31.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 21:35 — with GitHub Actions Inactive
@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 22:01 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Passes: CI passes on 8c2bb84697.

CI passes on 8c2bb84697 (run 38662177197 attempt 1).

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@teamleaderleo
teamleaderleo temporarily deployed to cmux-tui-merge-tree October 14, 2026 23:07 — with GitHub Actions Inactive
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Merging at exact head 8c2bb84. Every check on this head is green.

@teamleaderleo
teamleaderleo merged commit c6b1430 into feat-cmux-next Oct 15, 2026
198 of 207 checks passed
@teamleaderleo
teamleaderleo deleted the fix/close-keeps-tab-groups branch October 15, 2026 03:23
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/38677180348 at 70edcd5 failed: cmux-next Release compile (Xcode 26).
Those jobs last passed at 4f33baa. This pull request is one of 4 merged since: #20733, #20784, #20752, #20736.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

This branch was previously deployed

2 inactive deployments
artifacts — 8c2bb846 Deployed Oct 15, 2026 by teamleaderleo via publish tree-addressed cmux-tui #15545
cmux-tui-merge-tree — 8c2bb846 Deployed Oct 15, 2026 by teamleaderleo via publish the merge tree #1111
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