From 40080a25dc876eabd87bc8cf1dd5e38e475ce20c Mon Sep 17 00:00:00 2001 From: fen4flo <75260616+FlorianButz@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:18:02 +0200 Subject: [PATCH] gh-11245: Fix tab placement with Move Tab / Space Routing (gh-14324) Fixes #11245 --- src/zen/spaces/ZenSpaceManager.mjs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/zen/spaces/ZenSpaceManager.mjs b/src/zen/spaces/ZenSpaceManager.mjs index 3ba066179..52f692bbe 100644 --- a/src/zen/spaces/ZenSpaceManager.mjs +++ b/src/zen/spaces/ZenSpaceManager.mjs @@ -1506,19 +1506,27 @@ class nsZenWorkspaces { continue; } + const newtabPlacement = Services.prefs.getBoolPref( + "zen.view.show-newtab-button-top", + false + ); + const insertElement = newtabPlacement + ? container.firstChild + : container.lastChild; + if (container) { if (tab.group?.hasAttribute("split-view-group")) { gBrowser.zenHandleTabMove(tab.group, () => { for (const subTab of tab.group.tabs) { subTab.setAttribute("zen-workspace-id", workspaceID); } - container.insertBefore(tab.group, container.lastChild); + container.insertBefore(tab.group, insertElement); }); continue; } gBrowser.zenHandleTabMove(tab, () => { tab.setAttribute("zen-workspace-id", workspaceID); - container.insertBefore(tab, container.lastChild); + container.insertBefore(tab, insertElement); }); } // also change glance tab if it's the same tab