mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 10:26:36 +00:00
Refactor tab management and styling for improved workspace organization and UI consistency
This commit is contained in:
@@ -685,6 +685,7 @@ var gZenVerticalTabsManager = {
|
|||||||
// Update pin title in storage
|
// Update pin title in storage
|
||||||
await gZenPinnedTabManager.updatePinTitle(this._tabEdited, this._tabEdited.label, !!newName);
|
await gZenPinnedTabManager.updatePinTitle(this._tabEdited, this._tabEdited.label, !!newName);
|
||||||
}
|
}
|
||||||
|
document.documentElement.removeAttribute('zen-renaming-tab');
|
||||||
|
|
||||||
// Maybe add some confetti here?!?
|
// Maybe add some confetti here?!?
|
||||||
gZenUIManager.motion.animate(
|
gZenUIManager.motion.animate(
|
||||||
@@ -714,6 +715,7 @@ var gZenVerticalTabsManager = {
|
|||||||
!gZenVerticalTabsManager._prefsSidebarExpanded
|
!gZenVerticalTabsManager._prefsSidebarExpanded
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
document.documentElement.setAttribute('zen-renaming-tab', 'true');
|
||||||
this._tabEdited = event.target.closest('.tabbrowser-tab');
|
this._tabEdited = event.target.closest('.tabbrowser-tab');
|
||||||
if (!this._tabEdited || !this._tabEdited.pinned || this._tabEdited.hasAttribute('zen-essential')) {
|
if (!this._tabEdited || !this._tabEdited.pinned || this._tabEdited.hasAttribute('zen-essential')) {
|
||||||
this._tabEdited = null;
|
this._tabEdited = null;
|
||||||
@@ -743,6 +745,7 @@ var gZenVerticalTabsManager = {
|
|||||||
if (document.activeElement === event.target || !this._tabEdited) {
|
if (document.activeElement === event.target || !this._tabEdited) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
document.documentElement.removeAttribute('zen-renaming-tab');
|
||||||
this._tabEdited.querySelector('.tab-editor-container').remove();
|
this._tabEdited.querySelector('.tab-editor-container').remove();
|
||||||
const label = this._tabEdited.querySelector('.tab-label-container-editing');
|
const label = this._tabEdited.querySelector('.tab-label-container-editing');
|
||||||
label.classList.remove('tab-label-container-editing');
|
label.classList.remove('tab-label-container-editing');
|
||||||
|
@@ -139,6 +139,7 @@
|
|||||||
#navigator-toolbox[has-popup-menu],
|
#navigator-toolbox[has-popup-menu],
|
||||||
#navigator-toolbox[movingtab],
|
#navigator-toolbox[movingtab],
|
||||||
#navigator-toolbox:has(.tabbrowser-tab:active),
|
#navigator-toolbox:has(.tabbrowser-tab:active),
|
||||||
|
&[zen-renaming-tab='true'] #navigator-toolbox,
|
||||||
#navigator-toolbox:has(
|
#navigator-toolbox:has(
|
||||||
*:is([panelopen='true'], [open='true'], #urlbar:not([zen-floating-urlbar='true']):focus-within):not(tab):not(.zen-compact-mode-ignore)
|
*:is([panelopen='true'], [open='true'], #urlbar:not([zen-floating-urlbar='true']):focus-within):not(tab):not(.zen-compact-mode-ignore)
|
||||||
) {
|
) {
|
||||||
|
@@ -125,6 +125,7 @@
|
|||||||
--zen-main-browser-background-toolbar: var(--zen-main-browser-background);
|
--zen-main-browser-background-toolbar: var(--zen-main-browser-background);
|
||||||
|
|
||||||
--browser-area-z-index-toolbox: 2 !important;
|
--browser-area-z-index-toolbox: 2 !important;
|
||||||
|
--attention-dot-color: transparent !important;
|
||||||
|
|
||||||
--zen-appcontent-border: 1px solid var(--zen-colors-border);
|
--zen-appcontent-border: 1px solid var(--zen-colors-border);
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
border-radius: var(--border-radius-medium);
|
border-radius: var(--border-radius-medium);
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
|
|
||||||
border: 1px solid hsla(0, 0%, 100%, 0.1) !important;
|
border: none !important;
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
|
|
||||||
box-shadow: none !important;
|
box-shadow: none !important;
|
||||||
@@ -114,6 +114,7 @@
|
|||||||
|
|
||||||
#urlbar[breakout-extend='true'] #urlbar-background {
|
#urlbar[breakout-extend='true'] #urlbar-background {
|
||||||
box-shadow: 0px 0px 90px -10px rgba(0, 0, 0, 0.6) !important;
|
box-shadow: 0px 0px 90px -10px rgba(0, 0, 0, 0.6) !important;
|
||||||
|
border: 1px solid hsla(0, 0%, 100%, 0.1) !important;
|
||||||
backdrop-filter: none !important;
|
backdrop-filter: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -461,11 +461,9 @@
|
|||||||
max-height: var(--zen-workspace-indicator-height);
|
max-height: var(--zen-workspace-indicator-height);
|
||||||
min-height: var(--zen-workspace-indicator-height);
|
min-height: var(--zen-workspace-indicator-height);
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: row !important;
|
flex-direction: row !important;
|
||||||
|
max-width: 100%;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
border-radius: var(--border-radius-medium);
|
border-radius: var(--border-radius-medium);
|
||||||
@@ -495,6 +493,9 @@
|
|||||||
.zen-current-workspace-indicator-name {
|
.zen-current-workspace-indicator-name {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
display: block;
|
display: block;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -200,13 +200,17 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
const defaultSelectedContainer = document.querySelector(
|
const defaultSelectedContainer = document.querySelector(
|
||||||
`#tabbrowser-arrowscrollbox .zen-workspace-tabs-section[zen-workspace-id="${this.activeWorkspace}"]`
|
`#tabbrowser-arrowscrollbox .zen-workspace-tabs-section[zen-workspace-id="${this.activeWorkspace}"]`
|
||||||
);
|
);
|
||||||
|
const essentialsContaienr = document.getElementById('zen-essentials-container');
|
||||||
// New profile with no workspaces does not have a default selected container
|
// New profile with no workspaces does not have a default selected container
|
||||||
if (defaultSelectedContainer) {
|
if (defaultSelectedContainer) {
|
||||||
const pinnedContainer = document.querySelector(
|
const pinnedContainer = document.querySelector(
|
||||||
`#vertical-pinned-tabs-container .zen-workspace-tabs-section[zen-workspace-id="${this.activeWorkspace}"]`
|
`#vertical-pinned-tabs-container .zen-workspace-tabs-section[zen-workspace-id="${this.activeWorkspace}"]`
|
||||||
);
|
);
|
||||||
for (const tab of tabs) {
|
for (const tab of tabs) {
|
||||||
if (tab.pinned) {
|
if (tab.hasAttribute('zen-essential')) {
|
||||||
|
essentialsContaienr.appendChild(tab);
|
||||||
|
continue
|
||||||
|
} else if (tab.pinned) {
|
||||||
pinnedContainer.insertBefore(tab, pinnedContainer.lastChild);
|
pinnedContainer.insertBefore(tab, pinnedContainer.lastChild);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1923,7 +1927,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
const contaienr = document.querySelector(
|
const contaienr = document.querySelector(
|
||||||
`#vertical-pinned-tabs-container .zen-workspace-tabs-section[zen-workspace-id="${workspaceId}"]`
|
`#vertical-pinned-tabs-container .zen-workspace-tabs-section[zen-workspace-id="${workspaceId}"]`
|
||||||
);
|
);
|
||||||
console.log(tab);
|
|
||||||
contaienr.insertBefore(tab, contaienr.firstChild);
|
contaienr.insertBefore(tab, contaienr.firstChild);
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user