Skip to content

Commit 62fb85d

Browse files
committed
chore: Updated to firefox 141.0.3, b=no-bug, c=tabs, folders
1 parent d51d698 commit 62fb85d

File tree

7 files changed

+87
-56
lines changed

7 files changed

+87
-56
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
3030
### Firefox Versions
3131

3232
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `141.0.2`! 🚀
33-
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 141.0.2`!
33+
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 141.0.3`!
3434

3535
### Contributing
3636

src/browser/components/tabbrowser/content/tabs-js.patch

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
2-
index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..9022f3f566e8829fa8d3c5a58f0300ab96869073 100644
2+
index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..49cb1c803b3b4384d948103f6352058e543081de 100644
33
--- a/browser/components/tabbrowser/content/tabs.js
44
+++ b/browser/components/tabbrowser/content/tabs.js
55
@@ -289,6 +289,7 @@
@@ -548,7 +548,12 @@ index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..9022f3f566e8829fa8d3c5a58f0300ab
548548
}
549549
this.#setDragOverGroupColor(colorCode);
550550
this.toggleAttribute("movingtab-ungroup", !colorCode);
551-
@@ -2769,15 +2817,24 @@
551+
@@ -2765,19 +2813,28 @@
552+
dragData.dropElement = dropElement;
553+
dragData.dropBefore = dropBefore;
554+
dragData.animDropElementIndex = newDropElementIndex;
555+
-
556+
+ gZenFolders.setFolderIndentation(draggedTab, dropElement);
552557
// Shift background tabs to leave a gap where the dragged tab
553558
// would currently be dropped.
554559
for (let item of tabs) {

src/zen/folders/ZenFolders.mjs

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@
318318
if (selectedItem) {
319319
group.setAttribute('has-active', 'true');
320320
selectedItem.setAttribute('folder-active', 'true');
321+
this.setFolderIndentation(selectedItem, group, false);
321322
}
322323

323324
for (const item of itemsAfterSelected) {
@@ -380,6 +381,21 @@
380381
item = item.parentNode;
381382
}
382383
}
384+
// If all the groups above the item are visible, remove the indentation
385+
if (gBrowser.isTab(item)) {
386+
let isVisible = true;
387+
let parent = item.group;
388+
while (parent) {
389+
if (parent.collapsed && !parent.hasAttribute('has-active')) {
390+
isVisible = false;
391+
break;
392+
}
393+
parent = parent.group;
394+
}
395+
if (isVisible) {
396+
item.style.removeProperty('--zen-folder-indent');
397+
}
398+
}
383399
groupItems.push(item);
384400
});
385401

@@ -858,14 +874,23 @@
858874
return [];
859875
}
860876

