Admin/settings page: lock always on load, remove settings hint, fix theme swatch colors #112

Closed
opened 2026-09-10 00:50:42 +00:00 by fen · 1 comment
Collaborator

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 key palette_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 themes array in settings.html drifted from the real presets in app.css. Examples:

  • pastel-cloud: first swatch #cdb4db, but app.css --bg for pastel-cloud is #fff0f6
  • pastel-peach: swatch #ffc4a8 is surface-2, actual bg is #ffe0d6
  • smooth swatch list omits --surface #FFFFFF
    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.
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 key `palette_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 `themes` array in settings.html drifted from the real presets in app.css. Examples: - pastel-cloud: first swatch #cdb4db, but app.css --bg for pastel-cloud is #fff0f6 - pastel-peach: swatch #ffc4a8 is surface-2, actual bg is #ffe0d6 - smooth swatch list omits --surface #FFFFFF 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.
fen added spent time 1 minute 2026-09-10 00:51:19 +00:00
fen added the In Progress label 2026-09-10 00:51:20 +00:00
fen added QA and removed In Progress labels 2026-09-10 00:52:51 +00:00
fen closed this issue 2026-09-10 00:54:43 +00:00
Author
Collaborator

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.

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.
fen added spent time 59 minutes 2026-09-10 13:57:37 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 1 hour
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: poslop/palette#112