feat(room): jump-to-date navigation (LC-325) #339

Merged
longjacksonle merged 1 commit from feat/lc-325-jump-to-date into main 2026-06-17 03:13:19 +02:00

What

A calendar control in the room header that jumps the feed to the first message on or after a chosen day, with a brief highlight. Implements LC-325 / LC-326. Lets a reader reach old context in a long room without hand-scrolling.

How

The room renders its full message history into #messages (no pagination), and every row already carries data-lc-day="YYYY-MM-DD" (LC-244) and id="msg-{id}". So this is client-side only - no new route, DB query, or server render:

  • Control (room_header.html): a calendar-icon button toggling a small popover with a native <input type="date">, placed in the right-hand affordance cluster before the notify dropdown.
  • Handler (auto_scroll.html, which already owns #messages scroll + the .lc-msg-flash permalink highlight, included once per chat page): on change, find the first [data-lc-day] whose value is >= chosen (lexical compare on YYYY-MM-DD is chronological), scrollIntoView({ block: 'start' }), and flash it for 2s. On open it bounds the input's min/max to the room's first/last message day; it hides the control when the room has no messages, and shows an inline hint when the picked date is after the last message. Escape / outside-click close (mirrors the status picker). No-ops on pages without the control (DMs).
  • i18n: en/es keys for the button title/label and the empty hint.

Scope

  • Room (enclave) chat only; DMs use a separate header. The shared auto_scroll.html handler would already support a DM control, so adding one there is an easy follow-up - left out to keep this focused.
  • Assumes the feed renders full history (true today). If it ever becomes paginated, jump-to-date would need a server "first message id >= date" lookup; noted in the issue.

Testing

  • just check (clippy standalone + saas, fmt; Askama compiles the templates) clean.
  • just test and just test-saas green. en/es parity verified for the three new keys. No server contract changed, so the gate is template compilation + the i18n coverage the suites already enforce.

Operator impact

None. No new env var, config, or contract change; no [operator-action] marker.

🤖 Generated with Claude Code

## What A calendar control in the room header that jumps the feed to the first message on or after a chosen day, with a brief highlight. Implements LC-325 / LC-326. Lets a reader reach old context in a long room without hand-scrolling. ## How The room renders its full message history into `#messages` (no pagination), and every row already carries `data-lc-day="YYYY-MM-DD"` (LC-244) and `id="msg-{id}"`. So this is **client-side only** - no new route, DB query, or server render: - **Control** (`room_header.html`): a calendar-icon button toggling a small popover with a native `<input type="date">`, placed in the right-hand affordance cluster before the notify dropdown. - **Handler** (`auto_scroll.html`, which already owns `#messages` scroll + the `.lc-msg-flash` permalink highlight, included once per chat page): on `change`, find the first `[data-lc-day]` whose value is `>= chosen` (lexical compare on `YYYY-MM-DD` is chronological), `scrollIntoView({ block: 'start' })`, and flash it for 2s. On open it bounds the input's `min`/`max` to the room's first/last message day; it hides the control when the room has no messages, and shows an inline hint when the picked date is after the last message. Escape / outside-click close (mirrors the status picker). No-ops on pages without the control (DMs). - **i18n**: en/es keys for the button title/label and the empty hint. ## Scope - Room (enclave) chat only; DMs use a separate header. The shared `auto_scroll.html` handler would already support a DM control, so adding one there is an easy follow-up - left out to keep this focused. - Assumes the feed renders full history (true today). If it ever becomes paginated, jump-to-date would need a server "first message id >= date" lookup; noted in the issue. ## Testing - `just check` (clippy standalone + saas, fmt; Askama compiles the templates) clean. - `just test` and `just test-saas` green. en/es parity verified for the three new keys. No server contract changed, so the gate is template compilation + the i18n coverage the suites already enforce. ## Operator impact None. No new env var, config, or contract change; no `[operator-action]` marker. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(room): jump-to-date navigation (LC-325)
All checks were successful
check-secrets / Nosey parker (push) Successful in 6s
check-secrets / TruffleHog (push) Successful in 7s
check-secrets / Kingfisher (push) Successful in 10s
check-secrets / Kingfisher (pull_request) Successful in 8s
check-secrets / TruffleHog (pull_request) Successful in 9s
check-secrets / Nosey parker (pull_request) Successful in 9s
Check / clippy + fmt + tests (pull_request) Successful in 6m55s
Create release / Create release from merged PR (pull_request) Has been skipped
a67eec88cc
Add a calendar control to the room header that jumps the feed to the first message on or after a chosen day. The full room history is already rendered into #messages, so this is purely client-side: the handler in auto_scroll.html finds the first [data-lc-day] row whose "YYYY-MM-DD" value is >= the picked date (lexical compare is chronological), scrollIntoView({block:'start'}), and reuses the permalink highlight (.lc-msg-flash). No new route, DB query, or server render.

The native <input type="date"> popover bounds its selectable range to the room's actual first/last message day, hides itself when the room has no messages, and shows an inline hint when the chosen date is after the last message. Escape / outside-click close it (mirrors the status picker). The handler no-ops on pages without the control (DMs). en/es parity.

#LC-325
#LC-326

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/lc-325-jump-to-date 2026-06-17 03:13:19 +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!339
No description provided.