Skip to content

Commit c8fb216

Browse files
committed
feat: add intelligent tab grouping by similarity
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
1 parent 0d80532 commit c8fb216

File tree

11 files changed

+1045
-43
lines changed

11 files changed

+1045
-43
lines changed

locales/en-GB/browser/browser/zen-workspaces.ftl

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,53 @@
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

55
zen-panel-ui-workspaces-text = Other workspaces
6-
zen-panel-ui-workspaces-create =
6+
zen-panel-ui-workspaces-create =
77
.label = Create Space
8-
zen-panel-ui-folder-create =
8+
zen-panel-ui-folder-create =
99
.label = Create Folder
10-
zen-panel-ui-new-empty-split =
10+
zen-panel-ui-new-empty-split =
1111
.label = New Split
12-
zen-workspaces-panel-context-delete =
12+
zen-workspaces-panel-context-delete =
1313
.label = Delete Workspace
1414
.accesskey = D
15-
zen-workspaces-panel-change-name =
15+
zen-workspaces-panel-change-name =
1616
.label = Change Name
17-
zen-workspaces-panel-change-icon =
17+
zen-workspaces-panel-change-icon =
1818
.label = Change Icon
19-
zen-workspaces-panel-context-default-profile =
19+
zen-workspaces-panel-context-default-profile =
2020
.label = Set Profile
21-
zen-workspaces-panel-unload =
21+
zen-workspaces-panel-unload =
2222
.label = Unload Space
2323
zen-workspaces-how-to-reorder-title = How to reorder spaces
2424
zen-workspaces-how-to-reorder-desc = Drag the space icons at the bottom of the sidebar to reorder them
25-
zen-workspaces-change-theme =
25+
zen-workspaces-change-theme =
2626
.label = Edit Theme
27-
zen-workspaces-panel-context-open =
27+
zen-workspaces-panel-context-open =
2828
.label = Open Workspace
2929
.accesskey = O
30-
zen-workspaces-panel-context-edit =
30+
zen-workspaces-panel-context-edit =
3131
.label = Edit Workspace
3232
.accesskey = E
33-
context-zen-change-workspace-tab =
33+
context-zen-change-workspace-tab =
3434
.label = Change Tab(s) To Workspace
3535
.accesskey = C
36-
zen-bookmark-edit-panel-workspace-selector =
36+
zen-bookmark-edit-panel-workspace-selector =
3737
.value = Other Workspace
3838
.accesskey = W
39-
zen-panel-ui-gradient-generator-algo-complementary =
39+
zen-panel-ui-gradient-generator-algo-complementary =
4040
.label = Complementary
41-
zen-panel-ui-gradient-generator-algo-splitComplementary =
41+
zen-panel-ui-gradient-generator-algo-splitComplementary =
4242
.label = Split
43-
zen-panel-ui-gradient-generator-algo-analogous =
43+
zen-panel-ui-gradient-generator-algo-analogous =
4444
.label = Analogous
45-
zen-panel-ui-gradient-generator-algo-triadic =
45+
zen-panel-ui-gradient-generator-algo-triadic =
4646
.label = Triadic
47-
zen-panel-ui-gradient-generator-algo-floating =
47+
zen-panel-ui-gradient-generator-algo-floating =
4848
.label = Floating
4949
zen-panel-ui-gradient-click-to-add = Click to add a colour
50-
zen-workspace-creation-name =
50+
zen-workspace-creation-name =
5151
.placeholder = Space Name
52-
zen-workspaces-panel-context-reorder =
52+
zen-workspaces-panel-context-reorder =
5353
.label = Reorder Spaces
5454
zen-workspace-creation-profile = Profile
5555
.tooltiptext = Profiles are used to separate cookies and site data between spaces.
@@ -60,6 +60,14 @@ zen-workspaces-delete-workspace-body = Are you sure you want to delete { $name }
6060
# Note that the html tag MUST not be changed or removed, as it is used to better
6161
# display the shortcut in the toast notification.
6262
zen-workspaces-close-all-unpinned-tabs-toast = Tabs Closed! Use <span>{ $shortcut }</span> to undo.
63-
zen-workspaces-close-all-unpinned-tabs-title =
63+
zen-workspaces-close-all-unpinned-tabs-title =
6464
.label = Clear
6565
.tooltiptext = Close all unpinned tabs
66+
67+
zen-workspaces-group-tabs-toast = Created { $count } { $count ->
68+
[one] group
69+
*[other] groups
70+
}!
71+
zen-workspaces-group-tabs-title =
72+
.label = Group
73+
.tooltiptext = Group tabs by similarity

