From 05c7431d865b35425de8d0244bd23bf3a20f2ed3 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Mon, 10 Aug 2026 14:22:46 -0400 Subject: [PATCH] feat(ui): accordion sidebar panels + wood texture preview swatches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar appearance menu improvements: Accordion behavior: - Lift panel open/close state to a shared 'openPanel' variable on the parent container so only one sidebar panel (User, Appearance, Admin, Sign In) can be open at a time; all can be closed. - Admin panel still auto-opens on /admin/* pages via initial state. - Add chevron rotation to User and Appearance panels (previously only Admin rotated); add a chevron to the Sign In panel for consistency. Wood texture previews: - Generate 48x48 WebP thumbnails (~200 bytes each) from the full-size PNG textures (873 KB – 1.9 MB) so the bookshelf option circles show the actual wood grain instead of a flat grey dot. - Use unquoted url() in the inline style to avoid templ's double-HTML escaping of single quotes (SanitizeStyleAttributeValues + EscapeString turned url('...') into url('...) which is invalid CSS). - 'None' keeps the flat neutral circle. CSS resilience: - Move the wood background-image: url() rules from the compiled style.css into input.css (the Tailwind source) so they survive CSS rebuilds instead of being silently lost. --- templates/header.templ | 46 +++-- templates/header_templ.go | 202 +++++++++++-------- web/static/input.css | 9 + web/static/style.css | 2 +- web/static/textures/thumb-wood-dark.webp | Bin 0 -> 214 bytes web/static/textures/thumb-wood-light.webp | Bin 0 -> 218 bytes web/static/textures/thumb-wood-mahogany.webp | Bin 0 -> 168 bytes 7 files changed, 158 insertions(+), 101 deletions(-) create mode 100644 web/static/textures/thumb-wood-dark.webp create mode 100644 web/static/textures/thumb-wood-light.webp create mode 100644 web/static/textures/thumb-wood-mahogany.webp diff --git a/templates/header.templ b/templates/header.templ index e0293d8..5ba3ba8 100644 --- a/templates/header.templ +++ b/templates/header.templ @@ -74,6 +74,7 @@ templ Header(user User, currentPath string) {
@@ -83,21 +84,23 @@ templ Header(user User, currentPath string) { @SidebarSignIn(currentPath) } -