From 70507b703223e63dd696fe66521dd702c94945a6 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 12 Jul 2026 20:30:07 -0500 Subject: feat(gallery): persist the widget-size choice across refreshes The S/M/L pick saves to localStorage alongside the validation lamps and restores on load, falling back to the default M when unset or invalid. --- docs/prototypes/panel-widget-gallery.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/prototypes/panel-widget-gallery.html b/docs/prototypes/panel-widget-gallery.html index 99342bc..168a50c 100644 --- a/docs/prototypes/panel-widget-gallery.html +++ b/docs/prototypes/panel-widget-gallery.html @@ -692,8 +692,13 @@ const $ = id => document.getElementById(id); const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches; document.querySelectorAll('.szbar .key').forEach(b=>b.addEventListener('click',()=>{ document.body.dataset.size=b.dataset.sz; + localStorage.setItem('gv-size',b.dataset.sz); document.querySelectorAll('.szbar .key').forEach(k=>k.classList.toggle('on',k===b)); })); +(function(){const s=localStorage.getItem('gv-size'); + if(!s||!/^[123]$/.test(s))return; + document.body.dataset.size=s; + document.querySelectorAll('.szbar .key').forEach(k=>k.classList.toggle('on',k.dataset.sz===s));})(); /* boost the intrinsically tiny widgets (audit: content under 10% of the stage) */ const BOOST=['01','07','08','12','13','N14','18']; -- cgit v1.2.3