From 23ceaf77213680460d0b4cc3bf95ed9a855e7e31 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Wed, 11 Mar 2026 00:57:38 +0100 Subject: [PATCH] feat: Make sure to add checks for invalid essential items, b=no-bug, c=workspaces --- src/zen/drag-and-drop/ZenDragAndDrop.js | 4 ++++ src/zen/workspaces/ZenWorkspaces.mjs | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 7534706b9..fbe896e32 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -1229,6 +1229,10 @@ let showIndicatorUnderNewTabButton = false; let dropBefore = false; let dropElementFromEvent = event.target.closest(dropZoneSelector); + if (!dropElement && dropElementFromEvent?.isZenFolder) { + // If we're dragging over a folder, we want to show the indicator on the folder itself, not the label. + dropElementFromEvent = dropElementFromEvent.labelElement; + } dropElement = dropElementFromEvent || dropElement; if (!dropElementFromEvent) { let hoveringPeriphery = !!event.target.closest( diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index fbe5a4e9e..d66024bec 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -2072,14 +2072,10 @@ class nsZenWorkspaces { const essentialsContainer = this.getEssentialsSection( workspace.containerTabId ); - if ( - clonedEssentials[clonedEssentials.length - 1]?.contextId == - workspace.containerTabId - ) { - clonedEssentials[clonedEssentials.length - 1].repeat++; - clonedEssentials[clonedEssentials.length - 1].workspaces.push( - workspace - ); + let lastCloned = clonedEssentials[clonedEssentials.length - 1]; + if (lastCloned && lastCloned.contextId == workspace.containerTabId) { + lastCloned.repeat++; + lastCloned.workspaces.push(workspace); continue; } essentialsContainer.setAttribute("hidden", "true");