Better segment clicking (#10321)

* better segment clicking on motion segments

* move handlebar on click when handlebar is showing

* only scroll handlebar if needed
This commit is contained in:
Josh Hawkins
2024-03-07 22:02:29 -06:00
committed by GitHub
parent 507c6afa2c
commit dfab850b61
6 changed files with 34 additions and 18 deletions

View File

@@ -29,6 +29,7 @@ type EventSegmentProps = {
minimapEndTime?: number;
severityType: ReviewSeverity;
contentRef: RefObject<HTMLDivElement>;
setHandlebarTime?: React.Dispatch<React.SetStateAction<number>>;
};
export function EventSegment({
@@ -41,6 +42,7 @@ export function EventSegment({
minimapEndTime,
severityType,
contentRef,
setHandlebarTime,
}: EventSegmentProps) {
const {
getSeverity,
@@ -192,6 +194,10 @@ export function EventSegment({
element.classList.add("outline-0", "shadow-none");
}, 3000);
}
if (setHandlebarTime) {
setHandlebarTime(startTimestamp);
}
}
// we know that these deps are correct
// eslint-disable-next-line react-hooks/exhaustive-deps