Skip to content

shell: add 'Close all other tabs' to the tab context menu - #273

Closed
miljanm wants to merge 2 commits into
mobius-os:mainfrom
miljanm:fix/shell-close-other-tabs
Closed

shell: add 'Close all other tabs' to the tab context menu#273
miljanm wants to merge 2 commits into
mobius-os:mainfrom
miljanm:fix/shell-close-other-tabs

Conversation

@miljanm

@miljanm miljanm commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Feature

The tab context menu gains Close all other tabs: it keeps only the right-clicked tab in its pane and makes it the pane's active tab.

Semantics:

  • Pane-scoped. Only siblings in the clicked tab's pane close; tabs in other panes are untouched, matching the menu's existing pane-scoped actions (Split / Move / Close pane).
  • Never a no-op item. The item renders only when a sibling tab exists, in both the single-pane strip and the per-pane strips.
  • One reversible gesture. A single undo snapshot ("Closed other tabs" toast) restores every closed sibling at once — the same pattern as CLOSE_PANE.
  • No auto-return branch. The kept tab survives, so the pane can never empty.

Implementation

  • paneModel.js: a pure closeOtherTabs(ws, tabKey) (same-reference no-op when the tab is unknown or already alone) plus a CLOSE_OTHER_TABS reducer case with one undo slot.
  • Shell.jsx: one gated menu item between "Close tab" and "Close pane".
  • Tests: reducer behavior (keep / activate / undo / no-op) and pane-scoping in paneModel.test.js; the menu-item contract in workspaceUi.test.js.

Verification

Unit: the Shell test suite passes (151 tests). Live: drove the running shell end-to-end — opened three tabs, right-clicked one, picked "Close all other tabs"; only the clicked tab remained, in both the menu screenshot and the resulting strip. Undo semantics are covered by the reducer tests.

Keeps only the right-clicked tab in its pane; the kept tab becomes active. Pane-scoped: other panes are untouched. One reversible gesture — a single undo snapshot restores every closed sibling. Shown only when a sibling tab exists, in both the single-pane strip and per-pane strips.

Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
@miljanm
miljanm requested a review from hamzamerzic July 27, 2026 17:15
@miljanm
miljanm removed the request for review from hamzamerzic July 27, 2026 23:20

@hamzamerzic hamzamerzic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the complete diff. The action is pane-scoped, same-reference on no-ops, restores the entire prior pane state through one undo snapshot, and leaves other panes untouched. The tests cover the owning model and the menu gate.

@miljanm

miljanm commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and the approval! Nothing further needed from our side — ready to merge whenever it suits you.

@hamzamerzic

Copy link
Copy Markdown
Collaborator

Reviewed and merged to main through #304, preserving your authorship. The integrated version keeps the Close all other tabs action and its pane-level coverage. Thanks, Miljan.

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