locales/en-US/browser/browser/zen-workspaces.ftl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,11 @@ zen-workspaces-close-all-unpinned-tabs-toast = Tabs Closed! Use <span>{ $shortcu
8383
zen-workspaces-close-all-unpinned-tabs-title =
8484
.label = Clear
8585
.tooltiptext = Close all unpinned tabs
86+
87+
zen-workspaces-group-tabs-toast = Created { $count } { $count ->
88+
[one] group
89+
*[other] groups
90+
}!
91+
zen-workspaces-group-tabs-title =
92+
.label = Group
93+
.tooltiptext = Group tabs by similarity

locales/it/browser/browser/zen-workspaces.ftl

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,53 +3,53 @@
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

55
zen-panel-ui-workspaces-text = Spazi
6-
zen-panel-ui-workspaces-create =
6+
zen-panel-ui-workspaces-create =
77
.label = Crea Spazio
8-
zen-panel-ui-folder-create =
8+
zen-panel-ui-folder-create =
99
.label = Crea Cartella
10-
zen-panel-ui-new-empty-split =
10+
zen-panel-ui-new-empty-split =
1111
.label = Nuova Divisione
12-
zen-workspaces-panel-context-delete =
12+
zen-workspaces-panel-context-delete =
1313
.label = Elimina lo Spazio
1414
.accesskey = D
15-
zen-workspaces-panel-change-name =
15+
zen-workspaces-panel-change-name =
1616
.label = Cambia Nome
17-
zen-workspaces-panel-change-icon =
17+
zen-workspaces-panel-change-icon =
1818
.label = Cambia Icona
19-
zen-workspaces-panel-context-default-profile =
19+
zen-workspaces-panel-context-default-profile =
2020
.label = Imposta Profilo
21-
zen-workspaces-panel-unload =
21+
zen-workspaces-panel-unload =
2222
.label = Scarica Spazio
2323
zen-workspaces-how-to-reorder-title = Come riordinare gli spazi
2424
zen-workspaces-how-to-reorder-desc = Trascina le icone degli spazi in fondo alla barra laterale per riordinarle
25-
zen-workspaces-change-theme =
25+
zen-workspaces-change-theme =
2626
.label = Modifica Tema
27-
zen-workspaces-panel-context-open =
27+
zen-workspaces-panel-context-open =
2828
.label = Apri Spazio
2929
.accesskey = O
30-
zen-workspaces-panel-context-edit =
30+
zen-workspaces-panel-context-edit =
3131
.label = Modifica Spazio
3232
.accesskey = E
33-
context-zen-change-workspace-tab =
33+
context-zen-change-workspace-tab =
3434
.label = Metti scheda/e su uno spazio di lavoro
3535
.accesskey = C
36-
zen-bookmark-edit-panel-workspace-selector =
36+
zen-bookmark-edit-panel-workspace-selector =
3737
.value = Spazi
3838
.accesskey = W
39-
zen-panel-ui-gradient-generator-algo-complementary =
39+
zen-panel-ui-gradient-generator-algo-complementary =
4040
.label = Complementare
41-
zen-panel-ui-gradient-generator-algo-splitComplementary =
41+
zen-panel-ui-gradient-generator-algo-splitComplementary =
4242
.label = Dividi
43-
zen-panel-ui-gradient-generator-algo-analogous =
43+
zen-panel-ui-gradient-generator-algo-analogous =
4444
.label = Analogo
45-
zen-panel-ui-gradient-generator-algo-triadic =
45+
zen-panel-ui-gradient-generator-algo-triadic =
4646
.label = Triadico
47-
zen-panel-ui-gradient-generator-algo-floating =
47+
zen-panel-ui-gradient-generator-algo-floating =
4848
.label = Fluttuante
4949
zen-panel-ui-gradient-click-to-add = Clicca per aggiungere un colore
50-
zen-workspace-creation-name =
50+
zen-workspace-creation-name =
5151
.placeholder = Nome dello Spazio
52-
zen-workspaces-panel-context-reorder =
52+
zen-workspaces-panel-context-reorder =
5353
.label = Riordina Spazi
5454
zen-workspace-creation-profile = Profilo
5555
.tooltiptext = I profili vengono usati per separare i cookie e i dati dei siti tra gli spazi.
@@ -60,6 +60,14 @@ zen-workspaces-delete-workspace-body = Sei sicuro di voler cancellare { $name }?
6060
# Note that the html tag MUST not be changed or removed, as it is used to better
6161
# display the shortcut in the toast notification.
6262
zen-workspaces-close-all-unpinned-tabs-toast = Scheda chiusa! Usa <span>{ $shortcut }</span> per riaprirla.
63-
zen-workspaces-close-all-unpinned-tabs-title =
63+
zen-workspaces-close-all-unpinned-tabs-title =
6464
.label = Pulisci
6565
.tooltiptext = Chiudi tutte le schede non bloccate
66+
67+
zen-workspaces-group-tabs-toast = { $count ->
68+
[one] Creato { $count } gruppo
69+
*[other] Creati { $count } gruppi
70+
}!
71+
zen-workspaces-group-tabs-title =
72+
.label = Raggruppa
73+
.tooltiptext = Raggruppa le schede per similarità

src/browser/base/content/zen-commands.inc.xhtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@
6161

6262
<command id="cmd_zenTogglePinTab" />
6363
<command id="cmd_zenCloseUnpinnedTabs" />
64+
<command id="cmd_zenGroupTabs" />
6465
</commandset>

src/browser/themes/shared/zen-icons/icons.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@
393393
list-style-image: url('arrow-down.svg') !important;
394394
}
395395

