Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature: Split New tab on Right with URL focus using shortcut (As seen on Arc Browser) #6460

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

saikanam
Copy link

@saikanam saikanam commented Mar 14, 2025

Split New Tab on Right with Keyboard Shortcut

This PR adds a new keyboard shortcut (Ctrl+Shift+'+') that:

  • Creates a vertical split view with a new tab on the right
  • Automatically focuses the URL bar for immediate navigation
  • Allows adding multiple tabs to the right by repeatedly pressing the shortcut

Why This Feature?

This enhances the Split View functionality by providing a quick keyboard-driven workflow for creating and navigating split tabs. It's particularly useful for users who prefer keyboard shortcuts over mouse interactions.

Implementation Details

  • Added a new method createSplitNewTabToRight() to ZenViewSplitter.mjs
  • Registered the shortcut in ZenKeyboardShortcuts.mjs
  • Added support for adding multiple tabs to the right side
  • Ensured proper URL bar focus behavior

Localization Strings

This feature requires the following localization string to be added to the appropriate files in the l10n submodule:
zen-split-view-shortcut-url-focus = Split View with URL Focus

Since these files are in a submodule, I've not included them in this PR.

Image demo

image

@saikanam saikanam requested a review from mauro-balades as a code owner March 14, 2025 14:27
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Feature labels Mar 14, 2025
@mauro-balades
Copy link
Member

Id rather it opens an empty tab instead of about:blank

@saikanam
Copy link
Author

Changed it to add newtab instead of blank, thanks.

One thing I forgot to mention is that max split tabs are 4, same as this.MAX_TABS

@mauro-balades
Copy link
Member

Sorry, I meant as it opens this empty state:

image

and please do fix linter errors: https://github.com/zen-browser/desktop/actions/runs/13865573260/job/38942146067?pr=6460

@saikanam
Copy link
Author

I fixed the linter errors.
That is strange if it opens the browser in that state, atleast that's what I think you mean.

Let me investigate further on a new build.

@saikanam
Copy link
Author

It works as intended on my end, please let me know if I am missing something.

The intent was to open a new split tab to the right which is empty.

That's what happens in Arc as well, when you click control + shift + '+', it opens a new empty tab on the right alongside the url bar.

ArcBrowserSplit.1.mp4

@saikanam
Copy link
Author

zenBrowserSplit.mp4

A demo of the intended workflow

@mauro-balades
Copy link
Member

Ok, it looks good. But @saikanam could you please always open about:blank and add _forZenEmptyTab to the parameters?

@saikanam
Copy link
Author

saikanam commented Mar 25, 2025

If I add _forZenEmptyTab in the parameters,it breaks the functionality by unsplitting the tabs. This is most likely due to this attribute being heavily used in other parts of zenViewSplitter to make certain filtration.

Is this attribute absolutely necessary to add? I might have to find a workaround then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants