feat: Added better support for customizable UI, b=(no-bug), c=common, workspaces

This commit is contained in:
Mr. M
2025-05-19 20:28:27 +02:00
parent 273d7ce5d5
commit 7a846fa458
2 changed files with 16 additions and 1 deletions

View File

@@ -259,3 +259,13 @@
:root:not([customizing]) #TabsToolbar-customization-target > #alltabs-button {
display: none;
}
:root[customizing] #TabsToolbar-customization-target {
visibility: collapse;
}
:root[customizing] #zen-sidebar-top-buttons-customization-target {
border: 1px dashed;
border-radius: 2px;
margin: 10px 2px 0 0;
}

View File

@@ -832,6 +832,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
window.addEventListener('TabRemovedFromEssentials', tabUpdateListener);
window.addEventListener('TabPinned', tabUpdateListener);
window.addEventListener('TabUnpinned', tabUpdateListener);
window.addEventListener('aftercustomization', tabUpdateListener);
}
}
@@ -2567,7 +2568,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
target = null;
}
// Only animate if it's from an event
const animateContainer = target && target.target instanceof EventTarget;
let animateContainer = target && target.target instanceof EventTarget;
if (target?.type === 'TabClose') {
animateContainer = target.target.pinned;
}
await this.onPinnedTabsResize(
// This is what happens when we join a resize observer, an event listener
// while using it as a method.
@@ -2595,6 +2599,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (!this._hasInitializedTabsStrip || (this._organizingWorkspaceStrip && !forAnimation)) {
return;
}
if (document.documentElement.hasAttribute('customizing')) return;
// forAnimation may be of type "ResizeObserver" if it's not a boolean, just ignore it
if (typeof forAnimation !== 'boolean') {
forAnimation = false;