Skip to content

feat(folders): Add zen.folders.new-tabs-in-folder to open new tabs in current folder#13700

Open
mehdi-sy-h wants to merge 3 commits into
zen-browser:devfrom
mehdi-sy-h:dev
Open

feat(folders): Add zen.folders.new-tabs-in-folder to open new tabs in current folder#13700
mehdi-sy-h wants to merge 3 commits into
zen-browser:devfrom
mehdi-sy-h:dev

Conversation

@mehdi-sy-h

Copy link
Copy Markdown

Adds a new zen.folders.new-tabs-in-folder preference. When enabled, new tabs via Ctrl + T will open under the currently open tab's parent folder. This saves having to continually move new tabs into the desired folder.

Relevant discussion: #13669

@mehdi-sy-h mehdi-sy-h requested a review from mr-cheffy as a code owner May 14, 2026 20:44
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. Feature labels May 14, 2026
@mr-cheffy

Copy link
Copy Markdown
Member

We don't typically add patches like these, specially if they are just going to be hidden advanced preferences and without any tests. What would be the use case of this?

@mehdi-sy-h

mehdi-sy-h commented May 14, 2026

Copy link
Copy Markdown
Author

Sorry yes I can add some tests I was just wondering if this is a feature that might get merged. There's already the zen.folders.owned-tabs-in-folder pref which does something similar but for tabs that were middle clicked.

As for use case, generally when you're browsing/researching about a specific topic you might want to keep all those tabs under one folder, especially if you're someone who has a lot of tabs already and want things structured. Middle click is useful but not complete because you might read something for example and then search for that specific thing with Ctrl+T and have that tab be under the same folder. Without this feature there's a lot of friction in moving the relevant new tab(s) into the folder again and again and your tabs end up being cluttered again.

Imo this is a slightly separate use case than Spaces, because you might want the same containers, theme settings, etc but you still want grouping by subtopic within that space. Say you have a space for "Work" with its own container, and you're working on a bunch of different projects at work, so you group them by folder. Switching to different projects at a given time is rare, but searching for things related to the same topic is more common (you're reading docs, you see a concept you're not aware of, you open a new tab searching for it, etc).

Comment thread src/zen/folders/ZenFolders.mjs Outdated
Comment thread src/zen/folders/ZenFolders.mjs Outdated
Comment thread src/zen/folders/ZenFolders.mjs Outdated
const group = tab.group;
if (
Services.prefs.getBoolPref("zen.folders.new-tabs-in-folder")
&& !group?.isZenFolder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unsure how this would work with split views.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

For split views should I see if all of the tabs are part of the same folder and then add them, otherwise not?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Actually it looks like trying to do a split view with a tab in a folder and a tab outside of a folder is buggy in upstream already. And for a split view of tabs across two different folders, it moves one tab into the other's folder?

@mehdi-sy-h mehdi-sy-h marked this pull request as draft May 15, 2026 00:31
@mehdi-sy-h

Copy link
Copy Markdown
Author

What kind of tests would be useful? I imagine one similar to the existing owner tabs test test_Duplicate_Tab_Inside_Folder.

@mehdi-sy-h mehdi-sy-h marked this pull request as ready for review May 16, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants