Skip to content

Commit 09ca430

Browse files
committed
feat: Improved tab transitions and fixed a couple of issues with glance, b=(no-bug), c=tabs, common, glance, split-view, workspaces
1 parent dda1dab commit 09ca430

File tree

14 files changed

+374
-176
lines changed

14 files changed

+374
-176
lines changed

src/browser/base/content/zen-assets.jar.inc.mn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
content/browser/ZenCustomizableUI.sys.mjs (../../zen/common/ZenCustomizableUI.sys.mjs)
1010
content/browser/zen-components/ZenUIMigration.mjs (../../zen/common/ZenUIMigration.mjs)
1111
content/browser/zen-components/ZenCommonUtils.mjs (../../zen/common/ZenCommonUtils.mjs)
12+
content/browser/zen-components/ZenSessionStore.mjs (../../zen/common/ZenSessionStore.mjs)
1213

1314
content/browser/zen-styles/zen-theme.css (../../zen/common/styles/zen-theme.css)
1415
content/browser/zen-styles/zen-buttons.css (../../zen/common/styles/zen-buttons.css)

src/browser/base/content/zen-preloaded.inc.xhtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenWorkspaces.mjs"></script>
1010
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenWorkspacesSync.mjs"></script>
1111
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenActorsManager.mjs"></script>
12+
<script type="text/javascript" src="chrome://browser/content/zen-components/ZenSessionStore.mjs"></script>
13+

src/browser/components/sessionstore/SessionStore-sys-mjs.patch

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
2-
index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d81447514e2c 100644
2+
index 8c6047e1ada5a22e57e1e665965237c9e22641d7..8d0585e738a5a758ebbddfa0787c71d634dadd4d 100644
33
--- a/browser/components/sessionstore/SessionStore.sys.mjs
44
+++ b/browser/components/sessionstore/SessionStore.sys.mjs
55
@@ -2088,7 +2088,6 @@ var SessionStoreInternal = {
@@ -31,17 +31,19 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
3131
return;
3232
}
3333

34-
@@ -3925,6 +3922,9 @@ var SessionStoreInternal = {
34+
@@ -3925,6 +3922,11 @@ var SessionStoreInternal = {
3535
Math.min(tabState.index, tabState.entries.length)
3636
);
3737
tabState.pinned = false;
3838
+ tabState.zenEssential = false;
3939
+ tabState.zenPinnedId = null;
40+
+ tabState.zenIsGlance = false;
41+
+ tabState.zenGlanceId = null;
4042
+ tabState.zenHasStaticLabel = false;
4143

4244
if (inBackground === false) {
4345
aWindow.gBrowser.selectedTab = newTab;
44-
@@ -5239,7 +5239,7 @@ var SessionStoreInternal = {
46+
@@ -5239,7 +5241,7 @@ var SessionStoreInternal = {
4547
}
4648

4749
let workspaceID = aWindow.getWorkspaceID();
@@ -50,7 +52,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
5052
winData.workspaceID = workspaceID;
5153
}
5254
},
53-
@@ -5430,14 +5430,15 @@ var SessionStoreInternal = {
55+
@@ -5430,14 +5432,15 @@ var SessionStoreInternal = {
5456
}
5557

5658
let tabbrowser = aWindow.gBrowser;
@@ -68,7 +70,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
6870
continue;
6971
}
7072
let tabData = lazy.TabState.collect(tab, TAB_CUSTOM_VALUES.get(tab));
71-
@@ -5456,8 +5457,8 @@ var SessionStoreInternal = {
73+
@@ -5456,8 +5459,8 @@ var SessionStoreInternal = {
7274
// We don't store the Firefox View tab in Session Store, so if it was the last selected "tab" when
7375
// a window is closed, point to the first item in the tab strip instead (it will never be the Firefox View tab,
7476
// since it's only inserted into the tab strip after it's selected).
@@ -79,7 +81,7 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
7981
winData.title = tabbrowser.tabs[0].label;
8082
}
8183
winData.selected = selectedIndex;
82-
@@ -5569,8 +5570,8 @@ var SessionStoreInternal = {
84+
@@ -5569,8 +5572,8 @@ var SessionStoreInternal = {
8385
// selectTab represents.
8486
let selectTab = 0;
8587
if (overwriteTabs) {
@@ -90,20 +92,21 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
9092
selectTab = Math.min(selectTab, winData.tabs.length);
9193
}
9294

93-
@@ -5613,6 +5614,7 @@ var SessionStoreInternal = {
95+
@@ -5613,6 +5616,7 @@ var SessionStoreInternal = {
9496
winData.tabs,
9597
winData.groups ?? []
9698
);
9799
+ aWindow.gZenViewSplitter?.restoreDataFromSessionStore(winData.splitViewData);
98100
this._log.debug(
99101
`restoreWindow, createTabsForSessionRestore returned ${tabs.length} tabs`
100102
);
101-
@@ -6162,8 +6164,23 @@ var SessionStoreInternal = {
103+
@@ -6162,6 +6166,22 @@ var SessionStoreInternal = {
102104

103105
// Most of tabData has been restored, now continue with restoring
104106
// attributes that may trigger external events.
105107
+ if (tabData.zenEssential) {
106108
+ tab.setAttribute("zen-essential", "true");
109+
+ tabData.pinned = true; // Essential tabs are always pinned.
107110
+ }
108111
+ if (tabData.zenIsEmpty) {
109112
+ tab.setAttribute("zen-empty-tab", "true");
@@ -118,8 +121,5 @@ index 8c6047e1ada5a22e57e1e665965237c9e22641d7..ccd2779d66eda9d034ca51cc3200d814
118121
+ tab.setAttribute("zenDefaultUserContextId", true);
119122
+ }
120123

121-
- if (tabData.pinned) {
122-
+ if (tabData.pinned || tabData.zenEssential) {
124+
if (tabData.pinned) {
123125
tabbrowser.pinTab(tab);
124-
} else {
125-
tabbrowser.unpinTab(tab);

src/browser/components/sessionstore/TabState-sys-mjs.patch

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/browser/components/sessionstore/TabState.sys.mjs b/browser/components/sessionstore/TabState.sys.mjs
2-
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..254849e13f7566029dc780c45e376e0f0d427cb5 100644
2+
index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..76f4cf5aef30cb580ef0295fe6928b5a6a362f4b 100644
33
--- a/browser/components/sessionstore/TabState.sys.mjs
44
+++ b/browser/components/sessionstore/TabState.sys.mjs
5-
@@ -84,6 +84,16 @@ class _TabState {
5+
@@ -84,6 +84,18 @@ class _TabState {
66
tabData.groupId = tab.group.id;
77
}
88

@@ -15,6 +15,8 @@ index 8f7ed557e6aa61e7e16ed4a8d785ad5fe651b3d8..254849e13f7566029dc780c45e376e0f
1515
+ tabData.zenPinnedIcon = tab.getAttribute("zen-pinned-icon");
1616
+ tabData.zenIsEmpty = tab.hasAttribute("zen-empty-tab");
1717
+ tabData.zenHasStaticLabel = tab.hasAttribute("zen-has-static-label");
18+
+ tabData.zenGlanceId = tab.getAttribute("glance-id");
19+
+ tabData.zenIsGlance = tab.hasAttribute("zen-glance-tab");
1820
+
1921
tabData.searchMode = tab.ownerGlobal.gURLBar.getSearchMode(browser, true);
2022

0 commit comments

Comments
 (0)