refactor(Font): rename fontStore and appliedFontsManager

Both names were vague or overloaded:

- fontStore / FontStore -> fontCatalogStore / FontCatalogStore
  Three font-related stores live in this slice; the new name names the
  paginated catalog specifically.

- appliedFontsManager / AppliedFontsManager -> fontLifecycleManager /
  FontLifecycleManager
  "Applied" collided with the filter-side appliedFilterStore (different
  meaning). The class actually orchestrates a load-use-evict lifecycle
  with FontBufferCache + FontEvictionPolicy + FontLoadQueue
  collaborators, so "Manager" is justified. Companion types file moved
  alongside (appliedFonts.ts -> fontLifecycle.ts).

Directories, file basenames, factory (createFontStore ->
createFontCatalogStore), and the AppliedFontsManagerDeps interface all
renamed. All consumers (ComparisonView, SampleList, FontList,
FontApplicator, FontVirtualList, FilterAndSortFonts bindings,
createFontRowSizeResolver, mocks) updated.
This commit is contained in:
Ilia Mashkov
2026-05-24 20:00:43 +03:00
parent 07d044f4d6
commit 728380498b
38 changed files with 105 additions and 105 deletions
@@ -38,7 +38,7 @@ export {
} from './store/appliedFilterStore/appliedFilterStore.svelte';
/**
* Side-effect import: installs the global appliedFilterStore+sortStore → fontStore
* Side-effect import: installs the global appliedFilterStore+sortStore → fontCatalogStore
* bridge on first import of this feature barrel. No exports.
*/
import './store/bindings.svelte';
@@ -1,6 +1,6 @@
/**
* Bridges feature-level UI state (appliedFilterStore + sortStore) to the
* entity-level fontStore query params.
* entity-level fontCatalogStore query params.
*
* Centralizing this here means consumers (Search, FontSearch,
* FilterControls, etc.) bind to the manager/store directly without
@@ -9,7 +9,7 @@
* observer, so it lives at module scope, not in any individual widget.
*/
import { fontStore } from '$entities/Font';
import { fontCatalogStore } from '$entities/Font';
import { untrack } from 'svelte';
import { mapAppliedFiltersToParams } from '../../lib/mapper/mapAppliedFiltersToParams';
import { appliedFilterStore } from './appliedFilterStore/appliedFilterStore.svelte';
@@ -42,20 +42,20 @@ $effect.root(() => {
});
/**
* Mirror filter selections + debounced search query into fontStore params.
* untrack the write so fontStore's internal $state reads don't feed back
* Mirror filter selections + debounced search query into fontCatalogStore params.
* untrack the write so fontCatalogStore's internal $state reads don't feed back
* into this effect's dependency graph.
*/
$effect(() => {
const params = mapAppliedFiltersToParams(appliedFilterStore);
untrack(() => fontStore.setParams(params));
untrack(() => fontCatalogStore.setParams(params));
});
/**
* Mirror sort selection into fontStore.
* Mirror sort selection into fontCatalogStore.
*/
$effect(() => {
const apiSort = sortStore.apiValue;
untrack(() => fontStore.setSort(apiSort));
untrack(() => fontCatalogStore.setSort(apiSort));
});
});