-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add intelligent tab grouping by similarity #11144
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
base: dev
Are you sure you want to change the base?
Conversation
This feature automatically organizes workspace tabs into categories based on their content and domain. How it works: - Analyzes all unpinned tabs in the active workspace - Uses intelligent keyword matching to categorize tabs by topic (Development, Social, Shopping, Video, News, etc.) - Groups similar tabs together with visual category headers - Maintains logical ordering with priority-based sorting - New tabs automatically stay above categorized groups The grouping is triggered via a new 'Group' button in the workspace toolbar. Categories include: Development, Social Media, Shopping, Video/Streaming, News, Productivity, Finance, Gaming, and more. Localization support added for: en-US, en-GB, it
a7fb22c to
c8fb216
Compare
|
Have you tested this by the way? |
c8fb216 to
a7fb22c
Compare
Yes i did tested, but my bad, I've let AI do some things and didn't realized it forced pushed, I fixed it by restoring the working version, i'm really sorry for the confusion. Here is a video showing the functionality: Screen.Recording.2025-11-04.at.21.18.31.mov |
|
I think we should be using Firefox's local llm for this, no? |
|
This is noisier than it needs to be. Also the list feels way too subjective. The Internet is way too big to be condensed and grouped in that way. It also means that if we want to change the list we have to release a new version. |
didn't know i could do that, will implement that now |
Yep, I believe having a small, local LLM that just takes a look at tab titles and domains could serve just as good. Good thing about Firefox's LLM is that its not intrusive, its private and doesn't really do anything unless it being explicitly called. IIRC they now use the GPU for them as well? Meaning they are faster and less resource intensive. @matteomekhail read: https://firefox-source-docs.mozilla.org/toolkit/components/ml/api.html |
|
Been trying to implement this LLM model solution in the last couple of days, and none of those can give me good result BGE-base (or even small): all-MiniLM-L6-v2: distilgpt2 : All the other Xenova model don't do the job as well, either they not able to generate the right categories title, or they will not categorize correctly ( ad example not merging adidas, nike, gucci or Lv under the same category) The only approach that i've tried and it sorta work is a domain based, where i just look at the URL and merge them if they have the same based (merge all the yt tabs ad example) but that will not create a "video" category including other video provider like vimeo (as is a different domain) I really want to implement this feature in the best possible way as it was my favorite feature on Arc, so if anyone has any idea or model to try i'll be very happy to By "cluster" i mean a collection of tabs under a URL |
|
@matteomekhail I'm not sure if it could be any help, but I vibecoded a project like this that used two of the models Firefox uses to sort tabs (as I had the same issues as you with the other model) and had amazing results. I learned quite a lot about how it all worked in the process, so if I could help in any way, please feel free to reach out. |
|
I would also look on searchfox and try to find the prompt they use for naming the tabs, as I don't remember off the top of my head |
wow i just saw the screenshot and it looks good! i'll have a look at the code tomorrow, thank you! |
|
Firefox does have an auto-grouping feature, might be worth to checkout how they do it: https://searchfox.org/firefox-main/source/browser/components/tabbrowser/SmartTabGrouping.sys.mjs |
Ignore this, two different things. |
I might suggest feeding it the url along with the title when you give it to the naming model, and if possible the tabs history, as Arc seems to do that too. I can also provide the prompts that Arc uses, I will drop the link here when I find it. This is all the prompts TBC uses in there AI stuff: https://github.com/neurokitti/Arc-genAI |
Yep, I thought about that too, I also considered feeding the metadata from each tab’s meta tag, but that feels a bit over-engineered |
Uses Firefox's smart-tab-embedding and smart-tab-topic models to cluster tabs by semantic similarity and generate category labels based on URLs, titles, and browsing history.
|
I've implemented the solution using 12th suggestion, and it works much better now. It’s still not a perfect solution (ad example streaming instead of clothing, see video for reference) , but given the models available at the moment, I believe it’s the best possible solution, can always be upgraded later as smaller and better models will release and become available in Firefox. Any suggestion to improve it is appreciate it! Tomorrow i'll make the UI look cleaner & add an animation while the model works Attached is the video showing a demo Screen.Recording.2025-11-12.at.17.07.27.movThanks @12th-devs again :) |
|
Yeah of course, glad it worked out! |
|
Please let me know when its done for review! |
Sure it is ready now, Thank you! |
| /* ========================================================================== | ||
| Tab Category Headers (for Group function) | ||
| ========================================================================== */ | ||
| .tabbrowser-tab[zen-category-first="true"] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quite hacky to be honest, why not use something like firefox's existing tab group implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can change the styles of those. Just make the background always transparent and make it use the color we use for tab groups basically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matteomekhail if you need UI/UX for the tab groups, while it does not work anymore, an old project of mine ATG should help with both of those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for now
7c27f38 to
63d3439
Compare
… category implementation
…ns for grouping, now like arc has the squiggly line, removed the spinner
mr-cheffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, but instead of adding the new file to the jar manifest, better just make a new moz.build on that directory and declare it as a system module.
For example:
desktop/src/zen/common/moz.build
Line 6 in 886b559
| "sys/ZenActorsManager.sys.mjs", |
|
|
||
| &::before { | ||
| border-inline-start: none; | ||
| } | ||
|
|
||
| &::after { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd only define this element once data-grouping is enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep good idea, done
src/zen/ml/ZenTabsTidy.sys.mjs
Outdated
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
|
||
| const Services = globalThis.Services; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services will always be global, we don't need this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed now, thanks
src/zen/ml/ZenTabsTidy.sys.mjs
Outdated
|
|
||
| try { | ||
| const { createEngine } = ChromeUtils.importESModule( | ||
| 'chrome://global/content/ml/EngineProcess.sys.mjs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe lazyly load this module?
https://github.com/zen-browser/desktop/blob/dev/src/zen/urlbar/ZenUBActionsProvider.sys.mjs#L23-L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure i've done it correctly, please double check, but should work
| const keywords = extractKeywords(titles); | ||
| const domains = [...new Set(clusterData.map((data) => data.domain))].join(', '); | ||
|
|
||
| const prompt = `You are an expert organizer who creates concise, descriptive category names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is the best way we should do it, specially since there might be some possible vulnerability by directly injecting the scripts. Firefox's implementation (https://searchfox.org/firefox-main/source/browser/components/tabbrowser/SmartTabGrouping.sys.mjs) doesn't do this, for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any possibility to inject scripts here?
also i believe that firefox implementation is very similar, we both import createEngine, call the model, even tho it uses a much smaller prompt
can you please tell me what worries you exactly so i can fix it? or if you have some alternatives in mind?
…enhancing separator animations for grouping



This feature automatically organizes workspace tabs into categories based on their content and domain.
How it works:
The grouping is triggered via a new 'Group' button in the workspace toolbar.
Is not probably the best way to categorize it, a better future way would be to use AI to generate the categories based on the pages, instead of having a map with keyword, but this is definetely a cheaper way.
Localization support added for: en-US, en-GB, it (AI generated Language files, IT as is my main language)