Skip to content

feat: add support for duplicate tab functionality - #340912

Open
Parth Raiyani (rparth07) wants to merge 2 commits into
microsoft:mainfrom
rparth07:duplicate-tab
Open

Parth Raiyani (rparth07) wants to merge 2 commits into
microsoft:mainfrom
rparth07:duplicate-tab

Conversation

@rparth07

Copy link
Copy Markdown

This resolves issue #340911

How to test

  1. Launch VS Code from sources using .\scripts\code.bat.
  2. Open the Integrated Browser and navigate to a URL containing a path, query, and fragment, such as https://code.visualstudio.com.
  3. Right-click the browser’s editor tab and select Duplicate tab (D).
  4. Verify a new tab opens immediately to the right, in the same editor group, with the same URL. Confirm the original remains open.
  5. Navigate the duplicate to another page and verify the original tab’s URL remains unchanged.
  6. Activate another editor, then right-click the inactive browser tab and duplicate it. Verify the clicked browser tab is duplicated.
  7. Right-click the browser’s editor tab and press D; verify one duplicate opens.
  8. Right-click a regular text-editor tab and verify Duplicate tab (D) is not shown.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 12:57
@vs-code-engineering

vs-code-engineering Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Kyle Cutler (@kycutler)

Matched files:

  • src/vs/platform/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserTabManagementFeatures.ts
  • src/vs/workbench/contrib/browserView/test/electron-browser/features/browserTabManagementFeatures.test.ts

Joaquín Ruales (@jruales)

Matched files:

  • src/vs/platform/browserView/common/browserView.ts
  • src/vs/workbench/contrib/browserView/electron-browser/features/browserTabManagementFeatures.ts
  • src/vs/workbench/contrib/browserView/test/electron-browser/features/browserTabManagementFeatures.test.ts

@rparth07

Copy link
Copy Markdown
Author

Parth Raiyani (Parth Raiyani (@rparth07)) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Mnemonic handling affects unrelated menu actions, and duplicate-tab ignores multi-selected tabs.

2 open findings
What changed in this PR

Adds Integrated Browser tab duplication while preserving the source URL and tab independence.

Changes:

  • Adds the Duplicate Tab command and clicked-tab targeting.
  • Adds context-menu mnemonic support.
  • Adds duplicate-tab and menu-label tests.
File Description
src/​vs/​workbench/​services/​contextmenu/​test/​electron-browser/​contextmenuService.test.ts Tests native mnemonic labels.
src/​vs/​workbench/​services/​contextmenu/​electron-browser/​contextmenuService.ts Renders native menu mnemonics.
src/​vs/​workbench/​contrib/​browserView/​test/​electron-browser/​features/​browserTabManagementFeatures.test.ts Tests duplication and visibility.
src/​vs/​workbench/​contrib/​browserView/​electron-browser/​features/​browserTabManagementFeatures.ts Implements Duplicate Tab.
src/​vs/​workbench/​common/​contextkeys.ts Defines clicked-tab editor context.
src/​vs/​workbench/​browser/​parts/​editor/​editorTabsControl.ts Populates the new context key.
src/​vs/​platform/​contextview/​browser/​contextMenuService.ts Requests mnemonic labels.
src/​vs/​platform/​contextview/​browser/​contextMenuHandler.ts Enables custom-menu mnemonics.
src/​vs/​platform/​browserView/​common/​browserView.ts Adds the command identifier.
src/​vs/​platform/​actions/​test/​common/​menuService.test.ts Tests mnemonic action labels.
src/​vs/​platform/​actions/​common/​actions.ts Adds mnemonic-aware label rendering.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

No actionable findings remain, but shared native and custom menu changes need cross-platform UI validation before approval.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@rparth07
Parth Raiyani (rparth07) force-pushed the duplicate-tab branch 2 times, most recently from 2868b42 to 6d87424 Compare October 26, 2026 09:59
@rparth07

Parth Raiyani (rparth07) commented Oct 26, 2026 •

Copy link
Copy Markdown
Author

Joaquín Ruales (@jruales) or Kyle Cutler (@kycutler), could you please review :)

…tles in context menus and actions, including duplicate tab functionality

Signed-off-by: Parth Raiyani <pmr642001@gmail.com>
@rparth07

Copy link
Copy Markdown
Author

Kyle Cutler (@kycutler), could you help confirm whether this Integrated Browser change is suitable for review, or suggest the right reviewer? Joaquín Ruales (@jruales) is currently assigned.

This branch has not been deployed

No deployments
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.

4 participants