feat(ui): unread-only sidebar filter (LC-308) #331
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-308-unread-only-sidebar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
A device-local "Unread only" toggle at the top of the sidebar that hides rooms/DMs (and now-empty sections) with no unread and no mention, keeping the currently-open room visible.
Approach
Pure CSS, no JS scan. Rows/sections are marked
data-lc-sb-row/data-lc-sb-section; the unread/mention badge spans carrydata-lc-unread/data-lc-mention; two rules gated onhtml[data-lc-unread-only]hide anything not:has()-ing a non-empty badge or an[aria-current="page"]. The unread badge OOB-swaps live on every new message / read, so:has()/:emptyre-evaluate automatically: a new message re-reveals a row, reading it re-hides it.Changes
base.html:applyUnreadOnly+__lcToggleUnreadOnly(no-flash, localStorage, mirrors__lcToggleSidebar).partials/sidebar.html: the toggle button (aria-pressed).layout.html: IIFE syncing the button'saria-pressedfrom the<html>flag on htmx settle (covers sidebar re-renders).partials/sidebar_nav.html:data-lc-sb-row/data-lc-sb-sectionmarkers + collapsed-category total badges marked.partials/unread_badge.html+ws/unread_badge.html:data-lc-unread.partials/mention_badge.html:data-lc-mention.server/assets/main.css: the two:has()filter rules.locales/{en,es}/partials.ftl:sidebar-unread-only.Muted rooms already suppress their unread badge, so they stay out of the unread view; the open room stays visible via the
aria-currentexemption.Testing
just check,just fmt,just test,just test-saasall pass.data-*attribute. No new test binary (pure client-side over existing markup; mirrors theme-toggle / jump-unread). No LC-77 fixture change (message.html untouched).Not operator-visible (no env/config/contract change).