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:
Ilia Mashkov
2026-05-24 20:30:26 +03:00
parent f92577608a
commit e3b489f173
10 changed files with 55 additions and 16 deletions
+4 -2
View File
@@ -29,10 +29,12 @@ export function seedFontCache(fonts: UnifiedFont[]): void {
});
}
import { API_ENDPOINTS } from '$shared/api/endpoints';
/**
* Proxy API base URL
* Proxy API endpoint for font resources.
*/
const PROXY_API_URL = 'https://api.glyphdiff.com/api/v1/fonts' as const;
const PROXY_API_URL = API_ENDPOINTS.fonts;
/**
* Proxy API parameters