396+
.zen-workspace-group-tabs-button {
397+
list-style-image: none !important;
398+
399+
& .toolbarbutton-icon {
400+
display: none !important;
401+
}
402+
403+
@media -moz-pref('zen.view.show-clear-tabs-button', false) {
404+
display: none;
405+
}
406+
}
407+
396408
.zen-workspace-close-unpinned-tabs-button {
397409
list-style-image: url('dart-down.svg');
398410

src/zen/common/zen-sets.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ document.addEventListener(
125125
case 'cmd_zenCloseUnpinnedTabs':
126126
gZenWorkspaces.closeAllUnpinnedTabs();
127127
break;
128+
case 'cmd_zenGroupTabs':
129+
gZenWorkspaces.groupTabsBySimilarity();
130+
break;
128131
case 'cmd_zenUnloadWorkspace': {
129132
gZenWorkspaces.unloadWorkspace();
130133
break;

src/zen/tabs/zen-tabs/vertical-tabs.css

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,3 +1357,49 @@
13571357
.tab-group-label-container[zen-dragtarget] {
13581358
z-index: 9 !important;
13591359
}
1360+
1361+
/* ==========================================================================
1362+
Tab Category Headers (for Group function)
1363+
========================================================================== */
1364+
.tabbrowser-tab[zen-category-first="true"] {
1365+
display: flex;
1366+
flex-direction: column;
1367+
}
1368+
1369+
.tabbrowser-tab[zen-category-first="true"]::before {
1370+
content: attr(zen-category);
1371+
display: block;
1372+
width: 100%;
1373+
padding: 8px var(--zen-toolbox-padding);
1374+
margin-top: 12px;
1375+
margin-bottom: 4px;
1376+
font-size: 11px;
1377+
font-weight: 600;
1378+
text-transform: uppercase;
1379+
letter-spacing: 0.5px;
1380+
color: var(--sidebar-text-color);
1381+
opacity: 0.5;
1382+
user-select: none;
1383+
pointer-events: none;
1384+
animation: zenCategoryHeaderFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
1385+
order: -1;
1386+
}
1387+
1388+
:root:not([zen-sidebar-expanded='true']) .tabbrowser-tab[zen-category-first="true"]::before {
1389+
display: none;
1390+
}
1391+
1392+
:root:not([zen-sidebar-expanded='true']) .tabbrowser-tab[zen-category-first="true"] {
1393+
display: initial;
1394+
}
1395+
1396+
@keyframes zenCategoryHeaderFadeIn {
1397+
from {
1398+
opacity: 0;
1399+
transform: translateY(-8px);
1400+
}
1401+
to {
1402+
opacity: 1;
1403+
transform: translateY(0);
1404+
}
1405+
}

0 commit comments

Comments
 (0)