From 16081095e00dbbb52cd8106886b84d70ca97eeb9 Mon Sep 17 00:00:00 2001 From: Jake Date: Wed, 13 May 2026 12:10:50 +0100 Subject: [PATCH] =?UTF-8?q?agent:=20lumotia-rebrand=20=E2=80=94=20localSto?= =?UTF-8?q?rage=20keys=20+=20event=20channels=20migration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 7 of the rebrand cascade. Persisted UI state + inter-window event channels migrated from magnotia to lumotia naming, with one-shot localStorage key migration so dogfooded UI state survives the rename. src/lib/utils/localStorageMigration.ts (new): - migrateLocalStorageKey(old, new): idempotent + crash-safe shim. - If new key exists, removes old (lumotia value is authoritative). - If only old exists, copies value to new key, removes old. - If neither, no-op. - migrateLocalStorageKeys(pairs): batch wrapper. src/lib/stores/page.svelte.ts: - 4 key constants renamed to lumotia_settings / lumotia_profiles / lumotia_task_lists / lumotia_templates. - BroadcastChannel name renamed to lumotia_task_lists. - migrateLocalStorageKeys() called at module load before any read. src/lib/stores/focusTimer.svelte.ts: - STORAGE_KEY renamed to lumotia.focusTimer.v1. - migrateLocalStorageKey() called at module load. Event channels (magnotia: -> lumotia:) renamed across frontend + Rust: - magnotia:toggle-recording (src/routes/+layout.svelte) - magnotia:hotkey-pressed / -released (src-tauri/src/commands/hotkey.rs + consumers) - magnotia:open-wind-down (src-tauri/src/tray.rs + consumer) - magnotia:llm-download-progress (src-tauri/src/commands/llm.rs) - magnotia:preferences-changed (src/lib/stores/preferences.svelte.ts + consumers) - magnotia:start-timer (nudgeBus + dispatch sites) - magnotia:focus-timer-{complete,cancelled} (focusTimer + nudgeBus) - magnotia:microstep-generated (nudgeBus + dispatch sites) - magnotia:step-completed (nudgeBus + dispatch sites) - magnotia:task-{completed,uncompleted,deleted} (page.svelte.ts + nudgeBus + consumers) Storage-event filters in src/routes/{float,viewer,preview}/+layout@.svelte updated to filter on lumotia_settings. User-facing toast strings still say "Magnotia" — deferred to Phase 8 (frontend strings). npm run check: 0 errors / 0 warnings (3958 files). cargo test --workspace: 339 pass / 0 fail. Co-Authored-By: Claude Opus 4.7 (1M context) --- src-tauri/src/commands/hotkey.rs | 8 ++-- src-tauri/src/commands/llm.rs | 2 +- src-tauri/src/tray.rs | 2 +- src/lib/components/FocusTimer.svelte | 4 +- src/lib/components/MicroSteps.svelte | 6 +-- src/lib/components/MorningTriageModal.svelte | 2 +- src/lib/components/WipTaskList.svelte | 2 +- src/lib/pages/DictationPage.svelte | 4 +- src/lib/pages/SettingsPage.svelte | 2 +- src/lib/stores/completionStats.svelte.ts | 8 ++-- src/lib/stores/focusTimer.svelte.ts | 11 +++-- .../stores/implementationIntentions.svelte.ts | 12 ++--- src/lib/stores/nudgeBus.svelte.ts | 24 +++++----- src/lib/stores/page.svelte.ts | 27 +++++++---- src/lib/stores/preferences.svelte.ts | 2 +- src/lib/utils/localStorageMigration.ts | 48 +++++++++++++++++++ src/lib/utils/settingsMigrations.ts | 2 +- src/routes/+layout.svelte | 8 ++-- src/routes/float/+layout@.svelte | 2 +- src/routes/preview/+layout@.svelte | 2 +- src/routes/viewer/+layout@.svelte | 2 +- 21 files changed, 122 insertions(+), 58 deletions(-) create mode 100644 src/lib/utils/localStorageMigration.ts diff --git a/src-tauri/src/commands/hotkey.rs b/src-tauri/src/commands/hotkey.rs index 547d01e..2ce91d6 100644 --- a/src-tauri/src/commands/hotkey.rs +++ b/src-tauri/src/commands/hotkey.rs @@ -33,8 +33,8 @@ pub fn check_hotkey_access() -> Result<(), String> { lumotia_hotkey::check_evdev_access() } -/// Start the evdev global hotkey listener. Emits "magnotia:hotkey-pressed" and -/// "magnotia:hotkey-released" events to the frontend. +/// Start the evdev global hotkey listener. Emits "lumotia:hotkey-pressed" and +/// "lumotia:hotkey-released" events to the frontend. /// /// If a listener is already running, it is stopped first. #[tauri::command] @@ -64,10 +64,10 @@ pub async fn start_evdev_hotkey( while let Some(event) = event_rx.recv().await { match event { HotkeyEvent::Pressed => { - let _ = app_clone.emit("magnotia:hotkey-pressed", ()); + let _ = app_clone.emit("lumotia:hotkey-pressed", ()); } HotkeyEvent::Released => { - let _ = app_clone.emit("magnotia:hotkey-released", ()); + let _ = app_clone.emit("lumotia:hotkey-released", ()); } } } diff --git a/src-tauri/src/commands/llm.rs b/src-tauri/src/commands/llm.rs index a3f03bb..1b8b109 100644 --- a/src-tauri/src/commands/llm.rs +++ b/src-tauri/src/commands/llm.rs @@ -74,7 +74,7 @@ pub async fn download_llm_model( 0 }; let _ = app_clone.emit( - "magnotia:llm-download-progress", + "lumotia:llm-download-progress", serde_json::json!({ "modelId": id.as_str(), "done": done, diff --git a/src-tauri/src/tray.rs b/src-tauri/src/tray.rs index e387cc5..f7ac356 100644 --- a/src-tauri/src/tray.rs +++ b/src-tauri/src/tray.rs @@ -48,7 +48,7 @@ pub fn setup(app: &tauri::App) -> Result<(), Box> { } // The frontend layout listens for this event and routes // to the Phase 5 wind-down page. - let _ = app.emit("magnotia:open-wind-down", ()); + let _ = app.emit("lumotia:open-wind-down", ()); } "quit" => { app.exit(0); diff --git a/src/lib/components/FocusTimer.svelte b/src/lib/components/FocusTimer.svelte index 431675b..fd0fc53 100644 --- a/src/lib/components/FocusTimer.svelte +++ b/src/lib/components/FocusTimer.svelte @@ -77,13 +77,13 @@ } onMount(() => { - window.addEventListener("magnotia:start-timer", handleStartEvent); + window.addEventListener("lumotia:start-timer", handleStartEvent); // Rehydrate any in-flight timer that survived a window close. focusTimer.rehydrate(); }); onDestroy(() => { - window.removeEventListener("magnotia:start-timer", handleStartEvent); + window.removeEventListener("lumotia:start-timer", handleStartEvent); }); function handleCancel() { diff --git a/src/lib/components/MicroSteps.svelte b/src/lib/components/MicroSteps.svelte index 7d10ea1..dbf17fc 100644 --- a/src/lib/components/MicroSteps.svelte +++ b/src/lib/components/MicroSteps.svelte @@ -58,7 +58,7 @@ // is completed in that window, a gentle "still with that one?" // nudge fires. if (typeof window !== 'undefined') { - window.dispatchEvent(new CustomEvent('magnotia:microstep-generated', { + window.dispatchEvent(new CustomEvent('lumotia:microstep-generated', { detail: { parentTaskId }, })); } @@ -78,7 +78,7 @@ // micro-step-idle timer for this parent task — the breakdown // is demonstrably getting worked, no nudge needed. if (typeof window !== 'undefined') { - window.dispatchEvent(new CustomEvent('magnotia:step-completed', { + window.dispatchEvent(new CustomEvent('lumotia:step-completed', { detail: { id: subtaskId, parentTaskId }, })); } @@ -86,7 +86,7 @@ } function startTimer(subtaskId: string) { - window.dispatchEvent(new CustomEvent('magnotia:start-timer', { + window.dispatchEvent(new CustomEvent('lumotia:start-timer', { detail: { taskId: subtaskId, seconds: 120 } })); } diff --git a/src/lib/components/MorningTriageModal.svelte b/src/lib/components/MorningTriageModal.svelte index 0cf4363..b1a6a89 100644 --- a/src/lib/components/MorningTriageModal.svelte +++ b/src/lib/components/MorningTriageModal.svelte @@ -67,7 +67,7 @@ function dispatchTriageFinished(mode: 'empty' | 'skipped' | 'picked') { if (typeof window === 'undefined') return; - window.dispatchEvent(new CustomEvent('magnotia:morning-triage-finished', { + window.dispatchEvent(new CustomEvent('lumotia:morning-triage-finished', { detail: { date: todayKey(), mode }, })); } diff --git a/src/lib/components/WipTaskList.svelte b/src/lib/components/WipTaskList.svelte index 442af36..a51ce84 100644 --- a/src/lib/components/WipTaskList.svelte +++ b/src/lib/components/WipTaskList.svelte @@ -5,7 +5,7 @@ import { ChevronDown, ChevronRight, Timer } from 'lucide-svelte'; function startFocusTimer(task: { id: string; text: string }) { - window.dispatchEvent(new CustomEvent('magnotia:start-timer', { + window.dispatchEvent(new CustomEvent('lumotia:start-timer', { detail: { taskId: task.id, seconds: 300, label: task.text } })); } diff --git a/src/lib/pages/DictationPage.svelte b/src/lib/pages/DictationPage.svelte index 53d4d82..6939641 100644 --- a/src/lib/pages/DictationPage.svelte +++ b/src/lib/pages/DictationPage.svelte @@ -65,7 +65,7 @@ let hotkeyHandler = () => toggleRecording(); onMount(async () => { - window.addEventListener("magnotia:toggle-recording", hotkeyHandler); + window.addEventListener("lumotia:toggle-recording", hotkeyHandler); if (!tauriRuntimeAvailable) { error = browserPreviewMessage; @@ -77,7 +77,7 @@ }); onDestroy(() => { - window.removeEventListener("magnotia:toggle-recording", hotkeyHandler); + window.removeEventListener("lumotia:toggle-recording", hotkeyHandler); clearInterval(timerInterval); if (page.recording) { page.recording = false; diff --git a/src/lib/pages/SettingsPage.svelte b/src/lib/pages/SettingsPage.svelte index 76a5aec..b26ca8d 100644 --- a/src/lib/pages/SettingsPage.svelte +++ b/src/lib/pages/SettingsPage.svelte @@ -870,7 +870,7 @@ downloadTotal = event.payload.total_bytes ?? event.payload.total ?? 0; }); - unlistenLlm = await listen("magnotia:llm-download-progress", (event) => { + unlistenLlm = await listen("lumotia:llm-download-progress", (event) => { llmDownloadProgress = event.payload.percent || 0; llmDownloadingModel = event.payload.modelId || llmDownloadingModel; llmDownloadBytes = event.payload.done ?? 0; diff --git a/src/lib/stores/completionStats.svelte.ts b/src/lib/stores/completionStats.svelte.ts index c934ceb..003e8de 100644 --- a/src/lib/stores/completionStats.svelte.ts +++ b/src/lib/stores/completionStats.svelte.ts @@ -47,10 +47,10 @@ if (typeof window !== "undefined") { const handler = () => { refresh().catch(() => {}); }; - window.addEventListener("magnotia:task-completed", handler); - window.addEventListener("magnotia:step-completed", handler); - window.addEventListener("magnotia:task-uncompleted", handler); - window.addEventListener("magnotia:task-deleted", handler); + window.addEventListener("lumotia:task-completed", handler); + window.addEventListener("lumotia:step-completed", handler); + window.addEventListener("lumotia:task-uncompleted", handler); + window.addEventListener("lumotia:task-deleted", handler); window.addEventListener("focus", handler); if (hasTauriRuntime()) { diff --git a/src/lib/stores/focusTimer.svelte.ts b/src/lib/stores/focusTimer.svelte.ts index abd0ad8..fd21739 100644 --- a/src/lib/stores/focusTimer.svelte.ts +++ b/src/lib/stores/focusTimer.svelte.ts @@ -12,9 +12,14 @@ // so closing the window mid-timer still gets you the "done" signal // on next launch. -const STORAGE_KEY = "magnotia.focusTimer.v1"; +import { migrateLocalStorageKey } from "$lib/utils/localStorageMigration"; + +const STORAGE_KEY = "lumotia.focusTimer.v1"; const TICK_INTERVAL_MS = 250; +// One-shot key rename from the magnotia era. Idempotent. +migrateLocalStorageKey("magnotia.focusTimer.v1", STORAGE_KEY); + export type FocusTimerPersisted = { startedAt: number; durationMs: number; @@ -114,7 +119,7 @@ function createFocusTimerStore() { writePersisted(null); stopTick(); if (wasActive && typeof window !== "undefined") { - window.dispatchEvent(new CustomEvent("magnotia:focus-timer-cancelled")); + window.dispatchEvent(new CustomEvent("lumotia:focus-timer-cancelled")); } } @@ -172,7 +177,7 @@ function createFocusTimerStore() { osc.onended = () => ctx.close().catch(() => {}); } catch { /* audio is a nicety; never fatal */ } - window.dispatchEvent(new CustomEvent("magnotia:focus-timer-complete", { + window.dispatchEvent(new CustomEvent("lumotia:focus-timer-complete", { detail: { taskId, label }, })); } diff --git a/src/lib/stores/implementationIntentions.svelte.ts b/src/lib/stores/implementationIntentions.svelte.ts index 67015be..1acee1b 100644 --- a/src/lib/stores/implementationIntentions.svelte.ts +++ b/src/lib/stores/implementationIntentions.svelte.ts @@ -13,7 +13,7 @@ import { page, settings, tasks } from "$lib/stores/page.svelte.js"; import { toasts } from "$lib/stores/toasts.svelte.js"; const TIME_RULE_POLL_MS = 30_000; -const RULES_CHANGED_EVENT = "magnotia:implementation-rules-changed"; +const RULES_CHANGED_EVENT = "lumotia:implementation-rules-changed"; export const implementationRules = $state([]); @@ -157,7 +157,7 @@ async function executeAction(action: ImplementationRuleAction): Promise { return; } if (action.kind === "start_timer") { - window.dispatchEvent(new CustomEvent("magnotia:start-timer", { + window.dispatchEvent(new CustomEvent("lumotia:start-timer", { detail: { taskId: action.taskId ?? null, seconds: 300, @@ -239,8 +239,8 @@ export function startImplementationIntentions(): void { void loadImplementationRules(true) .then(() => checkTimeRules()) .catch(() => {}); - window.addEventListener("magnotia:task-completed", onTaskCompleted); - window.addEventListener("magnotia:morning-triage-finished", onMorningTriageFinished); + window.addEventListener("lumotia:task-completed", onTaskCompleted); + window.addEventListener("lumotia:morning-triage-finished", onMorningTriageFinished); window.addEventListener(RULES_CHANGED_EVENT, onRulesChanged); timePollHandle = setInterval(() => { void checkTimeRules().catch(() => {}); @@ -250,8 +250,8 @@ export function startImplementationIntentions(): void { export function stopImplementationIntentions(): void { if (!started) return; started = false; - window.removeEventListener("magnotia:task-completed", onTaskCompleted); - window.removeEventListener("magnotia:morning-triage-finished", onMorningTriageFinished); + window.removeEventListener("lumotia:task-completed", onTaskCompleted); + window.removeEventListener("lumotia:morning-triage-finished", onMorningTriageFinished); window.removeEventListener(RULES_CHANGED_EVENT, onRulesChanged); if (timePollHandle !== null) { clearInterval(timePollHandle); diff --git a/src/lib/stores/nudgeBus.svelte.ts b/src/lib/stores/nudgeBus.svelte.ts index 3c5f45d..8fd1e85 100644 --- a/src/lib/stores/nudgeBus.svelte.ts +++ b/src/lib/stores/nudgeBus.svelte.ts @@ -236,12 +236,12 @@ export function startNudgeBus(): void { if (typeof window === "undefined") return; started = true; - window.addEventListener("magnotia:start-timer", onTimerStart); - window.addEventListener("magnotia:focus-timer-complete", resetTimerState); - window.addEventListener("magnotia:focus-timer-cancelled", resetTimerState); - window.addEventListener("magnotia:microstep-generated", onMicroStepGenerated); - window.addEventListener("magnotia:step-completed", onStepOrTaskCompleted); - window.addEventListener("magnotia:task-completed", onStepOrTaskCompleted); + window.addEventListener("lumotia:start-timer", onTimerStart); + window.addEventListener("lumotia:focus-timer-complete", resetTimerState); + window.addEventListener("lumotia:focus-timer-cancelled", resetTimerState); + window.addEventListener("lumotia:microstep-generated", onMicroStepGenerated); + window.addEventListener("lumotia:step-completed", onStepOrTaskCompleted); + window.addEventListener("lumotia:task-completed", onStepOrTaskCompleted); window.addEventListener("focus", onFocus); window.addEventListener("blur", onBlur); @@ -265,12 +265,12 @@ export function stopNudgeBus(): void { if (!started) return; started = false; - window.removeEventListener("magnotia:start-timer", onTimerStart); - window.removeEventListener("magnotia:focus-timer-complete", resetTimerState); - window.removeEventListener("magnotia:focus-timer-cancelled", resetTimerState); - window.removeEventListener("magnotia:microstep-generated", onMicroStepGenerated); - window.removeEventListener("magnotia:step-completed", onStepOrTaskCompleted); - window.removeEventListener("magnotia:task-completed", onStepOrTaskCompleted); + window.removeEventListener("lumotia:start-timer", onTimerStart); + window.removeEventListener("lumotia:focus-timer-complete", resetTimerState); + window.removeEventListener("lumotia:focus-timer-cancelled", resetTimerState); + window.removeEventListener("lumotia:microstep-generated", onMicroStepGenerated); + window.removeEventListener("lumotia:step-completed", onStepOrTaskCompleted); + window.removeEventListener("lumotia:task-completed", onStepOrTaskCompleted); window.removeEventListener("focus", onFocus); window.removeEventListener("blur", onBlur); diff --git a/src/lib/stores/page.svelte.ts b/src/lib/stores/page.svelte.ts index de7efe4..3d86a59 100644 --- a/src/lib/stores/page.svelte.ts +++ b/src/lib/stores/page.svelte.ts @@ -36,10 +36,21 @@ export const page = $state({ taskSidebarOpen: false, }); -const SETTINGS_KEY = "magnotia_settings"; -const PROFILES_KEY = "magnotia_profiles"; -const TASK_LISTS_KEY = "magnotia_task_lists"; -const TEMPLATES_KEY = "magnotia_templates"; +import { migrateLocalStorageKeys } from "$lib/utils/localStorageMigration"; + +const SETTINGS_KEY = "lumotia_settings"; +const PROFILES_KEY = "lumotia_profiles"; +const TASK_LISTS_KEY = "lumotia_task_lists"; +const TEMPLATES_KEY = "lumotia_templates"; + +// One-shot key rename from the magnotia era. Idempotent. Runs once at +// module load before any localStorage read below. +migrateLocalStorageKeys([ + ["lumotia_settings", SETTINGS_KEY], + ["magnotia_profiles", PROFILES_KEY], + ["magnotia_task_lists", TASK_LISTS_KEY], + ["magnotia_templates", TEMPLATES_KEY], +]); const defaults: SettingsState = { engine: "whisper", @@ -459,7 +470,7 @@ export async function deleteTask(id: string) { tasks.splice(idx, 1); broadcastTasks(); if (typeof window !== "undefined") { - window.dispatchEvent(new CustomEvent("magnotia:task-deleted", { detail: { id } })); + window.dispatchEvent(new CustomEvent("lumotia:task-deleted", { detail: { id } })); } } } catch (err) { @@ -477,7 +488,7 @@ export async function completeTask(id: string) { // to this to clear micro-step-idle timers for the completed task // and, later, to drive Phase 7 "after a task completes" rules. if (typeof window !== "undefined") { - window.dispatchEvent(new CustomEvent("magnotia:task-completed", { detail: { id } })); + window.dispatchEvent(new CustomEvent("lumotia:task-completed", { detail: { id } })); } } catch (err) { toasts.error("Couldn't complete task", errorMessage(err)); @@ -491,7 +502,7 @@ export async function uncompleteTask(id: string) { await invoke("uncomplete_task_cmd", { id }); applyLocalTaskUpdate(id, { done: false, doneAt: null }); if (typeof window !== "undefined") { - window.dispatchEvent(new CustomEvent("magnotia:task-uncompleted", { detail: { id } })); + window.dispatchEvent(new CustomEvent("lumotia:task-uncompleted", { detail: { id } })); } } catch (err) { toasts.error("Couldn't uncomplete task", errorMessage(err)); @@ -654,7 +665,7 @@ interface TaskListChannelMessage { } const taskListChannel = typeof BroadcastChannel !== "undefined" - ? new BroadcastChannel("magnotia_task_lists") + ? new BroadcastChannel("lumotia_task_lists") : null; if (taskListChannel) { diff --git a/src/lib/stores/preferences.svelte.ts b/src/lib/stores/preferences.svelte.ts index a7772ee..ac048d6 100644 --- a/src/lib/stores/preferences.svelte.ts +++ b/src/lib/stores/preferences.svelte.ts @@ -6,7 +6,7 @@ import type { AccessibilityPreferences, Preferences } from "$lib/types/app"; import { errorMessage } from "$lib/utils/errors.js"; import { toasts } from "./toasts.svelte.ts"; -export const PREFERENCES_CHANGED_EVENT = "magnotia:preferences-changed"; +export const PREFERENCES_CHANGED_EVENT = "lumotia:preferences-changed"; type FontFamilies = Record; diff --git a/src/lib/utils/localStorageMigration.ts b/src/lib/utils/localStorageMigration.ts new file mode 100644 index 0000000..3aeba92 --- /dev/null +++ b/src/lib/utils/localStorageMigration.ts @@ -0,0 +1,48 @@ +/** + * Phase 7 of the magnotia -> lumotia rebrand cascade. Persisted UI state + * survives the rename via one-shot key migrations run at module-load + * inside the stores that own each key. + * + * `migrateLocalStorageKey` is idempotent and crash-safe: + * - If the new key already exists, the old key (if any) is removed + * silently — the lumotia value is authoritative. + * - If only the old key exists, its value is copied to the new key and + * the old key is removed. + * - If neither exists, this is a no-op. + */ + +const STORAGE_NS = "lumotia-rebrand-migration"; + +export function migrateLocalStorageKey(oldKey: string, newKey: string): void { + if (typeof localStorage === "undefined") return; + try { + const newValue = localStorage.getItem(newKey); + if (newValue !== null) { + if (localStorage.getItem(oldKey) !== null) { + localStorage.removeItem(oldKey); + } + return; + } + const oldValue = localStorage.getItem(oldKey); + if (oldValue === null) return; + localStorage.setItem(newKey, oldValue); + localStorage.removeItem(oldKey); + } catch (err) { + // Quota / disabled-storage / DOMException — silently no-op. The store + // will fall back to the old key on next read (or fail there with a + // visible error). Logging is intentionally silent to avoid polluting + // dev-console output on every page in the multi-window flow. + void err; + } +} + +/** + * Run a batch of migrations. Used by stores that own multiple keys. + */ +export function migrateLocalStorageKeys(pairs: Array<[string, string]>): void { + for (const [oldKey, newKey] of pairs) { + migrateLocalStorageKey(oldKey, newKey); + } +} + +void STORAGE_NS; diff --git a/src/lib/utils/settingsMigrations.ts b/src/lib/utils/settingsMigrations.ts index 16dddd0..3a14be6 100644 --- a/src/lib/utils/settingsMigrations.ts +++ b/src/lib/utils/settingsMigrations.ts @@ -1,7 +1,7 @@ /** * Forward-compatible, versioned settings migration. * - * Historically, `localStorage["magnotia_settings"]` was a bare JSON object + * Historically, `localStorage["lumotia_settings"]` was a bare JSON object * (whatever `SettingsState` looked like at write time). That shape * tolerates new fields cleanly — spread over `defaults` — but does not * survive: diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 42498e6..d7ba2c2 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -138,7 +138,7 @@ await mod.register(hotkey, () => { if (page.current !== "dictation") page.current = "dictation"; requestAnimationFrame(() => { - window.dispatchEvent(new CustomEvent("magnotia:toggle-recording")); + window.dispatchEvent(new CustomEvent("lumotia:toggle-recording")); }); }); registeredHotkey = hotkey; @@ -174,13 +174,13 @@ async function setupEvdevListener() { if (!tauriRuntimeAvailable) return; const { listen } = await import("@tauri-apps/api/event"); - unlistenEvdev = await listen("magnotia:hotkey-pressed", () => { + unlistenEvdev = await listen("lumotia:hotkey-pressed", () => { const now = Date.now(); if (now - lastHotkeyAtMs < HOTKEY_DEBOUNCE_MS) return; lastHotkeyAtMs = now; if (page.current !== "dictation") page.current = "dictation"; requestAnimationFrame(() => { - window.dispatchEvent(new CustomEvent("magnotia:toggle-recording")); + window.dispatchEvent(new CustomEvent("lumotia:toggle-recording")); }); }); } @@ -248,7 +248,7 @@ let unlistenWindDown = null; async function setupWindDownListener() { if (!tauriRuntimeAvailable) return; - unlistenWindDown = await listen("magnotia:open-wind-down", () => { + unlistenWindDown = await listen("lumotia:open-wind-down", () => { page.current = "shutdown"; }); } diff --git a/src/routes/float/+layout@.svelte b/src/routes/float/+layout@.svelte index c42a976..a6ad755 100644 --- a/src/routes/float/+layout@.svelte +++ b/src/routes/float/+layout@.svelte @@ -35,7 +35,7 @@ // Listen for settings changes from main window if (typeof window !== "undefined") { window.addEventListener("storage", (e) => { - if (e.key === "magnotia_settings" && e.newValue) { + if (e.key === "lumotia_settings" && e.newValue) { try { Object.assign(settings, JSON.parse(e.newValue)); } catch {} diff --git a/src/routes/preview/+layout@.svelte b/src/routes/preview/+layout@.svelte index e4fe48f..d023117 100644 --- a/src/routes/preview/+layout@.svelte +++ b/src/routes/preview/+layout@.svelte @@ -28,7 +28,7 @@ if (typeof window !== "undefined") { window.addEventListener("storage", (event) => { - if (event.key === "magnotia_settings" && event.newValue) { + if (event.key === "lumotia_settings" && event.newValue) { try { Object.assign(settings, JSON.parse(event.newValue)); } catch {} } }); diff --git a/src/routes/viewer/+layout@.svelte b/src/routes/viewer/+layout@.svelte index be2aabe..2efddd4 100644 --- a/src/routes/viewer/+layout@.svelte +++ b/src/routes/viewer/+layout@.svelte @@ -32,7 +32,7 @@ // Sync settings from main window if (typeof window !== "undefined") { window.addEventListener("storage", (e) => { - if (e.key === "magnotia_settings" && e.newValue) { + if (e.key === "lumotia_settings" && e.newValue) { try { Object.assign(settings, JSON.parse(e.newValue)); } catch {} } });