mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 17:36:34 +00:00
Allowed renamed pinned tabs to persist across sessions
This commit is contained in:
@@ -147,8 +147,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const workspaces = await ZenWorkspaces._workspaces();
|
|
||||||
|
|
||||||
const activeTab = gBrowser.selectedTab;
|
const activeTab = gBrowser.selectedTab;
|
||||||
const pinnedTabsByUUID = new Map();
|
const pinnedTabsByUUID = new Map();
|
||||||
const pinsToCreate = new Set(pins.map((p) => p.uuid));
|
const pinsToCreate = new Set(pins.map((p) => p.uuid));
|
||||||
@@ -174,7 +172,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second pass: create new tabs for pins that don't have tabs
|
// Second pass: For every existing tab, update its label
|
||||||
|
// and set 'zen-has-static-label' attribute if it's been edited
|
||||||
|
for (let pin of pins) {
|
||||||
|
const tab = pinnedTabsByUUID.get(pin.uuid);
|
||||||
|
if (!tab) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pin.title && pin.editedTitle) {
|
||||||
|
gBrowser._setTabLabel(tab, pin.title);
|
||||||
|
tab.setAttribute('zen-has-static-label', 'true');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Third pass: create new tabs for pins that don't have tabs
|
||||||
for (let pin of pins) {
|
for (let pin of pins) {
|
||||||
if (!pinsToCreate.has(pin.uuid)) {
|
if (!pinsToCreate.has(pin.uuid)) {
|
||||||
continue; // Skip pins that already have tabs
|
continue; // Skip pins that already have tabs
|
||||||
|
@@ -119,7 +119,7 @@
|
|||||||
{
|
{
|
||||||
type: 'spring',
|
type: 'spring',
|
||||||
bounce: 0,
|
bounce: 0,
|
||||||
delay: getMotion().stagger(0.1, { startDelay: 0.3 }),
|
delay: getMotion().stagger(0.1, { startDelay: 0.4 }),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
document.getElementById('zen-welcome-page-sidebar-buttons').innerHTML = '';
|
document.getElementById('zen-welcome-page-sidebar-buttons').innerHTML = '';
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
|
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
|
||||||
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..dc0fdf17952df397a684f8a1da2f71739d007350 100644
|
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..83bf443ca158c07e05075777da02b7f228d83dff 100644
|
||||||
--- a/browser/components/sessionstore/TabState.sys.mjs
|
--- a/browser/components/sessionstore/TabState.sys.mjs
|
||||||
+++ b/browser/components/sessionstore/TabState.sys.mjs
|
+++ b/browser/components/sessionstore/TabState.sys.mjs
|
||||||
@@ -84,6 +84,14 @@ class _TabState {
|
@@ -84,6 +84,13 @@ class _TabState {
|
||||||
tabData.groupId = tab.group.id;
|
tabData.groupId = tab.group.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,7 +12,6 @@ index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..dc0fdf17952df397a684f8a1da2f7173
|
|||||||
+ tabData.zenDefaultUserContextId = tab.getAttribute("zenDefaultUserContextId");
|
+ tabData.zenDefaultUserContextId = tab.getAttribute("zenDefaultUserContextId");
|
||||||
+ tabData.zenPinnedEntry = tab.getAttribute("zen-pinned-entry");
|
+ tabData.zenPinnedEntry = tab.getAttribute("zen-pinned-entry");
|
||||||
+ tabData.zenPinnedIcon = tab.getAttribute("zen-pinned-icon");
|
+ tabData.zenPinnedIcon = tab.getAttribute("zen-pinned-icon");
|
||||||
+ tabData.zenHasStaticLabel = tab.getAttribute("zen-has-static-label");
|
|
||||||
+
|
+
|
||||||
tabData.searchMode = tab.ownerGlobal.gURLBar.getSearchMode(browser, true);
|
tabData.searchMode = tab.ownerGlobal.gURLBar.getSearchMode(browser, true);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user