feat(editor): add context menu for closing file tabs - #2863
Merged
bajrangCoder merged 10 commits intoSep 11, 2026
Conversation
Contributor
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
bajrangCoder
requested changes
Sep 10, 2026
bajrangCoder
requested changes
Sep 11, 2026
This comment was marked as outdated.
This comment was marked as outdated.
bajrangCoder
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a context menu to file tabs, opened via long press (touch) or right click (desktop) to quickly close the current file, all open files in the group, or all tabs to the left/right of the pressed tab.
What's changed
src/handlers/editorFileTab.js— Distinguishes a long press from an actual tab drag using a pointer-slop threshold. When a press ends without moving (didDrag === false), the drag is finished and the tab context menu is opened instead.src/handlers/tabContextMenu.js(new) — Renders and positions the context menu next to the pressed tab, flipping horizontally/vertically when near the screen edge. It also guards against synthetic "click" events fired after touch gestures so menu items aren't accidentally activated on release.src/lib/editorFile.js— Wires up the context menu for both layouts:openTabContextMenuOnRelease).src/lib/commands.js— Adds two commands that run throughacode.exec(so the same prompts/flows as the rest of the app are used):close-tab— close the specific pressed file (not necessarily the active one).close-tabs-in-group— close every tab in the pressed file's pane/tab group; in the sidebar layout this closes all open files.close-tabs-to-left/close-tabs-to-right.Menu options
close-tabclose-tabs-in-groupclose-tabs-to-leftclose-tabs-to-rightTesting
Notes
strings(e.g.close file,close all) when translations exist; a hard-coded fallback is used otherwise.