diff --git a/l10n b/l10n index 70534bcec..102a19cde 160000 --- a/l10n +++ b/l10n @@ -1 +1 @@ -Subproject commit 70534bcec754b1cd108f275708cfba4427d0b7d4 +Subproject commit 102a19cdee3cee5e6f963902f1546e61a0283954 diff --git a/src/browser/app/profile/features.inc b/src/browser/app/profile/features.inc index cf2efc883..7835d02b6 100644 --- a/src/browser/app/profile/features.inc +++ b/src/browser/app/profile/features.inc @@ -28,7 +28,11 @@ pref('zen.injections.match-urls', 'http://localhost/*', locked); #endif pref('zen.rice.share.notice.accepted', false); +#ifdef XP_MACOSX +pref('zen.theme.border-radius', 10); // In pixels +#else pref('zen.theme.border-radius', 8); // In pixels +#endif pref('zen.theme.color-prefs.use-workspace-colors', true); diff --git a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch index 1e49c4903..ebc9b26d2 100644 --- a/src/browser/components/sessionstore/SessionStore-sys-mjs.patch +++ b/src/browser/components/sessionstore/SessionStore-sys-mjs.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs -index 5633e5032f5d50c70512187d27e045b579978927..724fe7ec3bb6058c006f25b1d9ee0ce10f7b2e36 100644 +index 5633e5032f5d50c70512187d27e045b579978927..6b9e56cb62a4812925ff812763ea9b0e6a478202 100644 --- a/browser/components/sessionstore/SessionStore.sys.mjs +++ b/browser/components/sessionstore/SessionStore.sys.mjs @@ -2081,7 +2081,6 @@ var SessionStoreInternal = { @@ -41,6 +41,15 @@ index 5633e5032f5d50c70512187d27e045b579978927..724fe7ec3bb6058c006f25b1d9ee0ce1 if (inBackground === false) { aWindow.gBrowser.selectedTab = newTab; +@@ -5225,7 +5225,7 @@ var SessionStoreInternal = { + } + + let workspaceID = aWindow.getWorkspaceID(); +- if (workspaceID) { ++ if (workspaceID && !(this.isLastRestorableWindow() && AppConstants.platform == "macosx")) { + winData.workspaceID = workspaceID; + } + }, @@ -5416,14 +5416,15 @@ var SessionStoreInternal = { } diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index f7120a121..71e6f350c 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -382,6 +382,12 @@ var gZenUIManager = { // Section: Notification messages _createToastElement(messageId, options) { + // Check if this message ID already exists + for (const child of this._toastContainer.children) { + if (child._messageId === messageId) { + return [child, true]; + } + } const element = document.createXULElement('vbox'); const label = document.createXULElement('label'); document.l10n.setAttributes(label, messageId, options); @@ -393,23 +399,34 @@ var gZenUIManager = { element.appendChild(description); } element.classList.add('zen-toast'); - return element; + element._messageId = messageId; + return [element, false]; }, async showToast(messageId, options = {}) { - const toast = this._createToastElement(messageId, options); + const [toast, reused] = this._createToastElement(messageId, options); this._toastContainer.removeAttribute('hidden'); this._toastContainer.appendChild(toast); - await this.motion.animate(toast, { opacity: [0, 1], scale: [0.8, 1] }, { type: 'spring', bounce: 0.5, duration: 0.7 }); - await new Promise((resolve) => setTimeout(resolve, 3000)); - await this.motion.animate(toast, { opacity: [1, 0], scale: [1, 0.9] }, { duration: 0.2, bounce: 0 }); - const toastHeight = toast.getBoundingClientRect().height; - // 5 for the separation between toasts - await this.motion.animate(toast, { marginBottom: [0, `-${toastHeight + 5}px`] }, { duration: 0.2 }); - toast.remove(); - if (!this._toastContainer.hasChildNodes()) { - this._toastContainer.setAttribute('hidden', 'true'); + if (reused) { + await this.motion.animate(toast, { scale: 0.2 }, { duration: 0.1, bounce: 0 }); + toast._useCount++; + } else { + toast._useCount = 1; } + if (!toast.style.hasOwnProperty('transform')) { + toast.style.transform = 'scale(0)'; + } + await this.motion.animate(toast, { scale: 1 }, { type: 'spring', bounce: 0.2, duration: 0.5 }); + await new Promise((resolve) => setTimeout(resolve, 3000)); + if (toast._useCount <= 1) { + await this.motion.animate(toast, { opacity: [1, 0], scale: [1, 0.5] }, { duration: 0.2, bounce: 0 }); + toast.remove(); + if (!this._toastContainer.hasChildNodes()) { + this._toastContainer.setAttribute('hidden', 'true'); + } + return; + } + toast._useCount--; }, get panelUIPosition() { diff --git a/src/zen/common/styles/zen-popup.css b/src/zen/common/styles/zen-popup.css index e91498b9b..e5ea9309c 100644 --- a/src/zen/common/styles/zen-popup.css +++ b/src/zen/common/styles/zen-popup.css @@ -338,7 +338,6 @@ menuitem { position: fixed; top: calc(var(--zen-element-separation) * 2); z-index: 1000; - gap: 1rem; display: flex; align-items: end; @@ -351,7 +350,7 @@ menuitem { } & .zen-toast { - padding: 0.5rem 0.6rem; + padding: 10px; border-radius: 12px; background: linear-gradient( 170deg, @@ -362,14 +361,16 @@ menuitem { box-shadow: 0 0 14px 3px rgba(0, 0, 0, 0.05); border: 1px solid rgba(0, 0, 0, 0.1); display: flex; - font-weight: 500; - gap: 5px; + font-weight: 600; flex-direction: column; - gap: 2px; - width: fit-content; + width: max-content; + font-size: medium; + position: absolute; + transform-origin: top center; & .description { opacity: 0.6; + font-size: small; } } } diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index b69d1a362..c5bf01fca 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -48,6 +48,7 @@ var gZenCompactModeManager = { // Clear hover states when window state changes (minimize, maximize, etc.) window.addEventListener('sizemodechange', () => this._clearAllHoverStates()); + window.addEventListener('TabOpen', this._onTabOpen.bind(this)); if (AppConstants.platform == 'macosx') { window.addEventListener('mouseover', (event) => { @@ -194,11 +195,7 @@ var gZenCompactModeManager = { const isCompactMode = this.preference; const canHideSidebar = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar') || gZenVerticalTabsManager._hasSetSingleToolbar; - let canAnimate = - lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && - !this.sidebar.hasAttribute('zen-user-show') && - !this.sidebar.hasAttribute('zen-has-empty-tab') && - !this.sidebar.hasAttribute('zen-has-hover'); + let canAnimate = lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && !this.isSidebarPotentiallyOpen(); if (typeof this._wasInCompactMode !== 'undefined') { canAnimate = false; delete this._wasInCompactMode; @@ -552,6 +549,21 @@ var gZenCompactModeManager = { } } }, + + isSidebarPotentiallyOpen() { + return ( + this.sidebar.hasAttribute('zen-user-show') || + this.sidebar.hasAttribute('zen-has-hover') || + this.sidebar.hasAttribute('zen-has-empty-tab') + ); + }, + + _onTabOpen(event) { + const tab = event.target; + if (!tab.selected && this.preference && !this.isSidebarPotentiallyOpen()) { + gZenUIManager.showToast('zen-background-tab-opened'); + } + }, }; document.addEventListener(