@devries-cameron20 / t3code-1 / commits / 32fdad5f49
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): timeline minimap preview no longer steals hover or jumps around (#32151)

Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

NoomStuff committed Nov 11, 2026 at 06:26 UTC 32fdad5f49498c8ea72a2418da2dc69703dfd500
2 files changed +10 -41
apps/web/src/components/chat/MessagesTimeline.logic.ts
+3 -9
@@ -283,7 +283,9 @@ export function workEntryIsVisibleInGroup(
283 }
284 const TIMELINE_MINIMAP_ITEM_SPACING = 8;
285 export const TIMELINE_MINIMAP_MIN_ITEMS = 2;
286 -const TIMELINE_MINIMAP_MAX_HEIGHT_CSS = "calc(100vh - 18rem)";
286 +// Relative to the timeline, not the viewport, so an open terminal shrinks the rail and
287 +// endpoint previews (centered on their strip) still fit above and below it.
288 +const TIMELINE_MINIMAP_MAX_HEIGHT_CSS = "max(4rem, calc(100% - 14.75rem))";
289 const TIMELINE_MINIMAP_PERSISTENT_GUTTER = 48;
290
291 export interface WorkGroupScrollAnchor {
@@ -443,7 +445,6 @@ export function resolveTimelineMinimapHasPersistentGutter(
445
446 const TIMELINE_MINIMAP_HIT_STRIP_LEFT = 12;
447 const TIMELINE_MINIMAP_HIT_STRIP_MAX_WIDTH = 40;
446 -const TIMELINE_MINIMAP_EXPANDED_HIT_STRIP_WIDTH = "22rem";
448
449 export function resolveTimelineMinimapHitStripWidth(
450 viewportWidth: number,
@@ -465,13 +466,6 @@ export function resolveTimelineMinimapNavigationInteractive(collapsedWidth: numb
466 return collapsedWidth >= TIMELINE_MINIMAP_NAVIGATION_REACH;
467 }
468
468 -export function resolveTimelineMinimapInteractiveWidth(
469 - collapsedWidth: number,
470 - expanded: boolean,
471 -): number | string {
472 - return expanded ? TIMELINE_MINIMAP_EXPANDED_HIT_STRIP_WIDTH : collapsedWidth;
473 -}
474 -
469 function computeElapsedMs(startIso: string, endIso: string): number | null {
470 const start = Date.parse(startIso);
471 const end = Date.parse(endIso);
apps/web/src/components/chat/TimelineMinimap.tsx
+7 -32
@@ -5,7 +5,6 @@ import { Button } from "../ui/button";
5 import {
6 resolveTimelineMinimapHeightStyle,
7 resolveTimelineMinimapIndexFromPointer,
8 - resolveTimelineMinimapInteractiveWidth,
8 resolveTimelineMinimapNavigationInteractive,
9 resolveTimelineMinimapTopPercent,
10 TIMELINE_MINIMAP_MIN_ITEMS,
@@ -13,10 +12,6 @@ import {
12 import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
13 import { cn } from "~/lib/utils";
14
16 -function timelineMinimapEventTargetsPreview(target: EventTarget): boolean {
17 - return target instanceof Element && target.closest("[data-minimap-preview]") !== null;
18 -}
19 -
15 // A release outside the window can skip `mouseup`, so the next button-free
16 // `mousemove` also counts.
17 function onMouseButtonsReleased(onRelease: () => void): () => void {
@@ -74,14 +69,6 @@ export function TimelineMinimap({
69 resolvedActiveIndex === null
70 ? 0
71 : resolveTimelineMinimapTopPercent(resolvedActiveIndex, items.length);
77 - const activeTooltipTranslate =
78 - resolvedActiveIndex === null
79 - ? "-50%"
80 - : resolvedActiveIndex === 0
81 - ? "0%"
82 - : resolvedActiveIndex === items.length - 1
83 - ? "-100%"
84 - : "-50%";
72 const resolvedCurrentIndex =
73 currentIndex !== null && currentIndex >= 0 && currentIndex < items.length ? currentIndex : null;
74 const previousItem =
@@ -147,7 +134,7 @@ export function TimelineMinimap({
134 }}
135 style={{
136 height: resolveTimelineMinimapHeightStyle(items.length),
150 - width: resolveTimelineMinimapInteractiveWidth(hitStripWidth, activeItem !== null),
137 + width: hitStripWidth,
138 }}
139 >
140 <TimelineMinimapNavigationButton
@@ -160,12 +147,9 @@ export function TimelineMinimap({
147 />
148 <button
149 aria-label={`Jump to message: ${activeItem?.userText ?? "User message"}`}
163 - className="absolute inset-y-0 left-0 w-full cursor-pointer bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70"
150 + className="absolute inset-y-0 left-0 w-full cursor-pointer bg-transparent before:absolute before:inset-x-0 before:-inset-y-1 before:content-[''] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/70"
151 onBlur={() => setActiveIndex(null)}
152 onClick={(event) => {
166 - if (timelineMinimapEventTargetsPreview(event.target)) {
167 - return;
168 - }
153 const nextIndex = resolveActiveIndexFromPointer(event);
154 const selectedItem = nextIndex === null ? null : (items[nextIndex] ?? null);
155 if (selectedItem) {
@@ -199,12 +183,7 @@ export function TimelineMinimap({
183 if (event.buttons !== 0 && !pressedOnStripRef.current) return;
184 updateActiveIndexFromPointer(event);
185 }}
202 - onMouseDown={(event) => {
203 - if (timelineMinimapEventTargetsPreview(event.target)) {
204 - return;
205 - }
206 - event.preventDefault();
207 - }}
186 + onMouseDown={(event) => event.preventDefault()}
187 type="button"
188 >
189 <div className="absolute top-0 left-3 h-full w-px bg-border/15" />
@@ -245,14 +224,10 @@ export function TimelineMinimap({
224 );
225 })}
226 {activeItem ? (
227 + // Display-only: it overlaps the message column, and the strip keeps tracking beneath it.
228 <span
249 - className="pointer-events-auto absolute left-8 w-80 cursor-text select-text"
250 - data-minimap-preview
251 - onMouseMove={(event) => event.stopPropagation()}
252 - style={{
253 - top: `${activeTopPercent}%`,
254 - transform: `translateY(${activeTooltipTranslate})`,
255 - }}
229 + className="pointer-events-none absolute left-8 w-80 -translate-y-1/2"
230 + style={{ top: `${activeTopPercent}%` }}
231 >
232 <span className="dropdown-glass block rounded-xl p-3 text-left text-popover-foreground shadow-xl shadow-black/25">
233 <span className="block max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium leading-5">
@@ -311,7 +286,7 @@ function TimelineMinimapNavigationButton({
286 className={cn(
287 "absolute left-1 z-10 inline-flex -translate-x-1/2 opacity-0 transition-opacity duration-150 hover:opacity-100 focus-within:opacity-100",
288 interactive ? "pointer-events-auto" : "pointer-events-none",
314 - previous ? "bottom-[calc(100%+2px)]" : "top-[calc(100%+2px)]",
289 + previous ? "bottom-[calc(100%+6px)]" : "top-[calc(100%+6px)]",
290 )}
291 />
292 }