mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-29 06:28:39 +00:00
feat: Only take into account selected tabs, not active ones, b=no-bug, c=folders
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
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index 3204f253c23551650991d3385dd256d55892a012..bc269239637b4445e24af6295ca09cdddfca1e78 100644
|
index 3204f253c23551650991d3385dd256d55892a012..29e0471616f979bfe40bb4d34148bf35a63f59ee 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -427,15 +427,64 @@
|
@@ -427,15 +427,64 @@
|
||||||
@@ -432,7 +432,7 @@ index 3204f253c23551650991d3385dd256d55892a012..bc269239637b4445e24af6295ca09cdd
|
|||||||
if (ownerTab) {
|
if (ownerTab) {
|
||||||
tab.owner = ownerTab;
|
tab.owner = ownerTab;
|
||||||
}
|
}
|
||||||
+ if ((!tab.pinned && tabGroup?.isZenFolder && !Services.prefs.getBoolPref('zen.folders.owned-tabs-in-folder')) || tabGroup?.hasAttribute("split-view-group")) {
|
+ if ((!tab.pinned && tabGroup?.isZenFolder && !Services.prefs.getBoolPref('zen.folders.owned-tabs-in-folder')) || (tabGroup && tabGroup.hasAttribute("split-view-group"))) {
|
||||||
+ tabGroup = null;
|
+ tabGroup = null;
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
|
@@ -1273,7 +1273,7 @@
|
|||||||
const activeFolderId = lastActiveFolder?.id;
|
const activeFolderId = lastActiveFolder?.id;
|
||||||
const splitViewId = isSplitView ? item?.group?.id : null;
|
const splitViewId = isSplitView ? item?.group?.id : null;
|
||||||
|
|
||||||
if (item.multiselected || item.selected || item.hasAttribute('folder-active')) {
|
if (item.multiselected || item.selected) {
|
||||||
selectedTabs.push(item);
|
selectedTabs.push(item);
|
||||||
if (splitViewId) splitViewIds.add(splitViewId);
|
if (splitViewId) splitViewIds.add(splitViewId);
|
||||||
if (activeFolderId) activeFoldersIds.add(activeFolderId);
|
if (activeFolderId) activeFoldersIds.add(activeFolderId);
|
||||||
@@ -1298,7 +1298,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#calculateHeightShift(tabsContainer, selectedTabs) {
|
#calculateHeightShift(tabsContainer, selectedTabs = []) {
|
||||||
let heightShift = 0;
|
let heightShift = 0;
|
||||||
if (selectedTabs.length) {
|
if (selectedTabs.length) {
|
||||||
return heightShift;
|
return heightShift;
|
||||||
@@ -1330,7 +1330,9 @@
|
|||||||
const { item, splitViewId, activeFolderId } = groupItems[i];
|
const { item, splitViewId, activeFolderId } = groupItems[i];
|
||||||
|
|
||||||
// Skip selected items
|
// Skip selected items
|
||||||
if (selectedTabs.includes(item)) continue;
|
if (selectedTabs.includes(item)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Skip items from selected split-view groups
|
// Skip items from selected split-view groups
|
||||||
if (splitViewId && splitViewIds.has(splitViewId)) continue;
|
if (splitViewId && splitViewIds.has(splitViewId)) continue;
|
||||||
@@ -1360,7 +1362,7 @@
|
|||||||
animations.push(
|
animations.push(
|
||||||
...this.#createAnimation(
|
...this.#createAnimation(
|
||||||
itemsToHide,
|
itemsToHide,
|
||||||
{ opacity: 0, height: 0 },
|
{ opacity: [1, 0], height: 0 },
|
||||||
{ duration: 0.12, ease: 'easeInOut' }
|
{ duration: 0.12, ease: 'easeInOut' }
|
||||||
),
|
),
|
||||||
...this.updateFolderIcon(group),
|
...this.updateFolderIcon(group),
|
||||||
@@ -1474,7 +1476,7 @@
|
|||||||
animations.push(
|
animations.push(
|
||||||
...this.#createAnimation(
|
...this.#createAnimation(
|
||||||
itemsToShow,
|
itemsToShow,
|
||||||
{ opacity: '', height: '' },
|
{ opacity: 1, height: '' },
|
||||||
{ duration: 0.12, ease: 'easeInOut' }
|
{ duration: 0.12, ease: 'easeInOut' }
|
||||||
),
|
),
|
||||||
...this.#createAnimation(
|
...this.#createAnimation(
|
||||||
@@ -1520,7 +1522,7 @@
|
|||||||
tabsContainer.offsetHeight;
|
tabsContainer.offsetHeight;
|
||||||
// tabsContainer.setAttribute('hidden', true);
|
// tabsContainer.setAttribute('hidden', true);
|
||||||
|
|
||||||
const heightUntilSelected = this.#calculateHeightShift(tabsContainer, []);
|
const heightUntilSelected = this.#calculateHeightShift(tabsContainer);
|
||||||
|
|
||||||
// Collect animations for this specific folder becoming inactive
|
// Collect animations for this specific folder becoming inactive
|
||||||
animations.push(
|
animations.push(
|
||||||
@@ -1565,7 +1567,7 @@
|
|||||||
tabsContainer.offsetHeight;
|
tabsContainer.offsetHeight;
|
||||||
tabsContainer.setAttribute('hidden', true);
|
tabsContainer.setAttribute('hidden', true);
|
||||||
|
|
||||||
const heightUntilSelected = this.#calculateHeightShift(tabsContainer, []);
|
const heightUntilSelected = this.#calculateHeightShift(tabsContainer);
|
||||||
|
|
||||||
// Collect animations for this specific folder becoming inactive
|
// Collect animations for this specific folder becoming inactive
|
||||||
const folderAnimation = [
|
const folderAnimation = [
|
||||||
@@ -1750,7 +1752,7 @@
|
|||||||
if (!group?.isZenFolder) return;
|
if (!group?.isZenFolder) return;
|
||||||
const groupStart = group.querySelector('.zen-tab-group-start');
|
const groupStart = group.querySelector('.zen-tab-group-start');
|
||||||
const tabsContainer = group.querySelector('.tab-group-container');
|
const tabsContainer = group.querySelector('.tab-group-container');
|
||||||
const heightContainer = expand ? 0 : this.#calculateHeightShift(tabsContainer, []);
|
const heightContainer = expand ? 0 : this.#calculateHeightShift(tabsContainer);
|
||||||
tabsContainer.style.overflow = expand ? '' : 'clip';
|
tabsContainer.style.overflow = expand ? '' : 'clip';
|
||||||
|
|
||||||
this.#createAnimation(
|
this.#createAnimation(
|
||||||
|
Reference in New Issue
Block a user