mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Merge branch 'dev' of https://github.com/zen-browser/desktop into dev
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
index d80a66a01002e78a9c65545d08fe786328ddf124..bb57b1eeb033f602d5014ab23e2cc1389bb9e615 100644
|
||||
index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc58e2af77 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -422,15 +422,60 @@
|
||||
@@ -337,7 +337,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..bb57b1eeb033f602d5014ab23e2cc138
|
||||
if (!tab) {
|
||||
let createLazyBrowser =
|
||||
- restoreTabsLazily && !select && !tabData.pinned;
|
||||
+ restoreTabsLazily;
|
||||
+ restoreTabsLazily && !(tabData.pinned && !Services.prefs.getBoolPref("browser.sessionstore.restore_pinned_tabs_on_demand"));
|
||||
|
||||
let url = "about:blank";
|
||||
if (tabData.entries?.length) {
|
||||
|
@@ -13,7 +13,7 @@
|
||||
// are initialized before we start our own initialization.
|
||||
// please, do not remove this line and if you do, make sure to
|
||||
// test the startup process.
|
||||
await new Promise((resolve) => resolve());
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
this.openWatermark();
|
||||
this.#initBrowserBackground();
|
||||
this.#changeSidebarLocation();
|
||||
|
@@ -582,7 +582,7 @@
|
||||
},
|
||||
{
|
||||
duration: 0.1,
|
||||
ease: 'linear',
|
||||
ease: 'easeInOut',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
@@ -598,7 +598,7 @@
|
||||
if (!folders.has(group?.id)) {
|
||||
folders.set(group?.id, group?.activeGroups?.at(-1));
|
||||
}
|
||||
let activeGroup = folders.get(tab?.group?.id);
|
||||
let activeGroup = folders.get(group?.id);
|
||||
// If group has active tabs, we need to update the indentation
|
||||
if (activeGroup) {
|
||||
const activeGroupStart = activeGroup.querySelector('.zen-tab-group-start');
|
||||
@@ -1252,11 +1252,10 @@
|
||||
// But we should be setting the margin only on `folder1`.
|
||||
if (!group.activeTabs.includes(selectedTab) && selectedTab) return;
|
||||
group._prevActiveTabs = group.activeTabs;
|
||||
for (const item of group.tabs) {
|
||||
for (const item of group._prevActiveTabs) {
|
||||
if (
|
||||
item.hasAttribute('folder-active') &&
|
||||
(selectedTab ? item === selectedTab : !item.selected || !onlyIfActive) &&
|
||||
group.activeTabs.includes(item)
|
||||
(selectedTab ? item === selectedTab : !item.selected || !onlyIfActive)
|
||||
) {
|
||||
item.removeAttribute('folder-active');
|
||||
group.activeTabs = group.activeTabs.filter((t) => t !== item);
|
||||
@@ -1283,14 +1282,14 @@
|
||||
expandVisibleTab(group) {
|
||||
if (!group?.isZenFolder) return;
|
||||
|
||||
for (const item of group.allItems) {
|
||||
if (item.hasAttribute('was-folder-active')) {
|
||||
item.setAttribute('folder-active', 'true');
|
||||
item.removeAttribute('was-folder-active');
|
||||
group.activeTabs = group._prevActiveTabs || [];
|
||||
for (const tab of group.activeTabs) {
|
||||
if (tab.hasAttribute('was-folder-active')) {
|
||||
tab.setAttribute('folder-active', 'true');
|
||||
tab.removeAttribute('was-folder-active');
|
||||
}
|
||||
}
|
||||
|
||||
group.activeTabs = group._prevActiveTabs || [];
|
||||
this.on_TabGroupExpand({ target: group, forExpandVisible: true });
|
||||
|
||||
gBrowser.tabContainer._invalidateCachedVisibleTabs();
|
||||
@@ -1338,12 +1337,26 @@
|
||||
if (activeForGroup.length) {
|
||||
if (current.collapsed) {
|
||||
if (current.hasAttribute('has-active')) {
|
||||
current.activeTabs = [...new Set([...current.activeTabs, ...activeForGroup])];
|
||||
// It is important to keep the sequence of elements as in the DOM
|
||||
current.activeTabs = [...new Set([...current.activeTabs, ...activeForGroup])].sort(
|
||||
(a, b) => {
|
||||
const position = a.compareDocumentPosition(b);
|
||||
if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
||||
if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
||||
return 0;
|
||||
}
|
||||
);
|
||||
} else {
|
||||
current.setAttribute('has-active', 'true');
|
||||
current.activeTabs = activeForGroup;
|
||||
}
|
||||
|
||||
// If selectedItems does not have a tab, it is necessary to add it
|
||||
current.activeTabs.forEach((tab) => {
|
||||
if (!selectedItems.includes(tab)) {
|
||||
selectedItems.push(tab);
|
||||
}
|
||||
});
|
||||
const tabsContainer = current.querySelector('.tab-group-container');
|
||||
const groupStart = current.querySelector('.zen-tab-group-start');
|
||||
const curMarginTop = parseInt(groupStart.style.marginTop) || 0;
|
||||
@@ -1435,7 +1448,7 @@
|
||||
{
|
||||
marginTop: [curMarginTop, 0],
|
||||
},
|
||||
{ duration: 0.1, ease: 'linear' }
|
||||
{ duration: 0.1, ease: 'easeInOut' }
|
||||
)
|
||||
.then(() => {
|
||||
tabsContainer.style.overflow = '';
|
||||
|
@@ -277,7 +277,7 @@ zen-folder {
|
||||
fill-opacity: 0.9;
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
fill: var(--zen-folder-stroke);
|
||||
transform: translate(-180%, 9%);
|
||||
transform: translate(-180%, 2.5px);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1602,7 +1602,9 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
const emptyTab = this._emptyTab;
|
||||
if (emptyTab) {
|
||||
emptyTab.setAttribute('zen-workspace-id', this.activeWorkspace);
|
||||
gBrowser.TabStateFlusher.flush(emptyTab.linkedBrowser);
|
||||
if (emptyTab.linkedBrowser) {
|
||||
gBrowser.TabStateFlusher.flush(emptyTab.linkedBrowser);
|
||||
}
|
||||
const container = this.activeWorkspaceStrip;
|
||||
if (container) {
|
||||
container.insertBefore(emptyTab, container.firstChild);
|
||||
|
Reference in New Issue
Block a user