feature/fetch-fonts #14
@@ -9,13 +9,12 @@
|
||||
* - Font subset: Character subsets available (Latin, Latin Extended, etc.)
|
||||
* - Font category: Serif, Sans-serif, Display, etc.
|
||||
*
|
||||
* Uses $derived for reactive access to filter states, ensuring UI updates
|
||||
* when selections change through any means (sidebar, programmatically, etc.).
|
||||
* This component handles reactive sync between filterManager selections
|
||||
* and the unifiedFontStore using an $effect block to ensure filters are
|
||||
* automatically synchronized whenever selections change.
|
||||
*/
|
||||
import { filterManager } from '$features/FilterFonts';
|
||||
import { CheckboxFilter } from '$shared/ui';
|
||||
|
||||
$inspect(filterManager.groups).with(console.trace);
|
||||
import { filterManager } from '../../model';
|
||||
</script>
|
||||
|
||||
{#each filterManager.groups as group (group.id)}
|
||||
@@ -1,17 +1,14 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$shared/shadcn/ui/button';
|
||||
import { filterManager } from '../../model';
|
||||
|
||||
/**
|
||||
* Controls Component
|
||||
*
|
||||
* Action button group for filter operations. Provides two buttons:
|
||||
*
|
||||
* - Reset: Clears all active filters (outline variant for secondary action)
|
||||
* - Apply: Applies selected filters (primary variant for main action)
|
||||
*
|
||||
* Buttons are equally sized (flex-1) for balanced layout. Note:
|
||||
* Functionality not yet implemented - wire up to filter stores.
|
||||
*/
|
||||
import { filterManager } from '$features/FilterFonts';
|
||||
import { Button } from '$shared/shadcn/ui/button';
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row gap-2">
|
||||
@@ -22,7 +19,4 @@ import { Button } from '$shared/shadcn/ui/button';
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
<Button class="flex-1 cursor-pointer">
|
||||
Apply
|
||||
</Button>
|
||||
</div>
|
||||
@@ -1,4 +1,12 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
FilterControls,
|
||||
Filters,
|
||||
} from '$features/GetFonts';
|
||||
import {
|
||||
Content as SidebarContent,
|
||||
Root as SidebarRoot,
|
||||
} from '$shared/shadcn/ui/sidebar/index';
|
||||
/**
|
||||
* FiltersSidebar Component
|
||||
*
|
||||
@@ -6,19 +14,25 @@
|
||||
* for font filtering operations. Organized into two sections:
|
||||
*
|
||||
* - Filters: Category-based filter groups (providers, subsets, categories)
|
||||
* - Controls: Apply/Reset buttons for filter actions
|
||||
* - Controls: Reset button for filter actions
|
||||
*
|
||||
* Features:
|
||||
* - Loading indicator during font fetch operations
|
||||
* - Empty state message when no fonts match filters
|
||||
* - Error display for failed font operations
|
||||
* - Responsive sidebar behavior via shadcn Sidebar component
|
||||
*
|
||||
* Uses Sidebar.Root from shadcn for responsive sidebar behavior including
|
||||
* mobile drawer and desktop persistent sidebar modes.
|
||||
*/
|
||||
import * as Sidebar from '$shared/shadcn/ui/sidebar/index';
|
||||
import Controls from './Controls.svelte';
|
||||
import Filters from './Filters.svelte';
|
||||
</script>
|
||||
|
||||
<Sidebar.Root>
|
||||
<Sidebar.Content class="p-2">
|
||||
<SidebarRoot>
|
||||
<SidebarContent class="p-2">
|
||||
<!-- Filter groups -->
|
||||
<Filters />
|
||||
<Controls />
|
||||
</Sidebar.Content>
|
||||
</Sidebar.Root>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<FilterControls />
|
||||
</SidebarContent>
|
||||
</SidebarRoot>
|
||||
|
||||
Reference in New Issue
Block a user