mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
fix: Fixed restoring folders when session restore is disabled, b=no-bug, c=tabs, folders
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
|
||||
index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..ddb0735916c1cd29f316b2e66a95c765a933362d 100644
|
||||
index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..1cd2e9f24b3be1717493b4e663bc41d784cc9da0 100644
|
||||
--- a/browser/components/tabbrowser/content/tabs.js
|
||||
+++ b/browser/components/tabbrowser/content/tabs.js
|
||||
@@ -289,6 +289,7 @@
|
||||
@@ -435,7 +435,7 @@ index 1fcebe3962398ff1b7cadef657ac8b68a80e720d..ddb0735916c1cd29f316b2e66a95c765
|
||||
|
||||
let dropElement = getOverlappedElement();
|
||||
+ if (dropElement?.hasAttribute("split-view-group")) dropElement = dropElement.labelElement;
|
||||
+ gZenPinnedTabManager.animateSeparatorMove(draggedTab, dropElement, isPinned, event);
|
||||
+ gZenPinnedTabManager.animateSeparatorMove(movingTabs, dropElement, isPinned, event);
|
||||
|
||||
let newDropElementIndex;
|
||||
if (dropElement) {
|
||||
|
@@ -17,6 +17,12 @@ tab-group[split-view-group] {
|
||||
transparent 40%
|
||||
);
|
||||
|
||||
margin-inline-start: var(--zen-folder-indent) !important;
|
||||
|
||||
#tabbrowser-tabs[movingtab] & {
|
||||
transition: margin-inline-start 0.15s ease-in-out;
|
||||
}
|
||||
|
||||
& .tab-group-container {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
@@ -48,6 +54,7 @@ tab-group[split-view-group] {
|
||||
--tab-selected-shadow: none;
|
||||
--border-radius-medium: var(--tab-border-radius);
|
||||
--zen-active-tab-scale: 1;
|
||||
--zen-folder-indent: 0 !important;
|
||||
|
||||
:root[zen-sidebar-expanded='true'] & {
|
||||
--tab-min-height: 28px;
|
||||
@@ -94,7 +101,6 @@ tab-group[split-view-group] {
|
||||
|
||||
& > .tabbrowser-tab {
|
||||
--tab-hover-background-color: var(--zen-split-view-active-tab-bg);
|
||||
--zen-folder-indent: 0 !important;
|
||||
& .tab-background {
|
||||
background-color: var(--zen-split-view-active-tab-bg) !important;
|
||||
}
|
||||
|
@@ -254,7 +254,15 @@
|
||||
}
|
||||
|
||||
if (pin.isGroup) {
|
||||
const group = gZenFolders.createFolder([], {
|
||||
const tabs = [];
|
||||
// If there's already existing tabs, let's use them
|
||||
for (const [uuid, existingTab] of pinnedTabsByUUID) {
|
||||
const pinObject = this._pinsCache.find((p) => p.uuid === uuid);
|
||||
if (pinObject && pinObject.parentUuid === pin.uuid) {
|
||||
tabs.push(existingTab);
|
||||
}
|
||||
}
|
||||
const group = gZenFolders.createFolder(tabs, {
|
||||
label: pin.title,
|
||||
collapsed: pin.isFolderCollapsed,
|
||||
initialPinId: pin.uuid,
|
||||
@@ -981,13 +989,9 @@
|
||||
}
|
||||
movingTabs = [...movingTabs];
|
||||
try {
|
||||
const pinnedTabsTarget =
|
||||
event.target.closest('.zen-workspace-pinned-tabs-section') ||
|
||||
event.target.closest('.zen-current-workspace-indicator') ||
|
||||
this._isGoingToPinnedTabs;
|
||||
const pinnedTabsTarget = this._isGoingToPinnedTabs;
|
||||
const essentialTabsTarget = event.target.closest('.zen-essentials-container');
|
||||
const tabsTarget =
|
||||
event.target.closest('.zen-workspace-normal-tabs-section') || !this._isGoingToPinnedTabs;
|
||||
const tabsTarget = !this._isGoingToPinnedTabs;
|
||||
|
||||
// TODO: Solve the issue of adding a tab between two groups
|
||||
// Remove group labels from the moving tabs and replace it
|
||||
@@ -1158,7 +1162,8 @@
|
||||
continue;
|
||||
}
|
||||
}
|
||||
item.style.removeProperty('--zen-folder-indent');
|
||||
const itemToAnimate = item.group?.hasAttribute('split-view-group') ? item.group : item;
|
||||
itemToAnimate.style.removeProperty('--zen-folder-indent');
|
||||
}
|
||||
this.removeTabContainersDragoverClass();
|
||||
}
|
||||
@@ -1173,7 +1178,8 @@
|
||||
: [separator];
|
||||
}
|
||||
|
||||
animateSeparatorMove(draggedTab, dropElement, isPinned, event) {
|
||||
animateSeparatorMove(movingTabs, dropElement, isPinned, event) {
|
||||
let draggedTab = movingTabs[0];
|
||||
if (gBrowser.isTabGroupLabel(draggedTab) && draggedTab.group.isZenFolder) {
|
||||
return;
|
||||
}
|
||||
@@ -1182,7 +1188,9 @@
|
||||
}
|
||||
const itemsToCheck = this.dragShiftableItems;
|
||||
const translate = event.screenY;
|
||||
const draggingTabHeight = window.windowUtils.getBoundsWithoutFlushing(draggedTab).height;
|
||||
const draggingTabHeight = movingTabs.reduce((acc, item) => {
|
||||
return acc + window.windowUtils.getBoundsWithoutFlushing(item).height;
|
||||
}, 0);
|
||||
let topToNormalTabs = itemsToCheck[0].screenY;
|
||||
if (!isPinned) {
|
||||
topToNormalTabs += draggedTab.getBoundingClientRect().height;
|
||||
|
Reference in New Issue
Block a user