1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-10 13:35:29 +02:00

Merge branch 'dev' into firefox-139

This commit is contained in:
mr. m 2025-05-22 12:10:30 +02:00 committed by GitHub
commit 22d4b22c53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 106 additions and 60 deletions

View file

@ -1,3 +1,4 @@
<!-- TODO: Get a job ->
<img src="./docs/assets/zen-dark.svg" width="100px" align="left"> <img src="./docs/assets/zen-dark.svg" width="100px" align="left">
### `Zen Browser` ### `Zen Browser`

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bffdf463489 100644 index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed3ca882e1 100644
--- a/browser/components/tabbrowser/content/tabs.js --- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js +++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
@ -136,7 +136,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
get verticalMode() { get verticalMode() {
@@ -1606,29 +1636,53 @@ @@ -1606,29 +1636,55 @@
if (this.#allTabs) { if (this.#allTabs) {
return this.#allTabs; return this.#allTabs;
} }
@ -173,19 +173,21 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
...children, ...children,
]; ];
+ const lastPinnedTabIdx = pinnedTabs.length - 1; + const lastPinnedTabIdx = pinnedTabs.length - 1;
+ for (let i = 0; i < allTabs.length; i++) { + let i = 0;
+ for (const tab of allTabs) {
+ // add glance tabs (tabs inside tabs) to the list + // add glance tabs (tabs inside tabs) to the list
+ const glanceTab = allTabs[i].glanceTab; + const glanceTab = tab.glanceTab;
+ if (glanceTab) { + if (glanceTab) {
+ // insert right after the parent tab. note: it must be inserted before + // insert right after the parent tab. note: it must be inserted before
+ // the last pinned tab so it can be inserted in the correct order + // the last pinned tab so it can be inserted in the correct order
+ allTabs.splice(Math.max(i + 1, lastPinnedTabIdx), 0, glanceTab); + allTabs.splice(Math.max(i + 1, lastPinnedTabIdx), 0, glanceTab);
+ i++; + i++;
+ } else if (allTabs[i].classList.contains("vertical-pinned-tabs-container-separator")) { + } else if (tab.classList.contains("vertical-pinned-tabs-container-separator")) {
+ // remove the separator from the list + // remove the separator from the list
+ allTabs.splice(i, 1); + allTabs.splice(i, 1);
+ i--; + i--;
+ } + }
+ i++;
+ } + }
+ this.#allTabs = allTabs; + this.#allTabs = allTabs;
return this.#allTabs; return this.#allTabs;
@ -198,7 +200,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
/** /**
@@ -1648,7 +1702,7 @@ @@ -1648,7 +1704,7 @@
*/ */
get visibleTabs() { get visibleTabs() {
if (!this.#visibleTabs) { if (!this.#visibleTabs) {
@ -207,7 +209,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
return this.#visibleTabs; return this.#visibleTabs;
} }
@@ -1683,36 +1737,40 @@ @@ -1683,36 +1739,40 @@
} }
let elementIndex = 0; let elementIndex = 0;
@ -261,7 +263,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
return this.#focusableItems; return this.#focusableItems;
} }
@@ -1720,6 +1778,7 @@ @@ -1720,6 +1780,7 @@
_invalidateCachedTabs() { _invalidateCachedTabs() {
this.#allTabs = null; this.#allTabs = null;
this._invalidateCachedVisibleTabs(); this._invalidateCachedVisibleTabs();
@ -269,7 +271,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
_invalidateCachedVisibleTabs() { _invalidateCachedVisibleTabs() {
@@ -1734,8 +1793,8 @@ @@ -1734,8 +1795,8 @@
#isContainerVerticalPinnedGrid(tab) { #isContainerVerticalPinnedGrid(tab) {
return ( return (
this.verticalMode && this.verticalMode &&
@ -280,7 +282,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
!this.expandOnHover !this.expandOnHover
); );
} }
@@ -1751,7 +1810,7 @@ @@ -1751,7 +1812,7 @@
if (node == null) { if (node == null) {
// We have a container for non-tab elements at the end of the scrollbox. // We have a container for non-tab elements at the end of the scrollbox.
@ -289,7 +291,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
node.before(tab); node.before(tab);
@@ -1846,7 +1905,7 @@ @@ -1846,7 +1907,7 @@
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and // There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs); // for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
// Attach the long click popup to all of them. // Attach the long click popup to all of them.
@ -298,7 +300,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
const newTab2 = this.newTabButton; const newTab2 = this.newTabButton;
const newTabVertical = document.getElementById( const newTabVertical = document.getElementById(
"vertical-tabs-newtab-button" "vertical-tabs-newtab-button"
@@ -1941,10 +2000,12 @@ @@ -1941,10 +2002,12 @@
_handleTabSelect(aInstant) { _handleTabSelect(aInstant) {
let selectedTab = this.selectedItem; let selectedTab = this.selectedItem;
@ -311,7 +313,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
selectedTab._notselectedsinceload = false; selectedTab._notselectedsinceload = false;
} }
@@ -2085,16 +2146,15 @@ @@ -2085,16 +2148,15 @@
// Move pinned tabs to another container when the tabstrip is toggled to vertical // Move pinned tabs to another container when the tabstrip is toggled to vertical
// and when session restore code calls _positionPinnedTabs; update styling whenever // and when session restore code calls _positionPinnedTabs; update styling whenever
// the number of pinned tabs changes. // the number of pinned tabs changes.
@ -334,7 +336,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
} }
@@ -2102,9 +2162,7 @@ @@ -2102,9 +2164,7 @@
} }
_resetVerticalPinnedTabs() { _resetVerticalPinnedTabs() {
@ -345,7 +347,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
if (!verticalTabsContainer.children.length) { if (!verticalTabsContainer.children.length) {
return; return;
@@ -2117,7 +2175,7 @@ @@ -2117,7 +2177,7 @@
} }
_positionPinnedTabs() { _positionPinnedTabs() {
@ -354,7 +356,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let numPinned = gBrowser.pinnedTabCount; let numPinned = gBrowser.pinnedTabCount;
let absPositionHorizontalTabs = let absPositionHorizontalTabs =
this.overflowing && tabs.length > numPinned && numPinned > 0; this.overflowing && tabs.length > numPinned && numPinned > 0;
@@ -2127,7 +2185,7 @@ @@ -2127,7 +2187,7 @@
if (this.verticalMode) { if (this.verticalMode) {
this._updateVerticalPinnedTabs(); this._updateVerticalPinnedTabs();
@ -363,7 +365,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let layoutData = this._pinnedTabsLayoutCache; let layoutData = this._pinnedTabsLayoutCache;
let uiDensity = document.documentElement.getAttribute("uidensity"); let uiDensity = document.documentElement.getAttribute("uidensity");
if (!layoutData || layoutData.uiDensity != uiDensity) { if (!layoutData || layoutData.uiDensity != uiDensity) {
@@ -2191,7 +2249,7 @@ @@ -2191,7 +2251,7 @@
return; return;
} }
@ -372,7 +374,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let directionX = screenX > dragData.animLastScreenX; let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY; let directionY = screenY > dragData.animLastScreenY;
@@ -2199,7 +2257,7 @@ @@ -2199,7 +2259,7 @@
dragData.animLastScreenX = screenX; dragData.animLastScreenX = screenX;
let { width: tabWidth, height: tabHeight } = let { width: tabWidth, height: tabHeight } =
@ -381,7 +383,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let shiftSizeX = tabWidth * movingTabs.length; let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight; let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth; dragData.tabWidth = tabWidth;
@@ -2262,7 +2320,7 @@ @@ -2262,7 +2322,7 @@
// * We're doing a binary search in order to reduce the amount of // * We're doing a binary search in order to reduce the amount of
// tabs we need to check. // tabs we need to check.
@ -390,7 +392,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let firstTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2; let firstTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2;
let lastTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2; let lastTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2;
let tabCenterX = directionX ? lastTabCenterX : firstTabCenterX; let tabCenterX = directionX ? lastTabCenterX : firstTabCenterX;
@@ -2374,12 +2432,16 @@ @@ -2374,12 +2434,16 @@
this.#clearDragOverCreateGroupTimer(); this.#clearDragOverCreateGroupTimer();
@ -412,7 +414,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
if (this.#rtlMode) { if (this.#rtlMode) {
tabs.reverse(); tabs.reverse();
@@ -2393,7 +2455,7 @@ @@ -2393,7 +2457,7 @@
let size = this.verticalMode ? "height" : "width"; let size = this.verticalMode ? "height" : "width";
let translateAxis = this.verticalMode ? "translateY" : "translateX"; let translateAxis = this.verticalMode ? "translateY" : "translateX";
let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft"; let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft";
@ -421,7 +423,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let translateX = event.screenX - dragData.screenX; let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY; let translateY = event.screenY - dragData.screenY;
@@ -2407,12 +2469,21 @@ @@ -2407,12 +2471,21 @@
let lastTab = tabs.at(-1); let lastTab = tabs.at(-1);
let lastMovingTab = movingTabs.at(-1); let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0]; let firstMovingTab = movingTabs[0];
@ -444,7 +446,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
translate += translate +=
this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos; this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
} else if (isPinned && this.verticalMode) { } else if (isPinned && this.verticalMode) {
@@ -2431,12 +2502,15 @@ @@ -2431,12 +2504,15 @@
// Shift the `.tab-group-label-container` to shift the label element. // Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement; item = item.parentElement;
} }
@ -461,7 +463,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
/** /**
* When the `draggedTab` is just starting to move, the `draggedTab` is in * When the `draggedTab` is just starting to move, the `draggedTab` is in
@@ -2568,6 +2642,9 @@ @@ -2568,6 +2644,9 @@
break; break;
} }
let element = tabs[mid]; let element = tabs[mid];
@ -471,7 +473,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
let elementForSize = isTabGroupLabel(element) let elementForSize = isTabGroupLabel(element)
? element.parentElement ? element.parentElement
: element; : element;
@@ -2588,7 +2665,11 @@ @@ -2588,7 +2667,11 @@
let dropElement = getOverlappedElement(); let dropElement = getOverlappedElement();
if (!dropElement) { if (!dropElement) {
@ -484,7 +486,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
let newDropElementIndex = dropElement let newDropElementIndex = dropElement
? dropElement.elementIndex ? dropElement.elementIndex
@@ -2598,7 +2679,7 @@ @@ -2598,7 +2681,7 @@
let shouldCreateGroupOnDrop; let shouldCreateGroupOnDrop;
let dropBefore; let dropBefore;
if (dropElement) { if (dropElement) {
@ -493,7 +495,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
? dropElement.parentElement ? dropElement.parentElement
: dropElement; : dropElement;
@@ -2660,12 +2741,12 @@ @@ -2660,12 +2743,12 @@
} }
} }
@ -508,7 +510,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
dropElement != draggedTab && dropElement != draggedTab &&
isTab(dropElement) && isTab(dropElement) &&
!dropElement?.group && !dropElement?.group &&
@@ -2735,7 +2816,7 @@ @@ -2735,7 +2818,7 @@
// Shift background tabs to leave a gap where the dragged tab // Shift background tabs to leave a gap where the dragged tab
// would currently be dropped. // would currently be dropped.
for (let item of tabs) { for (let item of tabs) {
@ -517,7 +519,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
continue; continue;
} }
@@ -2744,6 +2825,9 @@ @@ -2744,6 +2827,9 @@
if (isTabGroupLabel(item)) { if (isTabGroupLabel(item)) {
// Shift the `.tab-group-label-container` to shift the label element. // Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement; item = item.parentElement;
@ -527,7 +529,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
} }
item.style.transform = transform; item.style.transform = transform;
} }
@@ -2796,8 +2880,9 @@ @@ -2796,8 +2882,9 @@
); );
} }
@ -539,7 +541,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
return; return;
} }
@@ -2809,6 +2894,12 @@ @@ -2809,6 +2896,12 @@
item = item.parentElement; item = item.parentElement;
} }
item.style.transform = ""; item.style.transform = "";
@ -552,7 +554,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
item.removeAttribute("dragover-createGroup"); item.removeAttribute("dragover-createGroup");
} }
this.removeAttribute("movingtab-createGroup"); this.removeAttribute("movingtab-createGroup");
@@ -2855,7 +2946,7 @@ @@ -2855,7 +2948,7 @@
let postTransitionCleanup = () => { let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false; movingTab._moveTogetherSelectedTabsData.animate = false;
}; };
@ -561,7 +563,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
postTransitionCleanup(); postTransitionCleanup();
} else { } else {
let onTransitionEnd = transitionendEvent => { let onTransitionEnd = transitionendEvent => {
@@ -3028,7 +3119,7 @@ @@ -3028,7 +3121,7 @@
} }
_notifyBackgroundTab(aTab) { _notifyBackgroundTab(aTab) {
@ -570,7 +572,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..e8d5dc64609522b440fb01990fb19bff
return; return;
} }
@@ -3154,6 +3245,9 @@ @@ -3154,6 +3247,9 @@
return null; return null;
} }
} }

View file

@ -1,5 +1,5 @@
diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js
index 6775a7635c6cdbb276b3a912d0bba07840acb28f..4ef3eb6a7dbd741cf432668c2ff6e832f5bb97e7 100644 index 6775a7635c6cdbb276b3a912d0bba07840acb28f..861640d12c6118e11acb3f51723a79098dbbba10 100644
--- a/toolkit/content/widgets/tabbox.js --- a/toolkit/content/widgets/tabbox.js
+++ b/toolkit/content/widgets/tabbox.js +++ b/toolkit/content/widgets/tabbox.js
@@ -213,7 +213,7 @@ @@ -213,7 +213,7 @@
@ -7,7 +7,7 @@ index 6775a7635c6cdbb276b3a912d0bba07840acb28f..4ef3eb6a7dbd741cf432668c2ff6e832
this._inAsyncOperation = false; this._inAsyncOperation = false;
if (oldPanel != this._selectedPanel) { if (oldPanel != this._selectedPanel) {
- oldPanel?.classList.remove("deck-selected"); - oldPanel?.classList.remove("deck-selected");
+ if (!oldPanel?.classList.contains("zen-glance-background")) oldPanel?.classList.remove("deck-selected"); + if (!(window.gZenGlanceManager && gZenGlanceManager.shouldShowDeckSelected(this._selectedPanel, oldPanel))) oldPanel?.classList.remove("deck-selected");
this._selectedPanel?.classList.add("deck-selected"); this._selectedPanel?.classList.add("deck-selected");
} }
this.setAttribute("selectedIndex", val); this.setAttribute("selectedIndex", val);

View file

@ -35,7 +35,7 @@
// Fix notification deck // Fix notification deck
const deckTemplate = document.getElementById('tab-notification-deck-template'); const deckTemplate = document.getElementById('tab-notification-deck-template');
if (deckTemplate) { if (deckTemplate) {
document.getElementById('zen-appcontent-navbar-container').appendChild(deckTemplate); document.getElementById('zen-appcontent-wrapper').prepend(deckTemplate);
} }
this._hideUnusedElements(); this._hideUnusedElements();

View file

@ -10,13 +10,15 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
:root:not([zen-no-padding='true']) & { &.browserSidebarContainer {
border-radius: var(--zen-native-inner-radius); :root:not([zen-no-padding='true']) & {
box-shadow: var(--zen-big-shadow); border-radius: var(--zen-native-inner-radius);
} box-shadow: var(--zen-big-shadow);
}
& browser[transparent='true'] { & browser[transparent='true'] {
background: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.1);
}
} }
} }

View file

@ -720,6 +720,27 @@
} }
return tab; return tab;
} }
shouldShowDeckSelected(currentPanel, oldPanel) {
// Dont remove if it's a glance background and current panel corresponds to a glance
const currentBrowser = currentPanel?.querySelector('browser');
const oldBrowser = oldPanel?.querySelector('browser');
if (!currentBrowser || !oldBrowser) {
return false;
}
const currentTab = gBrowser.getTabForBrowser(currentBrowser);
const oldTab = gBrowser.getTabForBrowser(oldBrowser);
if (currentTab && oldTab) {
const currentGlanceID = currentTab.getAttribute('glance-id');
const oldGlanceID = oldTab.getAttribute('glance-id');
if (currentGlanceID && oldGlanceID) {
return (
currentGlanceID === oldGlanceID && oldPanel.classList.contains('zen-glance-background')
);
}
}
return false;
}
} }
window.gZenGlanceManager = new ZenGlanceManager(); window.gZenGlanceManager = new ZenGlanceManager();

View file

@ -335,6 +335,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
]); ]);
if (this._finishAllAnimatingPromise) { if (this._finishAllAnimatingPromise) {
this._finishAllAnimatingPromise.then(() => { this._finishAllAnimatingPromise.then(() => {
draggedTab.linkedBrowser.docShellIsActive = false;
draggedTab.linkedBrowser
.closest('.browserSidebarContainer')
.classList.remove('deck-selected');
this.fakeBrowser.addEventListener('dragleave', this.onBrowserDragEndToSplit); this.fakeBrowser.addEventListener('dragleave', this.onBrowserDragEndToSplit);
this._canDrop = true; this._canDrop = true;
draggedTab._visuallySelected = true; draggedTab._visuallySelected = true;
@ -1630,7 +1634,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
: containerRect.left - padding - 5, : containerRect.left - padding - 5,
event.clientY event.clientY
); );
const browser = dropTarget?.closest('browser'); const browser =
dropTarget?.closest('browser') ??
dropTarget?.closest('.browserSidebarContainer')?.querySelector('browser');
if (!browser) { if (!browser) {
this._maybeRemoveFakeBrowser(false); this._maybeRemoveFakeBrowser(false);
@ -1644,7 +1650,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
browserContainer.style.opacity = '0'; browserContainer.style.opacity = '0';
} }
const droppedOnTab = gBrowser.getTabForBrowser(browser); const droppedOnTab = gZenGlanceManager.getTabOrGlanceParent(gBrowser.getTabForBrowser(browser));
if (droppedOnTab && droppedOnTab !== draggedTab) { if (droppedOnTab && droppedOnTab !== draggedTab) {
// Calculate which side of the target browser the drop occurred // Calculate which side of the target browser the drop occurred
// const browserRect = browser.getBoundingClientRect(); // const browserRect = browser.getBoundingClientRect();

View file

@ -423,6 +423,15 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
essentialsContainer.setAttribute('flex', '1'); essentialsContainer.setAttribute('flex', '1');
essentialsContainer.setAttribute('container', container); essentialsContainer.setAttribute('container', container);
document.getElementById('zen-essentials').appendChild(essentialsContainer); document.getElementById('zen-essentials').appendChild(essentialsContainer);
// Set an initial hidden state if the essentials section is not supposed
// to be shown on the current workspace
if (
this.containerSpecificEssentials &&
this.getActiveWorkspaceFromCache()?.containerTabId != container
) {
essentialsContainer.setAttribute('hidden', 'true');
}
} }
return essentialsContainer; return essentialsContainer;
} }
@ -2098,7 +2107,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
} }
} }
document.documentElement.setAttribute('animating-background', 'true'); document.documentElement.setAttribute('animating-background', 'true');
if (shouldAnimate) { if (shouldAnimate && previousWorkspace) {
let previousBackgroundOpacity = document.documentElement.style.getPropertyValue( let previousBackgroundOpacity = document.documentElement.style.getPropertyValue(
'--zen-background-opacity' '--zen-background-opacity'
); );
@ -2114,19 +2123,24 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
previousBackgroundOpacity = 0; previousBackgroundOpacity = 0;
} }
gZenThemePicker.previousBackgroundOpacity = previousBackgroundOpacity; gZenThemePicker.previousBackgroundOpacity = previousBackgroundOpacity;
animations.push( await new Promise((resolve) => {
gZenUIManager.motion.animate( requestAnimationFrame(() => {
document.documentElement, animations.push(
{ gZenUIManager.motion.animate(
'--zen-background-opacity': [previousBackgroundOpacity, 1], document.documentElement,
}, {
{ '--zen-background-opacity': [previousBackgroundOpacity, 1],
type: 'spring', },
bounce: 0, {
duration: kGlobalAnimationDuration, type: 'spring',
} bounce: 0,
) duration: kGlobalAnimationDuration,
); }
)
);
resolve();
});
});
} }
for (const element of document.querySelectorAll('zen-workspace')) { for (const element of document.querySelectorAll('zen-workspace')) {
if (element.classList.contains('zen-essentials-container')) { if (element.classList.contains('zen-essentials-container')) {

View file

@ -19,7 +19,7 @@
"brandShortName": "Zen", "brandShortName": "Zen",
"brandFullName": "Zen Browser", "brandFullName": "Zen Browser",
"release": { "release": {
"displayVersion": "1.12.7b", "displayVersion": "1.12.8b",
"github": { "github": {
"repo": "zen-browser/desktop" "repo": "zen-browser/desktop"
}, },