From f07387d12c7468581a4da6090d5c4da16f278ca7 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Fri, 30 Jan 2026 17:21:22 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20remove:=20demo=20mode=20from=20t?= =?UTF-8?q?odo,=20contacts,=20clock,=20questions,=20chat=20apps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Enforce login redirect for unauthenticated users - Remove demo banner, AuthGateModal, and GuestWelcomeModal - Remove guest mode state variables and CSS styles - Simplify showLogout to always show when user is logged in Affected apps: todo-web, contacts-web, clock-web, questions-web, chat-web --- .../web/src/routes/(protected)/+layout.svelte | 144 +++-------------- .../apps/web/src/routes/(app)/+layout.svelte | 137 +++------------- .../apps/web/src/routes/(app)/+layout.svelte | 134 ++-------------- .../apps/web/src/routes/(app)/+layout.svelte | 113 ++----------- .../apps/web/src/routes/(app)/+layout.svelte | 151 ++---------------- 5 files changed, 76 insertions(+), 603 deletions(-) diff --git a/apps/chat/apps/web/src/routes/(protected)/+layout.svelte b/apps/chat/apps/web/src/routes/(protected)/+layout.svelte index dcfee28bf..99b236a9e 100644 --- a/apps/chat/apps/web/src/routes/(protected)/+layout.svelte +++ b/apps/chat/apps/web/src/routes/(protected)/+layout.svelte @@ -24,11 +24,6 @@ import { getPillAppItems } from '@manacore/shared-branding'; import { getLanguageDropdownItems, getCurrentLanguageLabel } from '@manacore/shared-i18n'; import { setLocale, supportedLocales } from '$lib/i18n'; - import { - AuthGateModal, - GuestWelcomeModal, - shouldShowGuestWelcome, - } from '@manacore/shared-auth-ui'; import type { LayoutData } from './$types'; // App switcher items @@ -40,17 +35,6 @@ let isSidebarMode = $state(false); let isCollapsed = $state(false); - // Guest mode state - let showAuthGateModal = $state(false); - let authGateAction = $state<'save' | 'sync' | 'ai' | 'feature'>('ai'); - - // Guest welcome modal state - let showGuestWelcome = $state(false); - - // Check if in guest mode - let isGuestMode = $derived(!authStore.isAuthenticated); - let sessionConversationCount = $derived(sessionConversationsStore.count); - // Use theme store's isDark directly let isDark = $derived(theme.isDark); @@ -170,8 +154,15 @@ goto('/login'); } - // Initialize on mount - supports both authenticated and guest mode + // Initialize on mount - enforce login onMount(async () => { + // Initialize auth and redirect if not authenticated + await authStore.initialize(); + if (!authStore.isAuthenticated) { + goto('/login'); + return; + } + // Initialize theme theme.initialize(); @@ -189,27 +180,18 @@ collapsedStore.set(true); } - await authStore.initialize(); + // Load user settings + await userSettings.load(); - // Show guest welcome modal for unauthenticated users - if (!authStore.isAuthenticated && shouldShowGuestWelcome('chat')) { - showGuestWelcome = true; + // Check for session conversations to migrate + if (conversationsStore.hasSessionConversations) { + await conversationsStore.migrateSessionConversations(); } - // Load user settings if authenticated - if (authStore.isAuthenticated) { - await userSettings.load(); - - // Check for session conversations to migrate - if (conversationsStore.hasSessionConversations) { - await conversationsStore.migrateSessionConversations(); - } - - // Redirect to start page if on /chat and a custom start page is set - const currentPath = window.location.pathname; - if (currentPath === '/chat' && userSettings.startPage && userSettings.startPage !== '/chat') { - goto(userSettings.startPage, { replaceState: true }); - } + // Redirect to start page if on /chat and a custom start page is set + const currentPath = window.location.pathname; + if (currentPath === '/chat' && userSettings.startPage && userSettings.startPage !== '/chat') { + goto(userSettings.startPage, { replaceState: true }); } isChecking = false; @@ -229,22 +211,8 @@ {:else} - - {#if isGuestMode} -
- {/if} - -