refactor(comparison): replace comparisonStore singleton with lazy getComparisonStore

Mirror the font-catalog change in ComparisonView: expose getComparisonStore()
(plus __resetComparisonStore for tests) instead of an eager comparisonStore
singleton, and consume getFontCatalog() internally. Update the model barrel and
all UI consumers (Sidebar, FontList, Header, Line, SliderArea); Character no
longer needs the store and reads everything from props.

Update both specs to the accessor: comparisonStore.test mocks getFontCatalog
with a writable stub (the real store's fonts is getter-only) and resets the
catalog between cases; Sidebar.svelte.test resolves the store via the accessor.

Also document Character's props.
This commit is contained in:
Ilia Mashkov
2026-06-01 17:25:05 +03:00
parent 10603d18bf
commit 1ad015aed6
10 changed files with 107 additions and 55 deletions
+3 -4
View File
@@ -1,4 +1,3 @@
export {
comparisonStore,
type Side,
} from './stores/comparisonStore.svelte';
export { getComparisonStore } from './stores/comparisonStore.svelte';
export type { Side } from './stores/comparisonStore.svelte';