diff --git a/src-tauri/src/vault/getting_started.rs b/src-tauri/src/vault/getting_started.rs index 23cd8a12..e63c1efc 100644 --- a/src-tauri/src/vault/getting_started.rs +++ b/src-tauri/src/vault/getting_started.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; /// Default location for the Getting Started vault. pub fn default_vault_path() -> Result { dirs::document_dir() - .map(|d| d.join("Laputa")) + .map(|d| d.join("Getting Started")) .ok_or_else(|| "Could not determine Documents directory".to_string()) } @@ -423,7 +423,7 @@ mod tests { let path = default_vault_path().unwrap(); let path_str = path.to_string_lossy(); assert!(path_str.contains("Documents")); - assert!(path_str.ends_with("Laputa")); + assert!(path_str.ends_with("Getting Started")); } #[test] diff --git a/src/App.test.tsx b/src/App.test.tsx index 7bf6d7b7..bff1eaf9 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -71,7 +71,7 @@ const mockCommandResults: Record = { git_pull: { status: 'up_to_date', message: 'Already up to date', updatedFiles: [], conflictFiles: [] }, save_settings: null, check_vault_exists: true, - get_default_vault_path: '/Users/mock/Documents/Laputa', + get_default_vault_path: '/Users/mock/Documents/Getting Started', list_themes: [], get_vault_settings: { theme: null }, } diff --git a/src/hooks/useOnboarding.test.ts b/src/hooks/useOnboarding.test.ts index 94e22282..2558f88d 100644 --- a/src/hooks/useOnboarding.test.ts +++ b/src/hooks/useOnboarding.test.ts @@ -35,7 +35,7 @@ describe('useOnboarding', () => { it('transitions to ready when vault exists', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return true return null }) @@ -50,7 +50,7 @@ describe('useOnboarding', () => { it('shows welcome screen when vault does not exist', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false return null }) @@ -60,14 +60,14 @@ describe('useOnboarding', () => { await waitFor(() => { expect(result.current.state.status).toBe('welcome') }) - expect(result.current.state).toEqual({ status: 'welcome', defaultPath: '/mock/Documents/Laputa' }) + expect(result.current.state).toEqual({ status: 'welcome', defaultPath: '/mock/Documents/Getting Started' }) }) it('shows vault-missing when previously dismissed and vault gone', async () => { localStorage.setItem('laputa_welcome_dismissed', '1') mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false return null }) @@ -80,15 +80,15 @@ describe('useOnboarding', () => { expect(result.current.state).toEqual({ status: 'vault-missing', vaultPath: '/vault/deleted', - defaultPath: '/mock/Documents/Laputa', + defaultPath: '/mock/Documents/Getting Started', }) }) it('handleCreateVault creates vault and transitions to ready', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false - if (cmd === 'create_getting_started_vault') return '/mock/Documents/Laputa' + if (cmd === 'create_getting_started_vault') return '/mock/Documents/Getting Started' return null }) @@ -102,13 +102,13 @@ describe('useOnboarding', () => { await result.current.handleCreateVault() }) - expect(result.current.state).toEqual({ status: 'ready', vaultPath: '/mock/Documents/Laputa' }) + expect(result.current.state).toEqual({ status: 'ready', vaultPath: '/mock/Documents/Getting Started' }) expect(localStorage.getItem('laputa_welcome_dismissed')).toBe('1') }) it('handleCreateVault sets error on failure', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false if (cmd === 'create_getting_started_vault') throw 'Permission denied' return null @@ -130,7 +130,7 @@ describe('useOnboarding', () => { it('handleOpenFolder opens folder picker and transitions to ready', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false return null }) @@ -152,7 +152,7 @@ describe('useOnboarding', () => { it('handleOpenFolder does nothing when picker is cancelled', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false return null }) @@ -173,7 +173,7 @@ describe('useOnboarding', () => { it('handleDismiss marks dismissed and transitions to ready', async () => { mockInvokeFn.mockImplementation(async (cmd: string) => { - if (cmd === 'get_default_vault_path') return '/mock/Documents/Laputa' + if (cmd === 'get_default_vault_path') return '/mock/Documents/Getting Started' if (cmd === 'check_vault_exists') return false return null }) diff --git a/src/hooks/useVaultSwitcher.ts b/src/hooks/useVaultSwitcher.ts index bba46f69..de833300 100644 --- a/src/hooks/useVaultSwitcher.ts +++ b/src/hooks/useVaultSwitcher.ts @@ -1,16 +1,10 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react' -import { isTauri } from '../mock-tauri' import { pickFolder } from '../utils/vault-dialog' import type { VaultOption } from '../components/StatusBar' -export const DEFAULT_VAULTS: VaultOption[] = isTauri() - ? [ - { label: 'Demo v2', path: '/Users/luca/Workspace/laputa-app/demo-vault-v2' }, - { label: 'Laputa', path: '/Users/luca/Laputa' }, - ] - : [ - { label: 'Demo v2', path: '/Users/luca/Workspace/laputa-app/demo-vault-v2' }, - ] +export const DEFAULT_VAULTS: VaultOption[] = [ + { label: 'Getting Started', path: '/Users/luca/Workspace/laputa-app/demo-vault-v2' }, +] interface UseVaultSwitcherOptions { onSwitch: () => void diff --git a/src/mock-tauri/mock-handlers.ts b/src/mock-tauri/mock-handlers.ts index 38514e59..d8867c1d 100644 --- a/src/mock-tauri/mock-handlers.ts +++ b/src/mock-tauri/mock-handlers.ts @@ -245,12 +245,12 @@ export const mockHandlers: Record any> = { })) return { results: matches, elapsed_ms: 42, query: q, mode: args.mode } }, - get_default_vault_path: () => '/Users/mock/Documents/Laputa', + get_default_vault_path: () => '/Users/mock/Documents/Getting Started', check_vault_exists: (args: { path: string }) => { // In mock mode, the demo-vault-v2 path always "exists" return args.path.includes('demo-vault-v2') }, - create_getting_started_vault: () => '/Users/mock/Documents/Laputa', + create_getting_started_vault: () => '/Users/mock/Documents/Getting Started', register_mcp_tools: () => 'registered', list_themes: (): ThemeFile[] => [...mockThemes], get_theme: (args: { themeId: string }): ThemeFile => {