feat: add persistent lifetime stats and sync achievements

- Add lifetime stats persistence to Rust backend
- Sync achievement state between frontend and backend on startup
- Add commands for loading/saving stats to disk
- Expand achievement definitions with 150+ new achievements
- Fix stats store to properly track total vs session metrics
This commit is contained in:
2026-01-25 20:06:36 -08:00
committed by Naomi Carrigan
parent 8a19f35922
commit 42c3b4ee83
7 changed files with 1462 additions and 106 deletions
+3 -2
View File
@@ -104,10 +104,11 @@ export async function initStatsListener() {
stats.set(newStats);
});
// Load initial stats from backend
// Load initial persisted stats from backend (no bridge required)
try {
const initialStats = await invoke<UsageStats>("get_usage_stats");
const initialStats = await invoke<UsageStats>("get_persisted_stats");
stats.set(initialStats);
console.log("Loaded persisted stats:", initialStats);
} catch (error) {
console.error("Failed to load initial stats:", error);
}