Scrolling fixes and motion timeline changes (#10295)

* scrolling updates

* only scroll by 1 segment on desktop
This commit is contained in:
Josh Hawkins
2024-03-06 15:35:10 -06:00
committed by GitHub
parent fb81e44283
commit 90db27e3c8
8 changed files with 220 additions and 139 deletions

View File

@@ -17,6 +17,7 @@ import {
import { HoverCardPortal } from "@radix-ui/react-hover-card";
import scrollIntoView from "scroll-into-view-if-needed";
import { MinimapBounds, Tick, Timestamp } from "./segment-metadata";
import useTapUtils from "@/hooks/use-tap-utils";
type EventSegmentProps = {
events: ReviewSegment[];
@@ -88,6 +89,8 @@ export function EventSegment({
const apiHost = useApiHost();
const { handleTouchStart } = useTapUtils();
const eventThumbnail = useMemo(() => {
return getEventThumbnail(segmentTime);
}, [getEventThumbnail, segmentTime]);
@@ -227,6 +230,9 @@ export function EventSegment({
key={`${segmentKey}_${index}_primary_data`}
className={`w-full h-2 bg-gradient-to-r ${roundBottomPrimary ? "rounded-bl-full rounded-br-full" : ""} ${roundTopPrimary ? "rounded-tl-full rounded-tr-full" : ""} ${severityColors[severityValue]}`}
onClick={segmentClick}
onTouchStart={(event) =>
handleTouchStart(event, segmentClick)
}
></div>
</HoverCardTrigger>
<HoverCardPortal>