From e6154ceb99ef3d8052dbe27a1ec2afd921a3eac3 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Thu, 5 Feb 2026 23:01:49 +0100 Subject: [PATCH] feat: Make sure we properly restore split views when only pinned sync is enabled, b=no-bug, c=no-component --- src/zen/sessionstore/ZenSessionManager.sys.mjs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/zen/sessionstore/ZenSessionManager.sys.mjs b/src/zen/sessionstore/ZenSessionManager.sys.mjs index c812ffd07..345cad0da 100644 --- a/src/zen/sessionstore/ZenSessionManager.sys.mjs +++ b/src/zen/sessionstore/ZenSessionManager.sys.mjs @@ -570,13 +570,21 @@ export class nsZenSessionManager { let pinnedTabs = (sidebar.tabs || []).filter((tab) => tab.pinned); let unpinedWindowTabs = (aWindowData.tabs || []).filter((tab) => !tab.pinned); aWindowData.tabs = [...pinnedTabs, ...unpinedWindowTabs]; + + // We restore ALL the split view data in the sidebar, if the group doesn't exist in the window, + // it should be a no-op anyways. + aWindowData.splitViewData = [...sidebar.splitViewData, ...aWindowData.splitViewData]; + // Same thing with groups, we restore all the groups from the sidebar, if they don't have any + // existing tabs in the window, they should be a no-op. + aWindowData.groups = [...sidebar.groups, ...aWindowData.groups]; } else { aWindowData.tabs = sidebar.tabs || []; + aWindowData.splitViewData = sidebar.splitViewData; + aWindowData.groups = sidebar.groups; } - aWindowData.splitViewData = sidebar.splitViewData; + // Folders are always pinned, so we dont need to check for the pinned state here. aWindowData.folders = sidebar.folders; - aWindowData.groups = sidebar.groups; aWindowData.spaces = sidebar.spaces; } @@ -613,6 +621,7 @@ export class nsZenSessionManager { if (!lazy.gWindowSyncEnabled || lazy.gSyncOnlyPinnedTabs) { // Don't bring over any unpinned tabs if window sync is disabled or if syncing only pinned tabs. newWindow.tabs = newWindow.tabs.filter((tab) => tab.pinned); + newWindow.groups = newWindow.groups?.filter((group) => group.pinned); } // These are window-specific from the previous window state that