Files
sencho/scripts
Anso 43427b1b00 feat(preferences): sidebar mode and width in the appearance document
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.
2026-09-09 14:15:10 -04:00
..