feat(vscode): highlight the transcript part behind a hovered timeline bar - #12062
feat(vscode): highlight the transcript part behind a hovered timeline bar#12062sylwester-liljegren wants to merge 1 commit into
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (7 files)
Reviewed by claude-sonnet-5-20260630 · Input: 38 · Output: 17.5K · Cached: 1.2M Review guidance: REVIEW.md from base branch |
Re: failing
|
|
Superseded by #12065 so visual-regression automation can run on a Kilo-owned branch, while preserving the contributor's feature commit. |
Issue
No tracked issue. This is a follow-up to maintainer feedback on #12025 ("jump transcript to message on timeline bar click"), which noted the legacy extension had highlighting that made it easy to see which timeline bar corresponds to which tool call in the transcript.
Context
The task timeline already color-codes each bar by part type, and the legacy extension reused that same color to highlight a matching gutter strip on the chat row while hovering the timeline, so users could visually correlate a bar with the tool call it represents. That correlation was missing from the rebuilt timeline.
This restores it, adapted to the rebuilt timeline's finer granularity — bars are per-part rather than per-message, so hovering or focusing a bar highlights the exact matching part in the transcript using that bar's own color.
Implementation
utils/timeline/highlight.ts: a small typed pub/sub (dispatchTimelineHighlight/onTimelineHighlight) over awindowCustomEvent, following the same cross-component convention already used forscrollToMessagebetweenTaskTimelineandMessageList(they share no context or direct props for this).TaskTimeline.tsxdispatches the hovered/focused bar's{ msgId, partId }wheneverhover()changes, and clears it on blur/leave/unmount.MessageList.tsxlistens once and threads the resulting accessor down throughTranscriptRow.tsxintoAssistantMessage.tsx, which lights up the matching part'stool-part-wrappervia adata-timeline-highlightattribute plus the bar's color as a CSS variable.chat-layout.css) is an absolutely positioned pseudo-element, not an insetbox-shadow: a box-shadow paints in the wrapper's own background layer, underneath every child, so tool cards with a negative-margin background (e.g. bash/shell output) would cover it. It also has to stay inside the wrapper's box because the row virtualizer (virtua) clips content to exactly that box, so a negative offset gets clipped once rows virtualize. A small extrapadding-lefton assistant turns (assistant content only, not user bubbles/diffs) gives the strip room to sit off the card edge with a visible gap.onPointerDownpre-emptively hid the tooltip in case the press became a drag, which cleared the hover state driving the highlight — so on a plain click the highlight vanished even though the pointer never left the bar.onPointerUpnow restores it for the clicked bar after the jump.Screenshots / Video
How to Test
Manual/local verification
Executed by the agent, from
packages/kilo-vscode/:bun run typecheck— passesbun run lint— passesbun run format— no reformatting needed on the touched filesbun test tests/unit/task-timeline-tooltip.test.ts tests/unit/timeline-colors.test.ts tests/unit/timeline-geometry.test.ts tests/unit/timeline-sizes.test.ts— 32 pass / 0 failThe branch is a single highlight-only commit cherry-picked onto the current
main;git diff --stat origin/mainshows only the 7 files described above.Reviewer test steps
bun run extensionto launch the dev extension host.Blocked checks and substitute verification
Checklist