mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-30 12:21:55 +00:00
chore: Several QA fixes and options added, b=closes #11105, closes https://github.com/zen-browser/desktop/issues/11020, closes https://github.com/zen-browser/desktop/issues/11105, https://github.com/zen-browser/desktop/issues/10752, c=common, compact-mode, workspaces
This commit is contained in:
@@ -2502,7 +2502,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
// Only animate if it's from an event
|
||||
let animateContainer = target && target.target instanceof EventTarget;
|
||||
if (target?.type === 'TabClose' || target?.type === 'TabOpened') {
|
||||
if (target?.type === 'TabClose' || target?.type === 'TabOpen') {
|
||||
animateContainer = target.target.pinned;
|
||||
}
|
||||
await this.onPinnedTabsResize(
|
||||
@@ -2514,14 +2514,29 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
);
|
||||
}
|
||||
|
||||
updateShouldHideSeparator(arrowScrollbox, pinnedContainer) {
|
||||
updateShouldHideSeparator(arrowScrollbox, pinnedContainer, fromTabSelection = false) {
|
||||
const visibleTabsFound = () => {
|
||||
let count = 0;
|
||||
for (const child of arrowScrollbox.children) {
|
||||
if (
|
||||
!child.hasAttribute('hidden') &&
|
||||
!child.closing &&
|
||||
!child.hasAttribute('zen-empty-tab')
|
||||
) {
|
||||
count++;
|
||||
if (count > 1) {
|
||||
// Early return
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
// <= 2 because we have the empty tab and the new tab button
|
||||
const shouldHideSeparator =
|
||||
pinnedContainer.children.length === 1 ||
|
||||
Array.from(arrowScrollbox.children).filter(
|
||||
(child) =>
|
||||
!child.hasAttribute('hidden') && !child.closing && !child.hasAttribute('zen-empty-tab')
|
||||
).length <= 1;
|
||||
const shouldHideSeparator = fromTabSelection
|
||||
? pinnedContainer.hasAttribute('hide-separator')
|
||||
: pinnedContainer.children.length === 1 || !visibleTabsFound();
|
||||
if (shouldHideSeparator) {
|
||||
pinnedContainer.setAttribute('hide-separator', 'true');
|
||||
} else {
|
||||
@@ -2656,7 +2671,7 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
|
||||
}
|
||||
const workspaceID = tab.getAttribute('zen-workspace-id');
|
||||
const isEssential = tab.getAttribute('zen-essential') === 'true';
|
||||
|
||||
this.updateShouldHideSeparator(this.activeWorkspaceStrip, this.pinnedTabsContainer, true);
|
||||
if (tab.hasAttribute('zen-empty-tab')) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user