feat(vscode): highlight the transcript part behind a hovered timeline bar - #2
Closed
sylwester-liljegren wants to merge 1 commit into
Closed
sylwester-liljegren wants to merge 1 commit into
sylwester-liljegren wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #
No tracked issue — this follows up on maintainer feedback on Kilo-Org#12025 ("jump transcript to message on timeline bar click"), which noted that the legacy extension had highlighting that made it easy to see which timeline bar belongs to which tool call.
Context
The task timeline (
TaskTimeline.tsx) already color-codes each bar by part type, and the legacy extension used that same color to highlight a matching gutter strip on chat rows while hovering the timeline, so users could visually correlate a bar with the tool call it represents. That correlation was missing in the rebuilt timeline.This PR restores it, adapted to the rebuilt timeline's finer bar granularity (per-part, not per-row): hovering or focusing a bar now 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 forscrollToMessage/resumeAutoScrollbetweenTaskTimelineandMessageList— they don't share context or direct props for this.TaskTimeline.tsxdispatches the hovered/focused bar's{msgId, partId}wheneverhover()changes (clearing on blur/leave/unmount).MessageList.tsxlistens once and threads the resulting accessor down throughTranscriptRow.tsxtoAssistantMessage.tsx, which lights up the matching part'stool-part-wrapperwith adata-timeline-highlightattribute and the bar's own color as a CSS var.chat-layout.cssis an absolutely-positioned pseudo-element, not an insetbox-shadow: a box-shadow paints as part of 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. An absolutely positioned element always paints above normal-flow children instead. It also has to stay within the wrapper's own bounds — the row virtualizer (virtua) clips its content to exactly that box, so a negative offset placed correctly for a non-virtualized row gets silently clipped once rows are virtualized..vscode-session-turn-assistantgets a small extrapadding-left(assistant rows only, not user bubbles/diffs) to give the strip room to sit off the card edge with a visible gap.onPointerDownhid the tooltip pre-emptively in case the interaction turned into a drag, which also cleared the hover state driving the highlight — so on a plain click (no drag) the highlight vanished immediately even though the pointer never left the bar.onPointerUpnow restores it for the clicked bar after the jump.Screenshots / Video
Not attached here — no GUI available in this environment to capture screenshots. The feature was visually verified interactively during development (see Reviewer test steps); please add before/after screenshots before merge if required.
How to Test
Manual/local verification
bun run typecheck,bun run lint, and the timeline unit tests (task-timeline-tooltip,timeline-colors,timeline-geometry,timeline-sizes) against this commit in isolation (stashed all unrelated in-progress work first) — all pass.Reviewer test steps
bun run extensionto launch the dev extension host.Blocked checks and substitute verification
bun run typecheck/lint/unit tests plus diff review as described above.Checklist
Get in Touch