mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-03 13:29:06 +00:00
docs(countdown): explain why the sticky offset is measured
The group card scales with the viewport, grows while live and wraps on long titles, measuring between 91px and 171px. A constant would leave the running event behind the pinned header. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GjX7D56AW8cL3FXjvtnjtL
This commit is contained in:
@@ -53,7 +53,10 @@ export default function CountdownSubscriptions({ subscribedEvents, goToEditMode
|
|||||||
|
|
||||||
const sections = useMemo(() => groupSubscriptionTargets(subscribedEvents), [subscribedEvents]);
|
const sections = useMemo(() => groupSubscriptionTargets(subscribedEvents), [subscribedEvents]);
|
||||||
|
|
||||||
// the group of the running event is pinned to the top of the list, the running event needs to clear it
|
// The group of the running event is pinned to the top of the list, the running event needs to clear it.
|
||||||
|
// This is measured rather than estimated: the card scales with the viewport (the font sizes are clamped
|
||||||
|
// against vw), it grows while live since the running event's title is added, and long titles wrap.
|
||||||
|
// Measured between 91px and 171px, so a constant would leave the running event behind the header.
|
||||||
const getStickyOffset = useCallback(() => {
|
const getStickyOffset = useCallback(() => {
|
||||||
const header = stickyHeaderRef.current;
|
const header = stickyHeaderRef.current;
|
||||||
// account for the row margin, so that the rows do not touch
|
// account for the row margin, so that the rows do not touch
|
||||||
|
|||||||
Reference in New Issue
Block a user