cmux-tui: a tab group closed with its terminals reopens as its group (cx-gzh.31)

Merged
TE
22d ago
+54-3

Summary

Close Group with end_terminals: true goes through the batch close path. That path wrote the pruned tab groups before applying the resource patch, so when the patch's closed-history capture (#20736) ran, the group's rows were already gone. No group was recorded, and Cmd-Shift-T brought the tabs back loose.

  • topology_close_store.rs now writes the pruned groups after apply_resource_patch (in the same transaction), so the capture still sees them.

Testing

  • Red: at 060490fb09e0, a_tab_group_closed_with_its_terminals_reopens_as_its_group failed on Linux in hosted run 38647639219 ("the reopen formed no group").
  • Green: at 793cc1b14307, hosted run 38650152032 (filter tab_group) passed it on Linux and macOS, along with the other tab-group reopen tests.
  • This head merges base, which includes #20736.

Changelog

Fixed: Closing a tab group together with its terminals keeps the group for Reopen Closed.

šŸ¤– 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

Fixes tab groups being lost when closed together with their terminals, so Reopen Closed restores the group instead of loose tabs.

Closing a tab group with end_terminals: true takes the batch close path, which wrote the pruned tab groups before applying the resource patch. The patch's closed-history capture then no longer saw the group, and reopening brought the tabs back without a group. The fix writes the pruned groups after the patch in the same transaction, and adds a regression test covering the reopen-as-group behavior.