diff --git a/webclient/package-lock.json b/webclient/package-lock.json index 69ea87e..9b6ce06 100644 --- a/webclient/package-lock.json +++ b/webclient/package-lock.json @@ -13,7 +13,6 @@ "marked": "^15.0.12", "pinia": "^3.0.2", "vue": "^3.5.13", - "vue-router": "^4.6.4", "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { @@ -3046,27 +3045,6 @@ "dev": true, "license": "MIT" }, - "node_modules/vue-router": { - "version": "4.6.4", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz", - "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", - "license": "MIT", - "dependencies": { - "@vue/devtools-api": "^6.6.4" - }, - "funding": { - "url": "https://github.com/sponsors/posva" - }, - "peerDependencies": { - "vue": "^3.5.0" - } - }, - "node_modules/vue-router/node_modules/@vue/devtools-api": { - "version": "6.6.4", - "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", - "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", - "license": "MIT" - }, "node_modules/vue-virtual-scroller": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/vue-virtual-scroller/-/vue-virtual-scroller-2.0.1.tgz", diff --git a/webclient/package.json b/webclient/package.json index 4dd4ee9..8c82494 100644 --- a/webclient/package.json +++ b/webclient/package.json @@ -15,7 +15,6 @@ "marked": "^15.0.12", "pinia": "^3.0.2", "vue": "^3.5.13", - "vue-router": "^4.6.4", "vue-virtual-scroller": "^2.0.0-beta.8" }, "devDependencies": { diff --git a/webclient/src/App.vue b/webclient/src/App.vue index 0dd5c28..bda513a 100644 --- a/webclient/src/App.vue +++ b/webclient/src/App.vue @@ -33,7 +33,19 @@
- + + + +
-import { ref, onMounted } from 'vue' +import { ref, computed, onMounted } from 'vue' import { useSessionsStore } from '@/stores/sessions' import { useProfilesStore } from '@/stores/profiles' import { useChatStore } from '@/stores/chat' @@ -61,6 +73,8 @@ import SelectionToolbar from '@/components/ui/SelectionToolbar.vue' import ArtifactsPanel from '@/components/artifacts/ArtifactsPanel.vue' import LoginScreen from '@/components/ui/LoginScreen.vue' +import WelcomeScreen from '@/components/ui/WelcomeScreen.vue' +import ChatArea from '@/components/chat/ChatArea.vue' const sessionsStore = useSessionsStore() const profilesStore = useProfilesStore() @@ -70,6 +84,10 @@ const sidebarOpen = ref(false) const artifactsOpen = ref(false) +const showWelcome = computed( + () => (sessionsStore.sessions.length === 0 || chatStore.currentId === null) && !sessionsStore.loading +) + function closeSidebar() { sidebarOpen.value = false } @@ -92,32 +110,41 @@ onMounted(async () => { // Check auth configuration first, before any protected API calls - console.log('[app] fetchStatus start') await authStore.fetchStatus() - console.log('[app] fetchStatus done, authConfigured=', authStore.authConfigured) // Resolve auth state try { - console.log('[app] fetchMe start') await authStore.fetchMe() - console.log('[app] fetchMe done, isAuthenticated=', authStore.isAuthenticated) } catch { - console.log('[app] fetchMe failed (unauthenticated)') + // unauthenticated — LoginScreen will show if auth is configured } - console.log('[app] should show login?', authStore.authConfigured, !authStore.isAuthenticated, !authStore.loading) - // Load app data only if authenticated or auth is not configured if (!authStore.authConfigured || authStore.isAuthenticated) { try { await profilesStore.fetchProfiles() await sessionsStore.fetchSessions(profilesStore.selectedProfileId) - } catch (err) { - console.log('[app] data fetch error', err) + } catch { + // ignore } } }) +// Hash-based routing for session IDs +window.addEventListener('hashchange', () => { + const hash = location.hash + const id = hash.slice(1) + if (id && id !== chatStore.currentId) { + chatStore.loadSession(id) + } +}) + +// Load session from initial hash on page load +if (location.hash) { + const id = location.hash.slice(1) + if (id) chatStore.loadSession(id) +} +