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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user