Skip to content

Commit

Permalink
fix(menu-builder): remove new file options from tab menu
Browse files Browse the repository at this point in the history
closes #4181
  • Loading branch information
marstamm authored and nikku committed May 29, 2024
1 parent 3f723f9 commit 577041f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/lib/menu/menu-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ class MenuBuilder {
const { contextMenu } = this.options.state;

if (this.options.type === 'tab') {
return this.appendNewFile()
return this.appendContextCloseTab()
.appendSeparator()
.appendContextCloseTab()
.appendSeparator()
.appendContextRevealInFileExplorerTab()
.appendSeparator()
.appendOpenRecent();
.appendContextRevealInFileExplorerTab();
}

if (contextMenu) {
Expand Down
13 changes: 13 additions & 0 deletions app/test/spec/menu/menu-builder-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ describe('MenuBuilder', () => {
const contextMenu = menuBuilder.buildContextMenu();

expect(contextMenu).to.exist;
expectMenu(contextMenu, [
'Close Tab',
'Close All Tabs',
'Close Other Tabs',
undefined,
'Reveal in File Explorer'
]);
});


Expand Down Expand Up @@ -532,3 +539,9 @@ function callAction(fn, browserWindow = {}, triggeredByAccelerator = false) {

return fn(null, browserWindow, { triggeredByAccelerator });
}

function expectMenu(actual, expected) {
const menu = actual.menu.map(item => item.label);

expect(menu).to.eql(expected);
}

0 comments on commit 577041f

Please sign in to comment.