mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-09-10 01:15:55 +00:00
4dfe2c7a74
Extend the appearance preference domain with sidebarMode (fixed or resizable) and sidebarWidth (224 to 440 px, default 256), the persisted contract for the upcoming desktop sidebar resize feature. Frontend: a use-sidebar-layout hook modeled on the density hook (guarded localStorage cache, settings-changed broadcast, per-field dirty-field notification), the new fields in the appearance document builder, hydration with default fallbacks for older documents, both keys in the identity-clear cache key list, and a targeted sidebar-layout reset that puts defaults without tombstoning the domain. The theme cache document excludes the new fields so pre-paint cache rewrites stay consistent. Backend: the strict appearance schema gains both fields with defaults, so an older writer's 16-field document parses and is stored normalized instead of being rejected; out-of-bounds, fractional, and unknown mode values still fail validation. The preference parity script now compares the mode enum across backend and frontend. Tests: backend normalization (PUT and migrate) plus boundary rejection cases, and a frontend hook suite covering sanitization, cached reads, write-path attribution, cross-tab sync, and cache key registration.