Commit 2e531e6c authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Rename internal mouse event-handling function to avoid confusion

As "focusing" and "hovering" an annotation are two separate things,
rename an internal handler function that makes a thread appear
hovered.
parent ae7dbcbd
......@@ -36,7 +36,7 @@ function ThreadCard({ frameSync, thread }: ThreadCardProps) {
const store = useSidebarStore();
const threadTag = thread.annotation?.$tag ?? null;
const isHovered = !!(threadTag && store.isAnnotationHovered(threadTag));
const focusThreadAnnotation = useMemo(
const setThreadHovered = useMemo(
() =>
debounce((ann: Annotation | null) => frameSync.hoverAnnotation(ann), 10),
[frameSync]
......@@ -89,8 +89,8 @@ function ThreadCard({ frameSync, thread }: ThreadCardProps) {
scrollToAnnotation(thread.annotation);
}
}}
onMouseEnter={() => focusThreadAnnotation(thread.annotation ?? null)}
onMouseLeave={() => focusThreadAnnotation(null)}
onMouseEnter={() => setThreadHovered(thread.annotation ?? null)}
onMouseLeave={() => setThreadHovered(null)}
key={thread.id}
>
<CardContent>{threadContent}</CardContent>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment