-
Notifications
You must be signed in to change notification settings - Fork 0
feat(timeline): sticky header strip + unboxed timeline #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
e44d034
feat(schedule): sticky Now/Timeline/List switcher + shared layout con…
claude 2cc6f17
feat(timeline): sticky header strip synced to horizontal scroll + unb…
claude 7380a74
refactor(timeline): trim TimeScale comment to non-obvious behavior only
claude 8a1a3bd
fix(schedule): un-stick the view switcher per spec
claude c9e72da
fix(timeline): read initial scroll position before first scroll event
claude 5f61ae8
fix(timeline): restore solid date-band background
claude 3a9433c
fix(timeline): fix header-strip overlap, restore date fade, fix label…
claude 85ab3d9
refactor(timeline): use native sticky instead of scroll-mirroring for…
claude f46eb4d
Revert "refactor(timeline): use native sticky instead of scroll-mirro…
claude c8ac5a3
refactor(timeline): use cn for toolbar className
claude 12625fd
refactor(timeline): drop stale comment, center stage labels
claude c0f6505
refactor(timeline): extract useScrollLeft hook and TimeScaleContainer
claude 734f112
docs(timeline): trim TimeScale comment to non-obvious behavior
claude e8b01d1
style(timeline): round bottom corners of header strip
claude 72cc830
refactor(schedule): drop own padding, rely on parent's spacing
claude 216eb17
docs(layout-constants): note toolbar height is measured, not derived
claude 34192b1
docs(layout-constants): reference components, trim measurement note
claude 00945f5
refactor(timeline): move header strip offset calc into TimeScaleConta…
claude e5fd7b4
docs(useScrollLeft): convert to JSDoc for hook consumers
claude cdc9d6e
fix(timeline): avoid mobile offset flash, make header strip fully opaque
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Shared sticky-offset constants so sticky bars (timeline toolbar/header | ||
| // strip, list-view day headers) derive their `top` from one source instead | ||
| // of scattered magic numbers. | ||
|
|
||
| export const TOP_BAR_HEIGHT_PX = { mobile: 64, desktop: 80 } as const; | ||
|
|
||
| // Tailwind utility classes matching TOP_BAR_HEIGHT_PX (the fixed top bar's | ||
| // `h-16 md:h-20` spacer in TopBar.tsx) — used by sticky elements docking | ||
| // directly below it (timeline toolbar/header strip, list day headers). | ||
| export const STICKY_TOP_BELOW_TOP_BAR_CLASS = "top-16 md:top-20"; | ||
|
|
||
| // The timeline toolbar (TimelineToolbar.tsx) sits at the very top of its | ||
| // scroll region (above everything else), so the header strip below it | ||
| // stacks on top of the toolbar's own height. | ||
| // Measured from the rendered toolbar (padding + border + content). | ||
| export const TIMELINE_TOOLBAR_HEIGHT_PX = { mobile: 63, desktop: 63 } as const; | ||
|
|
||
| // Used by the timeline header strip (TimeScaleContainer.tsx) to dock below | ||
| // the toolbar. Measured from the rendered toolbar (padding + border + | ||
| // content). | ||
| export const HEADER_STRIP_TOP_PX = { | ||
| mobile: TOP_BAR_HEIGHT_PX.mobile + TIMELINE_TOOLBAR_HEIGHT_PX.mobile, | ||
| desktop: TOP_BAR_HEIGHT_PX.desktop + TIMELINE_TOOLBAR_HEIGHT_PX.desktop, | ||
| } as const; | ||
|
|
||
| // Tailwind classes matching HEADER_STRIP_TOP_PX, expressed responsively so | ||
| // the offset doesn't depend on a JS media-query hook (which starts at | ||
| // `false` and would flash the desktop offset on mobile before settling). | ||
| // Written as a literal string (not interpolated from the px constants | ||
| // above) so Tailwind's static class scanner can pick it up. | ||
| export const HEADER_STRIP_TOP_CLASS = "top-[127px] md:top-[143px]"; | ||
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
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
39 changes: 39 additions & 0 deletions
39
src/pages/EditionView/tabs/ScheduleTab/horizontal/TimeScaleContainer.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { TimeScale } from "./TimeScale"; | ||
| import type { TimelineData } from "@/lib/timelineCalculator"; | ||
| import { HEADER_STRIP_TOP_CLASS } from "@/lib/layout-constants"; | ||
| import { cn } from "@/lib/utils"; | ||
|
|
||
| interface TimeScaleContainerProps { | ||
| timelineData: TimelineData; | ||
| timezone: string; | ||
| scrollLeft: number; | ||
| } | ||
|
|
||
| export function TimeScaleContainer({ | ||
| timelineData, | ||
| timezone, | ||
| scrollLeft, | ||
| }: TimeScaleContainerProps) { | ||
| return ( | ||
| <div | ||
| className={cn( | ||
| "sticky z-30 overflow-hidden rounded-b-lg bg-gray-900", | ||
| HEADER_STRIP_TOP_CLASS, | ||
| )} | ||
| > | ||
| <div | ||
| style={{ | ||
| transform: `translateX(-${scrollLeft}px)`, | ||
| width: timelineData.totalWidth, | ||
| }} | ||
| > | ||
| <TimeScale | ||
| timeSlots={timelineData.timeSlots} | ||
| totalWidth={timelineData.totalWidth} | ||
| timezone={timezone} | ||
| scrollLeft={scrollLeft} | ||
| /> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.