Admin/settings page: lock always on load, remove settings hint, fix theme swatch colors #112
Notifications
Total Time Spent: 1 hour
fen
1 hour
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#112
Reference in New Issue
Block a user
Three related UI fixes on the admin + settings pages, all verified against the dev server:
1. Admin page must always show the lock on fresh load
Currently
if (key()) loadSettings()in the admin page script auto-restores the settings panel from a stale sessionStorage key, so revisiting /admin in the same tab shows the full settings form without prompting. Expected: every fresh navigation shows ONLY the Admin title + key entry box (like the unlock page for password-protected pastes). The panel may appear only after submitting a valid key in that visit.Evidence: /admin page script line
if (key()) loadSettings();; sessionStorage keypalette_admin_key.2. Remove the hint text on /settings
Delete the
<p class="hint">Applies instantly and is saved in this browser.</p>from settings.html - unnecessary clutter.3. Theme swatches don't match actual preset colors
The hardcoded
themesarray in settings.html drifted from the real presets in app.css. Examples:Fix: sync swatch hex values to the actual CSS variable values in app.css (bg, surface, surface-2, muted, accent per preset), or better, derive them from getComputedStyle after applying each preset so they can never drift again.
QA passed (PR #113). Verified locally (go vet + go test ./... clean; /admin serves panel display:none with no auto-unhide script, /settings has no hint paragraph, swatches derived via getComputedStyle) and live on palette-dev after merge+deploy: /admin has no auto-restore of lock state and panel stays locked (display:none), /settings has no applied-instantly hint text and theme swatches are computed from CSS variables. Closing.