From dabc869aeb52d204e766bfff42e4f25afc19d01a Mon Sep 17 00:00:00 2001 From: chriscrosstalk <49691103+chriscrosstalk@users.noreply.github.com> Date: Sun, 2 Aug 2026 12:25:29 -0700 Subject: [PATCH] fix(chat): open full chat in place instead of a new window (#1181) The chat modal's pop-out button called window.open('/chat', '_blank'). /chat is served by the admin app itself, so this spawned a second browser window for a same-origin internal route. That breaks anyone running NOMAD as an installed web app or in kiosk mode: clicking it leaves a stray window they then have to get back out of, which is exactly the complaint in #1123. Navigate with router.visit instead, and relabel the button from "Open in New Tab" to "Open Full Chat" so it describes what now happens. IconMessage isn't in the DynamicIcon registry (deliberately curated for tree-shaking), so use the already-registered IconArrowRight. Refs #1123 Co-authored-by: Claude Opus 5 (1M context) --- admin/inertia/components/chat/ChatSidebar.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/admin/inertia/components/chat/ChatSidebar.tsx b/admin/inertia/components/chat/ChatSidebar.tsx index b43c3ca..c6adf0a 100644 --- a/admin/inertia/components/chat/ChatSidebar.tsx +++ b/admin/inertia/components/chat/ChatSidebar.tsx @@ -117,18 +117,17 @@ export default function ChatSidebar({ Project NOMAD Logo { - if (isInModal) { - window.open('/chat', '_blank') - } else { - router.visit('/home') - } + // /chat is served by the admin app itself, so navigate in place rather than + // spawning a window. Popping out broke anyone running NOMAD as an installed + // web app or in kiosk mode, who then had a stray window to get back out of. + router.visit(isInModal ? '/chat' : '/home') }} - icon={isInModal ? 'IconExternalLink' : 'IconHome'} + icon={isInModal ? 'IconArrowRight' : 'IconHome'} variant="outline" size="sm" fullWidth > - {isInModal ? 'Open in New Tab' : 'Back to Home'} + {isInModal ? 'Open Full Chat' : 'Back to Home'} {