feat(ui): collapsible pinned-messages strip (LC-264) #310

Merged
longjacksonle merged 1 commit from feat/lc-264-pinned-strip-collapse into main 2026-06-14 05:04:31 +02:00

What

The pinned-messages strip (top of every room) is now collapsible (LC-264). It can be folded to a single "Pinned (N)" header line to reclaim vertical space above the message list, and the choice is remembered per room.

Note: the pinned strip itself already existed (top-3 pins, click-to-jump, "See all", live pin/unpin updates). This adds only the missing collapse affordance - it does not rebuild the strip.

How

  • partials/pinned_strip.html: the strip gains a header row (pin icon + "Pinned" + count + a chevron toggle) above the existing list, and the list is wrapped in an id'd container (#lc-pinned-list-{room_id}). Collapsing sets the list hidden.
  • A once-guarded IIFE persists the collapsed state per room in localStorage (device-local, matching how the LC-238 caret and sidebar-category collapse already work). It uses a delegated click handler (the strip re-renders often, so no stacked listeners) and re-applies state on initial load and on htmx:afterSettle - so collapsing does not silently pop back open when someone pins/unpins and the strip live-re-renders.
  • main.css: the chevron rotation lives here so it is reliable without a Tailwind rebuild.
  • Strings localized in en + es.

Pure front-end: no new route, DB, event, or env var. Not operator-visible. No LC-77 fixture impact (fixtures carry no pins).

Tests

routes_pinned::pinned_strip_ships_collapse_toggle asserts the pinned strip ships the collapse marker, toggle, and id'd collapsible list. just test and just test-saas pass.

QA note

The toggle + persistence are JS-driven, so worth a quick manual pass before merge: in a room with pins, collapse the strip (folds to one line, chevron rotates) and reload (stays collapsed); expand and reload (stays expanded); pin/unpin another message while collapsed and confirm the strip stays collapsed; confirm a room with no pins shows nothing and click-to-jump still works.

## What The pinned-messages strip (top of every room) is now collapsible (LC-264). It can be folded to a single "Pinned (N)" header line to reclaim vertical space above the message list, and the choice is remembered per room. Note: the pinned strip itself already existed (top-3 pins, click-to-jump, "See all", live pin/unpin updates). This adds only the missing collapse affordance - it does not rebuild the strip. ## How - `partials/pinned_strip.html`: the strip gains a header row (pin icon + "Pinned" + count + a chevron toggle) above the existing list, and the list is wrapped in an id'd container (`#lc-pinned-list-{room_id}`). Collapsing sets the list `hidden`. - A once-guarded IIFE persists the collapsed state per room in `localStorage` (device-local, matching how the LC-238 caret and sidebar-category collapse already work). It uses a delegated click handler (the strip re-renders often, so no stacked listeners) and re-applies state on initial load and on `htmx:afterSettle` - so collapsing does not silently pop back open when someone pins/unpins and the strip live-re-renders. - `main.css`: the chevron rotation lives here so it is reliable without a Tailwind rebuild. - Strings localized in en + es. Pure front-end: no new route, DB, event, or env var. Not operator-visible. No LC-77 fixture impact (fixtures carry no pins). ## Tests `routes_pinned::pinned_strip_ships_collapse_toggle` asserts the pinned strip ships the collapse marker, toggle, and id'd collapsible list. `just test` and `just test-saas` pass. ## QA note The toggle + persistence are JS-driven, so worth a quick manual pass before merge: in a room with pins, collapse the strip (folds to one line, chevron rotates) and reload (stays collapsed); expand and reload (stays expanded); pin/unpin another message while collapsed and confirm the strip stays collapsed; confirm a room with no pins shows nothing and click-to-jump still works.
feat(ui): collapsible pinned-messages strip (LC-264)
All checks were successful
check-secrets / Nosey parker (push) Successful in 4s
check-secrets / Nosey parker (pull_request) Successful in 3s
check-secrets / TruffleHog (pull_request) Successful in 6s
check-secrets / Kingfisher (push) Successful in 5s
check-secrets / TruffleHog (push) Successful in 6s
check-secrets / Kingfisher (pull_request) Successful in 5s
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 2m28s
24725a1db0
The pinned-messages strip (top of every room) can now be folded to a single "Pinned (N)" header line to reclaim vertical space. A chevron toggle in the new header collapses/expands the list; the choice is persisted per room in localStorage (device-local, like the LC-238 caret) so it survives reloads.

State is re-applied on initial load and after every live OOB re-render (htmx:afterSettle), so collapsing does not pop back open when someone pins or unpins. The handler is once-guarded and uses a delegated click listener, so the strip's frequent re-renders do not stack listeners. A room with no pins still renders nothing; click-to-jump, "See all", and live updates are unchanged. The chevron rotation lives in main.css so it is reliable without a Tailwind rebuild.

Strings localized in en + es. Test asserts the strip ships the toggle + id'd collapsible list.

#LC-264
#LC-265

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/lc-264-pinned-strip-collapse 2026-06-14 05:04:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!310
No description provided.