| ... | @@ -297,6 +297,7 @@ import { TimelineSystemDivider } from "./TimelineSystemDivider"; | ... | @@ -297,6 +297,7 @@ import { TimelineSystemDivider } from "./TimelineSystemDivider"; |
| 297 | import { SkillChipIcon, SkillInlineText } from "./SkillInlineText"; | 297 | import { SkillChipIcon, SkillInlineText } from "./SkillInlineText"; |
| 298 | import * as DateTime from "effect/DateTime"; | 298 | import * as DateTime from "effect/DateTime"; |
| 299 | import { formatWorkspaceRelativePath } from "../../filePathDisplay"; | 299 | import { formatWorkspaceRelativePath } from "../../filePathDisplay"; |
| | 300 | import { forwardWheelToTimeline } from "./timelineMinimapWheel"; |
| 300 | import { | 301 | import { |
| 301 | buildReviewCommentRenderablePatch, | 302 | buildReviewCommentRenderablePatch, |
| 302 | formatReviewCommentFence, | 303 | formatReviewCommentFence, |
| ... | @@ -1571,6 +1572,14 @@ const ConversationTimeline = memo(function ConversationTimeline({ | ... | @@ -1571,6 +1572,14 @@ const ConversationTimeline = memo(function ConversationTimeline({ |
| 1571 | [], | 1572 | [], |
| 1572 | ); | 1573 | ); |
| 1573 | | 1574 | |
| | 1575 | const forwardMinimapWheel = useCallback( |
| | 1576 | (event: WheelEvent) => { |
| | 1577 | const scrollNode = listRef.current?.getScrollableNode(); |
| | 1578 | if (scrollNode) forwardWheelToTimeline(event, scrollNode); |
| | 1579 | }, |
| | 1580 | [listRef], |
| | 1581 | ); |
| | 1582 | |
| 1574 | if ( | 1583 | if ( |
| 1575 | rows.length === 0 && | 1584 | rows.length === 0 && |
| 1576 | !isWorking && | 1585 | !isWorking && |
| ... | @@ -1661,6 +1670,7 @@ const ConversationTimeline = memo(function ConversationTimeline({ | ... | @@ -1661,6 +1670,7 @@ const ConversationTimeline = memo(function ConversationTimeline({ |
| 1661 | hitStripWidth={minimapHitStripWidth} | 1670 | hitStripWidth={minimapHitStripWidth} |
| 1662 | currentIndex={minimapCurrentIndex} | 1671 | currentIndex={minimapCurrentIndex} |
| 1663 | stripMap={minimapStripMap} | 1672 | stripMap={minimapStripMap} |
| | 1673 | onWheel={forwardMinimapWheel} |
| 1664 | onSelect={(item) => { | 1674 | onSelect={(item) => { |
| 1665 | onManualNavigation(); | 1675 | onManualNavigation(); |
| 1666 | void listRef.current?.scrollToIndex({ | 1676 | void listRef.current?.scrollToIndex({ |
| ... | @@ -1741,6 +1751,7 @@ function TimelineMinimap({ | ... | @@ -1741,6 +1751,7 @@ function TimelineMinimap({ |
| 1741 | currentIndex, | 1751 | currentIndex, |
| 1742 | items, | 1752 | items, |
| 1743 | stripMap, | 1753 | stripMap, |
| | 1754 | onWheel, |
| 1744 | onSelect, | 1755 | onSelect, |
| 1745 | }: { | 1756 | }: { |
| 1746 | hasPersistentGutter: boolean; | 1757 | hasPersistentGutter: boolean; |
| ... | @@ -1748,9 +1759,18 @@ function TimelineMinimap({ | ... | @@ -1748,9 +1759,18 @@ function TimelineMinimap({ |
| 1748 | currentIndex: number | null; | 1759 | currentIndex: number | null; |
| 1749 | items: ReadonlyArray<TimelineMinimapItem>; | 1760 | items: ReadonlyArray<TimelineMinimapItem>; |
| 1750 | stripMap: Map<string, HTMLSpanElement>; | 1761 | stripMap: Map<string, HTMLSpanElement>; |
| | 1762 | onWheel: (event: WheelEvent) => void; |
| 1751 | onSelect: (item: TimelineMinimapItem) => void; | 1763 | onSelect: (item: TimelineMinimapItem) => void; |
| 1752 | }) { | 1764 | }) { |
| 1753 | const [activeIndex, setActiveIndex] = useState<number | null>(null); | 1765 | const [activeIndex, setActiveIndex] = useState<number | null>(null); |
| | 1766 | const wheelTargetRef = useCallback( |
| | 1767 | (node: HTMLDivElement | null) => { |
| | 1768 | if (!node) return; |
| | 1769 | node.addEventListener("wheel", onWheel, { passive: false }); |
| | 1770 | return () => node.removeEventListener("wheel", onWheel); |
| | 1771 | }, |
| | 1772 | [onWheel], |
| | 1773 | ); |
| 1754 | | 1774 | |
| 1755 | const resolvedActiveIndex = | 1775 | const resolvedActiveIndex = |
| 1756 | activeIndex !== null && activeIndex < items.length ? activeIndex : null; | 1776 | activeIndex !== null && activeIndex < items.length ? activeIndex : null; |
| ... | @@ -1825,6 +1845,7 @@ function TimelineMinimap({ | ... | @@ -1825,6 +1845,7 @@ function TimelineMinimap({ |
| 1825 | )} | 1845 | )} |
| 1826 | data-testid="timeline-minimap" | 1846 | data-testid="timeline-minimap" |
| 1827 | data-persistent-gutter={hasPersistentGutter ? "true" : "false"} | 1847 | data-persistent-gutter={hasPersistentGutter ? "true" : "false"} |
| | 1848 | ref={wheelTargetRef} |
| 1828 | > | 1849 | > |
| 1829 | <div className="relative h-full w-full select-none"> | 1850 | <div className="relative h-full w-full select-none"> |
| 1830 | <div | 1851 | <div |