diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index b9a146293..8a9314ca5 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -463,31 +463,27 @@ window.gZenCompactModeManager = { this.sidebar.removeAttribute("animate"); document.documentElement.removeAttribute("zen-compact-animating"); - setTimeout(() => { - this.getAndApplySidebarWidth({}); - this._ignoreNextResize = true; - + if (this._ignoreNextHover) { setTimeout(() => { - if (this._ignoreNextHover) { - setTimeout(() => { - delete this._ignoreNextHover; - }); - } - - this.sidebar.style.removeProperty("margin-right"); - this.sidebar.style.removeProperty("margin-left"); - this.sidebar.style.removeProperty("transition"); - this.sidebar.style.removeProperty("transform"); - this.sidebar.style.removeProperty("point-events"); - - titlebar.style.removeProperty("visibility"); - titlebar.style.removeProperty("transition"); - - gURLBar.style.removeProperty("visibility"); - - resolve(); + delete this._ignoreNextHover; }); - }); + } + + this.getAndApplySidebarWidth({}); + this._ignoreNextResize = true; + + this.sidebar.style.removeProperty("margin-right"); + this.sidebar.style.removeProperty("margin-left"); + this.sidebar.style.removeProperty("transition"); + this.sidebar.style.removeProperty("transform"); + this.sidebar.style.removeProperty("point-events"); + + titlebar.style.removeProperty("visibility"); + titlebar.style.removeProperty("transition"); + + gURLBar.style.removeProperty("visibility"); + + resolve(); }); } else if (canHideSidebar && !isCompactMode) { // Shouldn't be ever true, but just in case diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 3e21b9261..c09a1a2ac 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -978,18 +978,14 @@ let draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0); let dragData = draggedTab._dragData; let movingTabs = dragData.movingTabs; - if (!gZenPinnedTabManager.canEssentialBeAdded(draggedTab)) { + if ( + !gZenPinnedTabManager.canEssentialBeAdded(draggedTab) && + !draggedTab.hasAttribute("zen-essential") + ) { return; } let essentialsPromoStatus = this.createZenEssentialsPromo(); this.clearDragOverVisuals(); - if ( - !draggedTab.hasAttribute("zen-essential") && - gBrowser._numZenEssentials >= gZenPinnedTabManager.maxEssentialTabs - ) { - return; - } - let essentialsPromoStatus = this.createZenEssentialsPromo(draggedTab?.userContextId); switch (essentialsPromoStatus) { case "shown": case "created": diff --git a/src/zen/kbs/ZenKeyboardShortcuts.mjs b/src/zen/kbs/ZenKeyboardShortcuts.mjs index a2765f114..40d90baae 100644 --- a/src/zen/kbs/ZenKeyboardShortcuts.mjs +++ b/src/zen/kbs/ZenKeyboardShortcuts.mjs @@ -1060,7 +1060,7 @@ class nsZenKeyboardShortcutsVersioner { data.push( new KeyShortcut( "zen-new-empty-split-view", - AppConstants.platform == "macosx" ? "+" : "*", + "*", "", ZEN_SPLIT_VIEW_SHORTCUTS_GROUP, nsKeyShortcutModifiers.fromObject({ accel: true, shift: true }), @@ -1102,7 +1102,7 @@ class nsZenKeyboardShortcutsVersioner { ); } - if (version < 14) { + if (version < 15) { // Migrate from version 13 to 14 // Add shortcut to open a new unsynced window: Default accelt+option+N (Ctrl+Alt+N on non-macOS) data.push( @@ -1116,6 +1116,15 @@ class nsZenKeyboardShortcutsVersioner { "zen-new-unsynced-window-shortcut" ) ); + // Also, change the default for new empty split from + to * on mac + for (let shortcut of data) { + if (shortcut.getID() == "zen-new-empty-split-view" && AppConstants.platform == "macosx") { + if (shortcut.getKeyName() == "+") { + shortcut.setNewBinding("*"); + } + break; + } + } } return data; diff --git a/src/zen/split-view/ZenViewSplitter.mjs b/src/zen/split-view/ZenViewSplitter.mjs index 0eb28f7b7..ac23352ad 100644 --- a/src/zen/split-view/ZenViewSplitter.mjs +++ b/src/zen/split-view/ZenViewSplitter.mjs @@ -2023,15 +2023,24 @@ class nsZenViewSplitter extends nsZenDOMOperatedFeature { return; } this._sessionRestoring = true; + let groups = []; // We can just get the tab group with document.getElementById(group.groupId) // and add the tabs to it for (const group of data) { const groupElement = document.getElementById(group.groupId); if (groupElement) { const tabs = groupElement.tabs; + groups.push(groupElement); this.splitTabs(tabs, group.gridType); } } + // See https://github.com/zen-browser/desktop/issues/11887, some groups + // may end up empty after restoring, so we need to remove them + for (const groupElement of groups) { + if (groupElement.tabs.length === 0) { + groupElement.remove(); + } + } delete this._sessionRestoring; } diff --git a/src/zen/tabs/zen-essentials-promo.css b/src/zen/tabs/zen-essentials-promo.css index a5bd9449b..48b5c4bb1 100644 --- a/src/zen/tabs/zen-essentials-promo.css +++ b/src/zen/tabs/zen-essentials-promo.css @@ -15,6 +15,9 @@ zen-essentials-promo { margin: 2px; text-align: center; box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.1); + transition: + background 0.1s, + outline 0.1s; &:not([dragover="true"]) { background: color-mix(in srgb, var(--zen-primary-color) 60%, transparent); diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index c2f79c455..d6f4ba1b1 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -1097,7 +1097,7 @@ } #zen-essentials { - z-index: 1; + z-index: 2; } .zen-essentials-container {