|
254 | 254 | }
|
255 | 255 |
|
256 | 256 | if (pin.isGroup) {
|
257 |
| - const group = gZenFolders.createFolder([], { |
| 257 | + const tabs = []; |
| 258 | + // If there's already existing tabs, let's use them |
| 259 | + for (const [uuid, existingTab] of pinnedTabsByUUID) { |
| 260 | + const pinObject = this._pinsCache.find((p) => p.uuid === uuid); |
| 261 | + if (pinObject && pinObject.parentUuid === pin.uuid) { |
| 262 | + tabs.push(existingTab); |
| 263 | + } |
| 264 | + } |
| 265 | + const group = gZenFolders.createFolder(tabs, { |
258 | 266 | label: pin.title,
|
259 | 267 | collapsed: pin.isFolderCollapsed,
|
260 | 268 | initialPinId: pin.uuid,
|
|
981 | 989 | }
|
982 | 990 | movingTabs = [...movingTabs];
|
983 | 991 | try {
|
984 |
| - const pinnedTabsTarget = |
985 |
| - event.target.closest('.zen-workspace-pinned-tabs-section') || |
986 |
| - event.target.closest('.zen-current-workspace-indicator') || |
987 |
| - this._isGoingToPinnedTabs; |
| 992 | + const pinnedTabsTarget = this._isGoingToPinnedTabs; |
988 | 993 | const essentialTabsTarget = event.target.closest('.zen-essentials-container');
|
989 |
| - const tabsTarget = |
990 |
| - event.target.closest('.zen-workspace-normal-tabs-section') || !this._isGoingToPinnedTabs; |
| 994 | + const tabsTarget = !this._isGoingToPinnedTabs; |
991 | 995 |
|
992 | 996 | // TODO: Solve the issue of adding a tab between two groups
|
993 | 997 | // Remove group labels from the moving tabs and replace it
|
|
1158 | 1162 | continue;
|
1159 | 1163 | }
|
1160 | 1164 | }
|
1161 |
| - item.style.removeProperty('--zen-folder-indent'); |
| 1165 | + const itemToAnimate = item.group?.hasAttribute('split-view-group') ? item.group : item; |
| 1166 | + itemToAnimate.style.removeProperty('--zen-folder-indent'); |
1162 | 1167 | }
|
1163 | 1168 | this.removeTabContainersDragoverClass();
|
1164 | 1169 | }
|
|
1173 | 1178 | : [separator];
|
1174 | 1179 | }
|
1175 | 1180 |
|
1176 |
| - animateSeparatorMove(draggedTab, dropElement, isPinned, event) { |
| 1181 | + animateSeparatorMove(movingTabs, dropElement, isPinned, event) { |
| 1182 | + let draggedTab = movingTabs[0]; |
1177 | 1183 | if (gBrowser.isTabGroupLabel(draggedTab) && draggedTab.group.isZenFolder) {
|
1178 | 1184 | return;
|
1179 | 1185 | }
|
|
1182 | 1188 | }
|
1183 | 1189 | const itemsToCheck = this.dragShiftableItems;
|
1184 | 1190 | const translate = event.screenY;
|
1185 |
| - const draggingTabHeight = window.windowUtils.getBoundsWithoutFlushing(draggedTab).height; |
| 1191 | + const draggingTabHeight = movingTabs.reduce((acc, item) => { |
| 1192 | + return acc + window.windowUtils.getBoundsWithoutFlushing(item).height; |
| 1193 | + }, 0); |
1186 | 1194 | let topToNormalTabs = itemsToCheck[0].screenY;
|
1187 | 1195 | if (!isPinned) {
|
1188 | 1196 | topToNormalTabs += draggedTab.getBoundingClientRect().height;
|
|
0 commit comments