Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix(chat): open full chat in place instead of a new window (#1181)

chriscrosstalkdabc869aeb52
diff --git a/admin/inertia/components/chat/ChatSidebar.tsx b/admin/inertia/components/chat/ChatSidebar.tsx
index b43c3ca3..c6adf0ab 100644
--- a/admin/inertia/components/chat/ChatSidebar.tsx
+++ b/admin/inertia/components/chat/ChatSidebar.tsx
@@ -117,18 +117,17 @@ export default function ChatSidebar({
<img src="/project_nomad_logo.webp" alt="Project NOMAD Logo" className="h-28 w-28 mb-6" />
<StyledButton
onClick={() => {
- 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'}
</StyledButton>
<StyledButton
onClick={() => {