feat(ui): jump to first unread - floating pill returns to the unread divider (LC-294) #325
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-294-jump-to-first-unread"
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 floating "jump to first unread" pill that returns the reader to the unread divider after they have scrolled away. Mirror of the LC-242 jump-to-latest pill, pointing up.
Background
The room already renders a
[data-unread-divider]("Unread messages") andauto_scroll.htmlauto-anchors to it on load. There was no way to get back to it once you scrolled past it. This adds that affordance (standard Slack/Discord behavior).Changes
server/templates/partials/jump_to_unread.html(new): hidden#lc-jump-unreadbutton, up-chevron, anchored top-center so it never collides with the bottom-right latest pill.server/templates/room/page.html: include the new partial inside the relative wrapper around#messages.server/templates/partials/auto_scroll.html: query the unread divider independently of the permalink anchor;isDividerVisible()(bounding-rect intersection),renderUnreadPill()(visible iff a divider exists and is off-screen), click handler that scrolls the divider into view (block:'start', smooth unless prefers-reduced-motion). Driven from the initial anchor, scroll, ResizeObserver, and live OOB append; torn down with the existing listeners.server/locales/{en,es}/room.ftl:room-jump-unread-label+room-jump-unread-aria.Entirely client-side over already-rendered markup: no server, route, DB, or model change.
Testing
just check,just fmt,just test,just test-saasall pass.Not operator-visible (no env/config/contract change).