refactor: extract magic constants — wave 1 (UX, API, storage)
- Use existing MULTIPLIER_S/M/L from \$entities/Font in SliderArea instead of inlining the 0.5/0.75/1 literals (constants already existed but were duplicated at the call site). - Centralize API base URL in \$shared/api/endpoints.ts (was duplicated between proxyFonts and FilterAndSortFonts filters api). - Promote every 'glyphdiff:...' localStorage key to a named module-level STORAGE_KEY constant. Test files now import the source constant rather than redeclaring it (eliminates silent-typo divergence risk).
This commit is contained in:
@@ -28,7 +28,7 @@ interface LayoutConfig {
|
||||
mode: LayoutMode;
|
||||
}
|
||||
|
||||
const STORAGE_KEY = 'glyphdiff:sample-list-layout';
|
||||
export const STORAGE_KEY = 'glyphdiff:sample-list-layout';
|
||||
const SM_GAP_PX = 16;
|
||||
const MD_GAP_PX = 24;
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ async function flushEffects() {
|
||||
await Promise.resolve();
|
||||
}
|
||||
|
||||
// Storage key used by LayoutManager
|
||||
const STORAGE_KEY = 'glyphdiff:sample-list-layout';
|
||||
import { STORAGE_KEY } from './layoutStore.svelte';
|
||||
|
||||
describe('layoutStore', () => {
|
||||
// Default viewport for most tests (desktop large - >= 1536px)
|
||||
|
||||
Reference in New Issue
Block a user