From 358f521bbb5b31ba7640d3cafa83c57b4f99aa86 Mon Sep 17 00:00:00 2001 From: Jake Howell Date: Sat, 28 Feb 2026 02:41:44 +1100 Subject: [PATCH] feat: implement error message on failure to popup (#22380) This change adds user-facing feedback when opening apps in a new window fails due to popup blocking, replacing a silent no-op with a clear recovery message. It improves reliability and supportability across app-launch flows by helping users immediately understand and fix the issue. --- site/src/modules/apps/apps.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/site/src/modules/apps/apps.ts b/site/src/modules/apps/apps.ts index 89effd4d2a..f1e001334b 100644 --- a/site/src/modules/apps/apps.ts +++ b/site/src/modules/apps/apps.ts @@ -3,6 +3,7 @@ import type { WorkspaceAgent, WorkspaceApp, } from "api/typesGenerated"; +import { toast } from "sonner"; // This is a magic undocumented string that is replaced // with a brand-new session token from the backend. @@ -79,7 +80,12 @@ export const getTerminalHref = ({ }; export const openAppInNewWindow = (href: string) => { - window.open(href, "_blank", "width=900,height=600"); + const popup = window.open(href, "_blank", "width=900,height=600"); + if (!popup) { + toast.error("Failed to open app in new window.", { + description: "Popup blocked. Allow popups to open this app.", + }); + } }; type GetAppHrefParams = {