fix: Fixed dropping tabs into the same instance, b=closes #12032, c=no-component

This commit is contained in:
mr. m
2026-01-26 01:47:54 +01:00
parent 950f6dfb66
commit a892721306
3 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..ab301a3a8e83727e5316c3af9eb43cdfc028a122 100644
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..2ab8633d0378e5a25cf75c50b29d4689b5f65e94 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -398,6 +398,7 @@
@@ -948,7 +948,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..ab301a3a8e83727e5316c3af9eb43cdf
* The new tab in the current window, null if the tab couldn't be adopted.
*/
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
+ if (window.gZenWorkspaces.currentWindowIsSyncing === aTab.ownerGlobal.gZenWorkspaces.currentWindowIsSyncing) {
+ if (window.gZenWorkspaces.currentWindowIsSyncing && aTab.ownerGlobal.gZenWorkspaces?.currentWindowIsSyncing) {
+ const tabId = aTab.id;
+ const thisTab = window.gZenWindowSync.getItemFromWindow(window, tabId);
+ if (thisTab) {

View File

@@ -975,11 +975,11 @@
(possibleFolderElement.collapsed ||
possibleFolderElement.childGroupsAndTabs.length < 2)));
if (
(isTabGroupLabel(draggedTab) &&
draggedTab.group?.isZenFolder &&
(isTab(dropElement) || dropElement.hasAttribute("split-view-group")) &&
isTabGroupLabel(draggedTab) &&
draggedTab.group?.isZenFolder &&
(((isTab(dropElement) || dropElement.hasAttribute("split-view-group")) &&
(!dropElement.pinned || dropElement.hasAttribute("zen-essential"))) ||
showIndicatorUnderNewTabButton
showIndicatorUnderNewTabButton)
) {
dropElement = null;
this.clearDragOverVisuals();

View File

@@ -165,6 +165,7 @@ export class nsZenSessionManager {
async readFile() {
let fileExists = await IOUtils.exists(this.#storeFilePath);
if (!fileExists) {
this.log("Session file does not exist, running migration", this.#storeFilePath);
this._shouldRunMigration = true;
}
this.init();
@@ -181,6 +182,7 @@ export class nsZenSessionManager {
}
this.#sidebar = this.#file.data || {};
if (!this.#sidebar.spaces?.length && !this._shouldRunMigration) {
this.log("No spaces data found in session file, running migration", this.#sidebar);
// If we have no spaces data, we should run migration
// to restore them from the database. Note we also do a
// check if we already planned to run migration for optimization.