refactor(font): inject font-load status as a prop, decoupling UI from the store

FontApplicator and FontSampler no longer read fontLifecycleManager. They take a
`status` prop (FontLoadStatus | undefined) supplied by the composing widget;
FontList and SampleList resolve status once per visible row and pass it down.

FSD+ dependency inversion: the entity/feature UI depends on a value, not the
lifecycle store. Removes FontApplicator's value-import of the store (one step
toward an inert ./ui barrel) and drops the duplicate getFontStatus read per row
in FontList. FontSampler is now status-decoupled and trivially relocatable to
entities/Font/ui.
This commit is contained in:
Ilia Mashkov
2026-06-01 12:06:30 +03:00
parent 28a8e49915
commit fcd61be4fa
6 changed files with 52 additions and 46 deletions
@@ -113,7 +113,13 @@ const fontRowHeight = $derived.by(() =>
{skeleton}
>
{#snippet children({ item: font, index })}
<FontSampler bind:text {font} {index} />
<!--
Resolve load status here (the widget owns the lifecycle store) and
pass it down — FontSampler and FontApplicator stay store-decoupled.
getFontStatus reads a $state SvelteMap, so the row stays reactive.
-->
{@const status = fontLifecycleManager.getFontStatus(font.id, typographySettingsStore.weight, font.features?.isVariable)}
<FontSampler bind:text {font} {index} {status} />
{/snippet}
</FontVirtualList>