From 27f69cb30827a2d76d1617be267cb42f1cddb4c2 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Mon, 19 Jan 2026 19:51:10 -0800 Subject: [PATCH] chore: fix lints and tests --- .../components/AchievementNotification.svelte | 112 +- src/lib/components/AchievementsPanel.svelte | 117 +- src/lib/components/StatsDisplay.svelte | 289 ++-- src/lib/components/StatusBar.svelte | 14 +- src/lib/components/Terminal.svelte | 4 +- src/lib/sounds/achievement.ts | 22 +- src/lib/stores/achievements.ts | 1172 +++++++++-------- src/lib/stores/stats.ts | 208 +-- src/lib/types/achievements.ts | 170 +-- src/routes/+page.svelte | 7 +- src/routes/test-achievement/+page.svelte | 16 +- 11 files changed, 1128 insertions(+), 1003 deletions(-) diff --git a/src/lib/components/AchievementNotification.svelte b/src/lib/components/AchievementNotification.svelte index 50e6cb0..b1c9712 100644 --- a/src/lib/components/AchievementNotification.svelte +++ b/src/lib/components/AchievementNotification.svelte @@ -1,23 +1,33 @@ @@ -67,18 +91,27 @@
-
+
@@ -89,13 +122,21 @@
-
-
+
+ ✨ +
+
+ ✨ +
-

+

Achievement Unlocked!

@@ -107,7 +148,11 @@

- + {getAchievementRarity(currentAchievement.achievement.id)}
@@ -116,10 +161,13 @@
- {#each Array(10) as _, i} + {#each Array(10) as _ (_)}
{/each}
@@ -151,4 +199,4 @@ .animation-delay-400 { animation-delay: 400ms; } - \ No newline at end of file + diff --git a/src/lib/components/AchievementsPanel.svelte b/src/lib/components/AchievementsPanel.svelte index f06d610..a2f75c5 100644 --- a/src/lib/components/AchievementsPanel.svelte +++ b/src/lib/components/AchievementsPanel.svelte @@ -1,19 +1,19 @@ @@ -56,7 +68,7 @@
e.key === 'Escape' && onClose()} + onkeydown={(e) => e.key === "Escape" && onClose?.()} role="button" tabindex="-1" aria-label="Close achievements panel" @@ -66,7 +78,7 @@
@@ -74,18 +86,26 @@

Achievements

-
+
{progress.unlocked} / {progress.total} Unlocked {progress.percentage}%
@@ -100,14 +120,17 @@
- {#each achievementCategories as category} + {#each achievementCategories as category (category.name)} {@const achievements = getAchievementsForCategory(category.ids)} - {@const unlockedCount = achievements.filter(a => a.unlocked).length} + {@const unlockedCount = achievements.filter((a) => a.unlocked).length}
@@ -133,9 +163,11 @@ {#if selectedCategory === category.name}
- {#each achievements as achievement} + {#each achievements as achievement (achievement.id)}
@@ -149,7 +181,11 @@

{achievement.name}

- + {achievement.rarity}
@@ -171,7 +207,10 @@
@@ -193,8 +232,12 @@
{achievementsState.lastUnlocked.icon}
-

{achievementsState.lastUnlocked.name}

-

{formatDate(achievementsState.lastUnlocked.unlockedAt)}

+

+ {achievementsState.lastUnlocked.name} +

+

+ {formatDate(achievementsState.lastUnlocked.unlockedAt)} +

@@ -220,4 +263,4 @@ :global(.overflow-y-auto::-webkit-scrollbar-thumb:hover) { background: var(--accent-primary); } - \ No newline at end of file + diff --git a/src/lib/components/StatsDisplay.svelte b/src/lib/components/StatsDisplay.svelte index ad52130..705433d 100644 --- a/src/lib/components/StatsDisplay.svelte +++ b/src/lib/components/StatsDisplay.svelte @@ -1,169 +1,168 @@
-
- Duration: - {$formattedStats.sessionDuration} -
+
+ Duration: + {$formattedStats.sessionDuration} +
-
- Messages: - {$formattedStats.messagesSession} - / {$formattedStats.messagesTotal} -
+
+ Messages: + {$formattedStats.messagesSession} + / {$formattedStats.messagesTotal} +
+
+

Tokens & Cost

+
+ Session: + {$formattedStats.sessionTokens} + {$formattedStats.sessionCost} +
+
+ Input: + {$formattedStats.sessionInputTokens} +
+
+ Output: + {$formattedStats.sessionOutputTokens} +
+
+ Total: + {$formattedStats.totalTokens} + {$formattedStats.totalCost} +
+
+ +
+

Activity

+
+ Code blocks: + {$formattedStats.codeBlocksSession} + / {$formattedStats.codeBlocksTotal} +
+
+ Files edited: + {$formattedStats.filesEditedSession} + / {$formattedStats.filesEditedTotal} +
+
+ Files created: + {$formattedStats.filesCreatedSession} + / {$formattedStats.filesCreatedTotal} +
+
+ + {#if Object.keys($formattedStats.sessionToolsUsage).length > 0}
-

Tokens & Cost

-
- Session: - {$formattedStats.sessionTokens} - {$formattedStats.sessionCost} -
-
- Input: - {$formattedStats.sessionInputTokens} -
-
- Output: - {$formattedStats.sessionOutputTokens} -
-
- Total: - {$formattedStats.totalTokens} - {$formattedStats.totalCost} +

+ +

+ {#if showToolsBreakdown} +
+ {#each Object.entries($formattedStats.sessionToolsUsage).sort((a, b) => b[1] - a[1]) as [tool, count] (tool)} +
+ {tool}: + {count} +
+ {/each}
+ {/if}
+ {/if} -
-

Activity

-
- Code blocks: - {$formattedStats.codeBlocksSession} - / {$formattedStats.codeBlocksTotal} -
-
- Files edited: - {$formattedStats.filesEditedSession} - / {$formattedStats.filesEditedTotal} -
-
- Files created: - {$formattedStats.filesCreatedSession} - / {$formattedStats.filesCreatedTotal} -
-
- - {#if Object.keys($formattedStats.sessionToolsUsage).length > 0} -
-

- -

- {#if showToolsBreakdown} -
- {#each Object.entries($formattedStats.sessionToolsUsage).sort((a, b) => b[1] - a[1]) as [tool, count]} -
- {tool}: - {count} -
- {/each} -
- {/if} -
- {/if} - -
- Model: - {$formattedStats.model} -
+
+ Model: + {$formattedStats.model} +
\ No newline at end of file + .model-value { + font-family: var(--font-mono, monospace); + color: var(--text-primary, #e5e7eb); + font-size: 0.75rem; + } + diff --git a/src/lib/components/StatusBar.svelte b/src/lib/components/StatusBar.svelte index 4c0e821..e928349 100644 --- a/src/lib/components/StatusBar.svelte +++ b/src/lib/components/StatusBar.svelte @@ -3,7 +3,7 @@ onToggleAchievements?: () => void; } - const { onToggleAchievements = () => {} } = $props(); + const { onToggleAchievements = () => {} }: Props = $props(); import { invoke } from "@tauri-apps/api/core"; import { getVersion } from "@tauri-apps/api/app"; @@ -188,14 +188,18 @@ > 🏆 {#if progress.unlocked > 0} - + {progress.unlocked} {/if}