feat(timeline): add day-jump toolbar with dated labels#202
Open
chiptus wants to merge 13 commits into
Open
Conversation
Extract timeToOffset/offsetToTime as the single place the 2px/minute timeline scale lives; TimeScale and set positioning now consume them instead of re-deriving the 2/120 constants. Closes #191
differenceInMinutes truncates to whole minutes, so timeToOffset and offsetToTime did not round-trip for sub-minute moments. Base the conversion on epoch milliseconds; output is unchanged for whole-minute inputs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
Add a scrollTo search param that captures the moment centered in the Timeline viewport. A pure resolveTimelineMountMoment precedence function (scrollTo -> day filter -> festival start) decides where to center on mount; useTimelineScrollSync owns that one-time centering plus debounced (~300ms), 5-minute-rounded, history-replace writes on user scroll. useTimelineUrlState now selects its filter params with structural sharing so scrollTo writes don't recompute the filtered schedule. Closes #192 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
…' into claude/188-192-scrollto-url-state
Sticky toolbar above the Timeline strip with one button per festival day (weekday + date, e.g. "Thu 13"). Tapping a day writes scrollTo and smooth-scrolls to that day's first set, via a new jumpTo(moment) on useTimelineScrollSync. When a day filter is active, only that day's button renders. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Position-based suppression of programmatic scroll events (a browser may fire more than one per scrollLeft write), and the back-restore e2e half now skips explicitly instead of silently passing when no set link is rendered. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
…e' into claude/188-193-day-jump-toolbar
When a day jump clamps at the strip start (first festival day), the requested moment is unreachable and the debounced post-scroll write would silently replace scrollTo with a different value. Write the clamped center moment up front so the URL never drifts; e2e now asserts write stability and covers the first-day clamp. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
Also drops a redundant schema comment, per review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
chiptus
commented
Jul 15, 2026
| * - On user scroll: after the scroll settles (~300ms), writes the moment | ||
| * now centered in the viewport back to the URL (history replace), | ||
| * rounded to 5-minute granularity. | ||
| * - On demand, via the returned `jumpTo(moment)`: writes `scrollTo` |
Owner
Author
There was a problem hiding this comment.
This comment is way too long. What can we do to simplify it? Is that code very complex that requires a long comment?
|
|
||
| const TIMEZONE = "Europe/Lisbon"; // UTC+1 in July (WEST) | ||
|
|
||
| function buildDay( |
Owner
Author
There was a problem hiding this comment.
Helpers in the bottom. Make sure for other prs too
| import type { ScheduleDay } from "@/hooks/useScheduleData"; | ||
|
|
||
| /** | ||
| * The moment the timeline viewport should center on when jumping to a day |
Owner
Author
There was a problem hiding this comment.
Review all comments in this pr, do we need the long comments?
| data-testid="timeline-scroll-container" | ||
| className="overflow-x-auto overflow-y-hidden pb-20" | ||
| > | ||
| {/* Time Scale */} |
The browser clamps scrollLeft to the scrollable range, so the suppression ref must record the read-back value, not the requested target, for the scroll handler to recognize the mount event. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
…e' into claude/188-193-day-jump-toolbar
Per review: shorter docblocks on the scroll-sync hook, toolbar, and day-jump helper; JSX section comments removed; test helpers moved below the cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AziTqr3f12fxALYD6jhrW8
5fcab7c to
acf2265
Compare
…e' into claude/188-193-day-jump-toolbar # Conflicts: # src/hooks/useTimelineScrollSync.ts # src/hooks/useTimelineUrlState.ts # src/lib/timelineCalculator.test.ts # src/pages/EditionView/tabs/ScheduleTab/horizontal/TimelineContainer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a slim sticky toolbar above the Timeline strip with one button per festival day (weekday + date, e.g. "Thu 13"). Tapping a day writes
scrollToand smooth-scrolls the strip to that day's first set, via a newjumpTo(moment: Date)returned fromuseTimelineScrollSync.Design notes: the day list comes from the unfiltered
scheduleDays(fromuseScheduleData) so it reflects the actual festival-timezone days; when adayfilter is active only that day's button renders (nav operates on what's rendered, never filters). The jump target is the day's earliest set start (falling back to festival-timezone midnight for a dayless day) since that's what a viewer actually wants centered.jumpTowritesscrollToimmediately via history replace and relies on the existing scroll debounce to settle on the same value once the smooth-scroll animation finishes — no new suppression state needed.Stacked on #192 (
claude/188-192-scrollto-url-state) — this PR's diff is scoped to the day-jump toolbar; #192's changes will disappear from the diff once that PR merges.Closes #193
Verification
scrollToparam.dayfilter (e.g. via the existing day select): only that day's button remains in the toolbar.TimeScale.tsx.pnpm run lint,pnpm run typecheck, andpnpm vitest runall pass.Generated by Claude Code