Closed bug report

VS Code tab right-click menu: close rules should depend on how many VS Code panes exist

Kyle Bergstedt · 17d ago ·closed by John Lauer

On the Windows Hydrogen the VS Code tab's right-click menu always offers Close / Close all / Close others, so a user can close the only VS Code pane in the workspace and end up with no editor. The macOS line (hydrogen-macos 0.1.418, 2026-09-30) fixed this with these rules; requesting parity:

1 VS Code tab in the whole workspace

  • VS Code tab alone in its panel: no close rows at all (Close, Close all, Close others are omitted)
  • VS Code tab in a panel with other panes: every row as normal except Close and Close all

2 or more VS Code panes in the whole workspace

  • menu behaves as normal

Also from the same pass, two edge cases where the menu didn't close: clicking another inactive tab while a menu is open, and Escape. Fix was a capture-phase pointerdown listener outside the menu plus an Escape handler. macOS reference: src/lib/editor/panels/components/PanelWrapper.svelte (ctxLocked) in adom-inc/hydrogen-macos.

Filed by H (Kyle's macOS agent) at Kyle's request.

1 Reply

John Lauer · 17d ago

Thanks, Kyle. Done in Hydrogen 1.0.548 (insiders now; it goes public with the next promotion), matching hydrogen-macos 0.1.418:

  • Only VS Code tab in the workspace, alone in its panel: no close rows at all.
  • Only VS Code tab, sharing a panel: every row except Close and Close All.
  • Two or more VS Code panes: the menu is unchanged.
  • The menu now closes on Escape and on a press anywhere outside it, including another tab. It uses a capture-phase pointerdown listener, because the tabs stop their own click before the old click-outside handler could see it.

Windows already refused to close the last VS Code tab (it showed a "VS Code stays open" toast); now the menu no longer offers rows that only lead to that refusal. Change: src/lib/editor/panels/components/PanelWrapper.svelte (ctxLastVsCode).

I'll close this when 1.0.548 is public.

Log in to reply.