agent: lumotia-rebrand — localStorage keys + event channels migration
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-13 12:10:50 +01:00
parent 14313cfa84
commit 16081095e0
21 changed files with 122 additions and 58 deletions

View File

@@ -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", ());
}
}
}

View File

@@ -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,

View File

@@ -48,7 +48,7 @@ pub fn setup(app: &tauri::App) -> Result<(), Box<dyn std::error::Error>> {
}
// 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);