861-
getFolderIndentation(tab, group = undefined) {
862-
const level = group?.level || 0;
863-
const baseSpacing = 4; // Base spacing for each level
877+
setFolderIndentation(tab, group = undefined, dropBefore = false) {
878+
if (!gZenPinnedTabManager.expandedSidebarMode) {
879+
return;
880+
}
881+
let isTab = false;
882+
if (!group && tab?.group) {
883+
group = tab; // So we can set isTab later
884+
}
885+
if (gBrowser.isTab(group)) {
886+
group = group.group;
887+
isTab = true;
888+
}
889+
const level = group?.level + 1 - (dropBefore && !isTab ? 1 : 0) || 0;
890+
const baseSpacing = 14; // Base spacing for each level
864891
const tabLevel = tab?.group?.level || 0;
865-
// If the level is less, we need to make a negative margin
866-
const spacing =
867-
level > tabLevel ? -baseSpacing * (level - tabLevel) : baseSpacing * (tabLevel - level);
868-
return spacing;
892+
const spacing = (level - tabLevel) * baseSpacing;
893+
tab.style.setProperty('--zen-folder-indent', `${spacing}px`);
869894
}
870895

871896
changeFolderUserIcon(group) {

src/zen/folders/zen-folders.css

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,6 @@ tab-group[split-view-group] .tab-group-line {
166166
display: none !important;
167167
}
168168

169-
#tabbrowser-tabs[orient='vertical'][expanded] {
170-
tab-group > :is(.tab-group-label-container, .tabbrowser-tab),
171-
&[movingtab][movingtab-addToGroup]:not([movingtab-createGroup], [movingtab-ungroup])
172-
.tabbrowser-tab:is(:active, [multiselected]) {
173-
margin-inline-start: 0;
174-
}
175-
}
176-
177169
zen-folder {
178170
display: flex;
179171
flex-direction: column;
@@ -191,6 +183,7 @@ zen-folder {
191183
);
192184

193185
-moz-window-dragging: no-drag;
186+
transition: margin-inline-start 0.15s ease-in-out;
194187

195188
&[selected] > .tab-group-label-container::before {
196189
background-color: color-mix(in srgb, var(--zen-colors-border) 60%, transparent);
@@ -215,7 +208,8 @@ zen-folder {
215208

216209
& > .tab-group-container {
217210
:root[zen-sidebar-expanded] & > * {
218-
margin-inline-start: var(--zen-folder-indent, 14px) !important;
211+
--zen-folder-indent: 14px; /* Can get overriden by the JS */
212+
margin-inline-start: var(--zen-folder-indent) !important;
219213
}
220214

221215
& > zen-folder {
@@ -227,10 +221,6 @@ zen-folder {
227221
}
228222
}
229223

230-
&[collapsed][has-active='true'] > .tab-group-container zen-folder {
231-
margin-inline-start: 0 !important;
232-
}
233-
234224
margin: 0 var(--tab-block-margin);
235225
margin-inline-end: 0;
236226

@@ -296,6 +286,7 @@ zen-folder {
296286
& > label,
297287
& > #tab-label-input {
298288
padding: 0 0 0 30px !important;
289+
width: 100%;
299290
}
300291

301292
& > label {

src/zen/tabs/ZenPinnedTabManager.mjs

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -998,33 +998,27 @@
998998
let hasActuallyMoved;
999999
for (const draggedTab of movingTabs) {
10001000
let isRegularTabs = false;
1001+
// Check for essentials container
1002+
if (essentialTabsTarget) {
1003+
if (!draggedTab.hasAttribute('zen-essential') && !draggedTab?.group) {
1004+
moved = true;
1005+
isVertical = false;
1006+
hasActuallyMoved = this.addToEssentials(draggedTab);
1007+
}
1008+
}
10011009
// Check for pinned tabs container
1002-
if (pinnedTabsTarget) {
1010+
else if (pinnedTabsTarget) {
10031011
if (!draggedTab.pinned) {
10041012
gBrowser.pinTab(draggedTab);
1005-
moved = true;
10061013
} else if (draggedTab.hasAttribute('zen-essential')) {
10071014
this.removeEssentials(draggedTab, false);
10081015
moved = true;
10091016
}
10101017
}
1011-
// Check for essentials container
1012-
else if (essentialTabsTarget) {
1013-
if (!draggedTab.hasAttribute('zen-essential') && !draggedTab?.group) {
1014-
moved = true;
1015-
isVertical = false;
1016-
hasActuallyMoved = this.addToEssentials(draggedTab);
1017-
}
1018-
}
10191018
// Check for normal tabs container
10201019
else if (tabsTarget || event.target.id === 'zen-tabs-wrapper') {
1021-
if (
1022-
draggedTab.pinned &&
1023-
!draggedTab.hasAttribute('zen-essential') &&
1024-
!draggedTab?.group?.isZenFolder
1025-
) {
1020+
if (draggedTab.pinned && !draggedTab.hasAttribute('zen-essential')) {
10261021
gBrowser.unpinTab(draggedTab);
1027-
moved = true;
10281022
isRegularTabs = true;
10291023
} else if (draggedTab.hasAttribute('zen-essential')) {
10301024
this.removeEssentials(draggedTab);
@@ -1139,6 +1133,23 @@
11391133
for (const item of this.dragShiftableItems) {
11401134
item.style.transform = '';
11411135
}
1136+
for (const item of gBrowser.tabContainer.ariaFocusableItems) {
1137+
if (gBrowser.isTab(item)) {
1138+
let isVisible = true;
1139+
let parent = item.group;
1140+
while (parent) {
1141+
if (parent.collapsed && !parent.hasAttribute('has-active')) {
1142+
isVisible = false;
1143+
break;
1144+
}
1145+
parent = parent.group;
1146+
}
1147+
if (!isVisible) {
1148+
continue;
1149+
}
1150+
}
1151+
item.style.removeProperty('--zen-folder-indent');
1152+
}
11421153
this.removeTabContainersDragoverClass();
11431154
}
11441155

@@ -1157,11 +1168,11 @@
11571168
draggedTab = draggedTab.group;
11581169
}
11591170
const itemsToCheck = this.dragShiftableItems;
1160-
const separator = itemsToCheck[0];
1161-
const separatorRect = window.windowUtils.getBoundsWithoutFlushing(separator);
1171+
const separatorHeight = window.windowUtils.getBoundsWithoutFlushing(itemsToCheck[0]).height;
11621172
const tabRect = window.windowUtils.getBoundsWithoutFlushing(draggedTab);
1163-
const translate = tabRect.top - tabRect.height / 2 + separatorRect.height / 2;
1164-
const topToNormalTabs = separatorRect.top - separatorRect.height / 2;
1173+
const translate = tabRect.top - tabRect.height / 2;
1174+
const topToNormalTabs =
1175+
window.windowUtils.getBoundsWithoutFlushing(itemsToCheck[0]).top - separatorHeight / 2;
11651176
const isGoingToPinnedTabs = translate < topToNormalTabs;
11661177
const multiplier = isGoingToPinnedTabs !== isPinned ? (isGoingToPinnedTabs ? 1 : -1) : 0;
11671178
const draggingTabHeight =
@@ -1253,12 +1264,7 @@
12531264
if (!this.enabled) {
12541265
return;
12551266
}
1256-
const folderTarget = event.target.closest('zen-folder');
12571267
let isVertical = this.expandedSidebarMode;
1258-
//if (isVertical) {
1259-
// draggedTab.style.marginInlineStart = `${gZenFolders.getFolderIndentation(draggedTab, folderTarget)}px`;
1260-
//}
1261-
12621268
if (
12631269
gBrowser.isTabGroupLabel(draggedTab) &&
12641270
!draggedTab?.group?.hasAttribute('split-view-group')
@@ -1270,6 +1276,7 @@
12701276
const pinnedTabsTarget = event.target.closest('.zen-workspace-pinned-tabs-section');
12711277
const essentialTabsTarget = event.target.closest('.zen-essentials-container');
12721278
const tabsTarget = event.target.closest('.zen-workspace-normal-tabs-section');
1279+
const folderTarget = event.target.closest('zen-folder');
12731280
let targetTab = event.target.closest('.tabbrowser-tab');
12741281
targetTab = targetTab?.group || targetTab;
12751282
draggedTab = draggedTab?.group?.hasAttribute('split-view-group')
@@ -1290,15 +1297,15 @@
12901297
let shouldAddDragOverElement = false;
12911298

12921299
// Decide whether we should show a dragover class for the given target
1293-
if (pinnedTabsTarget) {
1294-
if (draggedTab.hasAttribute('zen-essential')) {
1295-
shouldAddDragOverElement = true;
1296-
}
1297-
} else if (essentialTabsTarget) {
1300+
if (essentialTabsTarget) {
12981301
if (!draggedTab.hasAttribute('zen-essential') && this.canEssentialBeAdded(draggedTab)) {
12991302
shouldAddDragOverElement = true;
13001303
isVertical = false;
13011304
}
1305+
} else if (pinnedTabsTarget) {
1306+
if (draggedTab.hasAttribute('zen-essential')) {
1307+
shouldAddDragOverElement = true;
1308+
}
13021309
} else if (tabsTarget) {
13031310
if (draggedTab.hasAttribute('zen-essential')) {
13041311
shouldAddDragOverElement = true;

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,15 @@
297297
Individual Tab Styles (.tabbrowser-tab within #tabbrowser-tabs)
298298
======================================================================== */
299299
& .tabbrowser-tab {
300-
/* Add smooth scaling transition */
301300
&,
302301
& .tab-content > image {
303-
transition: scale 0.07s ease;
302+
transition:
303+
scale 0.07s ease,
304+
margin-inline-start 0.15s ease-in-out;
304305
}
305306

307+
margin-inline-start: var(--zen-folder-indent) !important;
308+
306309
/* Hide specific empty tabs (likely placeholders) */
307310
&[zen-empty-tab] {
308311
display: none;

surfer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version": {
77
"product": "firefox",
88
"version": "141.0.2",
9-
"candidate": "141.0.2"
9+
"candidate": "141.0.3"
1010
},
1111
"buildOptions": {
1212
"generateBranding": true

0 commit comments

Comments
 (0)