From 346aa1ff9acffd5d634f7cc718d650659120bdf9 Mon Sep 17 00:00:00 2001 From: Ashvin Jangid <142579833+ashvwinn@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:35:10 +0530 Subject: [PATCH] gh-14766: prevent space routing toast for tabs routed to current space (gh-14504) --- src/zen/compact-mode/ZenCompactMode.mjs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 7ba505ac6..e33c5d4e7 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -977,6 +977,14 @@ window.gZenCompactModeManager = { !gZenGlanceManager._animating && !this._nextTimeWillBeActive ) { + const isTabRoutedToCurrentSpace = + beforeRouteResult.targetRoute === gZenWorkspaces.activeWorkspace; + // Do not show the toast if the sidebar is not hidden and + // the tab is being routed to the current space + if (!isSidebarHidden && isTabRoutedToCurrentSpace) { + return; + } + let messageId = "zen-background-tab-opened-toast"; let toastOptions = { button: { @@ -988,7 +996,7 @@ window.gZenCompactModeManager = { }, }; - if (beforeRouteResult.isRouteFound) { + if (beforeRouteResult.isRouteFound && !isTabRoutedToCurrentSpace) { messageId = "zen-space-routing-tab-routed-toast"; toastOptions = { l10nArgs: { targetWorkspace: beforeRouteResult.targetWorkspaceName },