mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Some fixes for folders, p=#10038
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..4adabe030bfb322db1a9c95f71eb1adc58e2af77 100644
|
||||
index d80a66a01002e78a9c65545d08fe786328ddf124..e644946134c7e5a4b3232f674880eab596d5fa15 100644
|
||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||
@@ -422,15 +422,60 @@
|
||||
@@ -391,10 +391,10 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
+ else {
|
||||
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
||||
}
|
||||
+ }
|
||||
+ this._hasAlreadyInitializedZenSessionStore = true;
|
||||
|
||||
if (tabs.length > 1 || !tabs[0].selected) {
|
||||
@@ -651,7 +651,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||
neighbor.after(element);
|
||||
} else {
|
||||
@@ -6136,22 +6274,23 @@
|
||||
@@ -6136,23 +6274,28 @@
|
||||
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
||||
if (this.isTabGroupLabel(targetElement)) {
|
||||
targetElement = targetElement.group;
|
||||
@@ -679,9 +679,14 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
- targetElement = this.tabs[this.pinnedTabCount - 1];
|
||||
+ targetElement = this.tabsWithoutGlance[this.pinnedTabCount - 1];
|
||||
moveBefore = false;
|
||||
+ if (!this.visibleTabs.includes(targetElement)) {
|
||||
+ targetElement = gZenWorkspaces.pinnedTabsContainer.querySelector('.pinned-tabs-container-separator')
|
||||
+ moveBefore = true;
|
||||
+ }
|
||||
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
||||
// If the caller asks to move an unpinned element next to a pinned
|
||||
@@ -6165,14 +6304,34 @@
|
||||
// tab, move the unpinned element to be the first unpinned element
|
||||
@@ -6165,14 +6308,34 @@
|
||||
// move the tab group right before the first unpinned tab.
|
||||
// 4. Moving a tab group and the first unpinned tab is grouped:
|
||||
// move the tab group right before the first unpinned tab's tab group.
|
||||
@@ -717,7 +722,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
element.pinned
|
||||
? this.tabContainer.pinnedTabsContainer
|
||||
: this.tabContainer;
|
||||
@@ -6181,7 +6340,7 @@
|
||||
@@ -6181,7 +6344,7 @@
|
||||
element,
|
||||
() => {
|
||||
if (moveBefore) {
|
||||
@@ -726,7 +731,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
} else if (targetElement) {
|
||||
targetElement.after(element);
|
||||
} else {
|
||||
@@ -6227,10 +6386,10 @@
|
||||
@@ -6227,10 +6390,10 @@
|
||||
* @param {TabMetricsContext} [metricsContext]
|
||||
*/
|
||||
moveTabToGroup(aTab, aGroup, metricsContext) {
|
||||
@@ -739,7 +744,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
return;
|
||||
}
|
||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||
@@ -6324,6 +6483,10 @@
|
||||
@@ -6324,6 +6487,10 @@
|
||||
|
||||
moveActionCallback();
|
||||
|
||||
@@ -750,7 +755,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||
// changed.
|
||||
this.tabContainer._invalidateCachedTabs();
|
||||
@@ -7221,7 +7384,7 @@
|
||||
@@ -7221,7 +7388,7 @@
|
||||
// preventDefault(). It will still raise the window if appropriate.
|
||||
break;
|
||||
}
|
||||
@@ -759,7 +764,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
window.focus();
|
||||
aEvent.preventDefault();
|
||||
break;
|
||||
@@ -8166,6 +8329,7 @@
|
||||
@@ -8166,6 +8333,7 @@
|
||||
aWebProgress.isTopLevel
|
||||
) {
|
||||
this.mTab.setAttribute("busy", "true");
|
||||
@@ -767,7 +772,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||
}
|
||||
@@ -9157,7 +9321,7 @@ var TabContextMenu = {
|
||||
@@ -9157,7 +9325,7 @@ var TabContextMenu = {
|
||||
);
|
||||
contextUnpinSelectedTabs.hidden =
|
||||
!this.contextTab.pinned || !this.multiselected;
|
||||
@@ -776,7 +781,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..4adabe030bfb322db1a9c95f71eb1adc
|
||||
// Build Ask Chat items
|
||||
TabContextMenu.GenAI.buildTabMenu(
|
||||
document.getElementById("context_askChat"),
|
||||
@@ -9476,6 +9640,7 @@ var TabContextMenu = {
|
||||
@@ -9476,6 +9644,7 @@ var TabContextMenu = {
|
||||
)
|
||||
);
|
||||
} else {
|
||||
|
@@ -231,7 +231,7 @@
|
||||
}
|
||||
|
||||
if (group.collapsed && !this._sessionRestoring) {
|
||||
group.collapsed = false;
|
||||
group.collapsed = group.hasAttribute('has-active');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -618,7 +618,31 @@
|
||||
let activeGroup = folders.get(group?.id);
|
||||
// If group has active tabs, we need to update the indentation
|
||||
if (activeGroup) {
|
||||
this.on_TabGroupCollapse({ target: activeGroup });
|
||||
const activeGroupStart = activeGroup.querySelector('.zen-tab-group-start');
|
||||
const selectedTabs = activeGroup.activeTabs;
|
||||
if (selectedTabs.length > 0) {
|
||||
const selectedItem = selectedTabs[0];
|
||||
const isSplitView = selectedItem.group?.hasAttribute('split-view-group');
|
||||
const selectedContainer = isSplitView ? selectedItem.group : selectedItem;
|
||||
|
||||
const heightUntilSelected =
|
||||
window.windowUtils.getBoundsWithoutFlushing(selectedContainer).top -
|
||||
window.windowUtils.getBoundsWithoutFlushing(activeGroupStart).bottom;
|
||||
|
||||
const adjustedHeight = isSplitView
|
||||
? heightUntilSelected - 2
|
||||
: heightUntilSelected;
|
||||
|
||||
animations.push(
|
||||
gZenUIManager.motion.animate(
|
||||
activeGroupStart,
|
||||
{
|
||||
marginTop: -(adjustedHeight + 4 * (selectedTabs.length === 0 ? 1 : 0)),
|
||||
},
|
||||
{ duration: 0, ease: 'linear' }
|
||||
)
|
||||
);
|
||||
}
|
||||
this.setFolderIndentation([tab], activeGroup, /* for collapse = */ true);
|
||||
} else {
|
||||
// Since the folder is now expanded, we should remove active attribute
|
||||
|
Reference in New Issue
Block a user