Skip to content

feat(vscode): refine timeline step details UX#12256

Open
sylwester-liljegren wants to merge 8 commits into
Kilo-Org:mainfrom
sylwester-liljegren:feat/timeline-step-dividers-detail
Open

feat(vscode): refine timeline step details UX#12256
sylwester-liljegren wants to merge 8 commits into
Kilo-Org:mainfrom
sylwester-liljegren:feat/timeline-step-dividers-detail

Conversation

@sylwester-liljegren

@sylwester-liljegren sylwester-liljegren commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue. This is a self-contained UX improvement for the task timeline and step details experience.

Fixes # (exception: no dedicated issue exists for this follow-up UX work)

Context

The task timeline currently compresses an entire assistant session into a compact row of activity bars. That works for quick navigation, but it becomes hard to understand where one assistant step ends and the next begins, especially in longer sessions with reasoning, tool calls, and final text responses.

This PR makes the timeline step-aware. The CLI records authoritative start/end timestamps on step boundary parts, and the VS Code webview uses those markers to visually separate steps, expose step-level metadata, and make bar actions more explicit.

The intended product behavior is:

  • The timeline should show visual separation between assistant steps without adding noisy extra activity bars.
  • Clicking a timeline bar should present available actions instead of immediately choosing one behavior for the user.
  • Users should still have a fast way to jump from a bar to the corresponding transcript location.
  • Step details should summarize the whole step, not duplicate the full part content that is already visible in chat.
  • Timing, cost, token, cache, agent, provider, and model information should be visible in one clean details dialog.
  • New user-facing labels should be localized across supported locales.

Implementation

The backend/session data now includes authoritative timing for step boundaries:

  • step-start parts carry a time.start timestamp.
  • step-finish parts carry time.start and time.end timestamps.
  • The step end timestamp is captured as soon as step-finish is received, before snapshot/reconcile/event-publishing work, so recorded duration does not include unrelated post-step processing.
  • The webview message types mirror those fields so timeline details can use backend-produced times instead of deriving them from UI state.

The timeline rendering now treats step markers as metadata, not ordinary visible activity bars:

  • step-start and step-finish are retained while building step metadata.
  • Visible activity bars exclude step markers, so the green step-finish bars are not shown as normal timeline activity.
  • Dividers are inserted after each completed step using the last visible part in that step as the anchor.
  • Dividers use a thin centered line with spacing on both sides.
  • The trailing divider is hidden after an idle final response and appears again while the next prompt is being processed.
  • Divider height is based on the tallest visible bar in the timeline.

Timeline interactions are explicit and keyboard-accessible:

  • Left-clicking a bar opens a context menu at the bar with Go to part and Step details.
  • Go to part scrolls the chat transcript to the referenced message part.
  • Step details opens the step-level details dialog.
  • Right-clicking a bar preserves the previous jump-to-part behavior instead of opening the custom menu.
  • Keyboard activation keeps the existing jump behavior for Enter/Space.
  • Keyboard users can open the action menu with Shift+Enter, Shift+F10, or the Context Menu key.

The step details dialog was redesigned to show only step-level information:

  • Title format is Details - Step N.
  • Fields include agent, provider, model, started date/time, finished date/time, duration, and total cost.
  • Token display uses the same style as other usage summaries: In, Out, Reason, plus Cache R, W, and cache hit rate.
  • The dialog avoids duplicating part-level content because the transcript already shows that content after Go to part.
  • The dialog content scrolls correctly when details exceed the available height.

The webview strings added by this feature are now localized through @kilocode/kilo-i18n:

  • Timeline context menu labels.
  • Step tooltip labels.
  • Details dialog title and field labels.
  • Token and cache summary lines.

The changeset was updated so release notes describe the final user-facing behavior rather than an intermediate implementation.

Screenshots / Video

image image image image

The CI visual-regression run generated an updated task-header-with-steps-chromium-linux.png baseline for the new timeline state. Because this is a fork PR, the workflow cannot auto-commit that baseline; a maintainer may need to update/accept the screenshot baseline.

How to Test

Manual/local verification

  • [agent] bun run lint in packages/kilo-vscode
  • [agent] bun run typecheck in packages/kilo-vscode
  • [agent] bun test tests/unit/task-timeline-tooltip.test.ts tests/unit/font-size-arch.test.ts tests/unit/timeline-geometry.test.ts tests/unit/timeline-highlight-events.test.ts tests/unit/transcript-parts.test.ts --timeout 60000 in packages/kilo-vscode
  • [agent] bun run typecheck in packages/opencode
  • [agent] bun test test/kilocode/session-processor-empty-tool-calls.test.ts --timeout 60000 in packages/opencode
  • [agent] bun run typecheck in packages/kilo-i18n
  • [agent] bun run script/check-opencode-annotations.ts from the repo root
  • [human] Verified the timeline dividers, left-click menu, right-click jump behavior, and step details dialog visually in the VS Code webview during iteration.

Reviewer test steps

  1. Start a session that produces multiple assistant steps with reasoning/tool/text parts.
  2. Open the task timeline in the task header.
  3. Confirm visible dividers separate steps and that step-finish bars are not shown as separate green activity bars.
  4. Confirm the final trailing divider is hidden once the assistant response is idle.
  5. Send another prompt and confirm the trailing divider appears again while the next prompt is processing.
  6. Left-click a timeline bar and confirm a context menu appears with Go to part and Step details.
  7. Choose Go to part and confirm the transcript scrolls to the referenced part.
  8. Right-click a timeline bar and confirm it preserves direct jump-to-part behavior.
  9. Focus the timeline with keyboard navigation, then press Shift+Enter, Shift+F10, or the Context Menu key and confirm the same action menu opens.
  10. Choose Step details from the left-click or keyboard menu and confirm the dialog title is Details - Step N.
  11. Confirm the dialog shows agent/provider/model, started/finished date+time, duration, total cost, token counts, cache read/write, and cache hit rate.
  12. Confirm the dialog shows step-level information only and does not duplicate the clicked part content.
  13. Switch the UI language, if available, and confirm the new timeline menu/dialog strings are localized.

Blocked checks and substitute verification

  • Local pre-push hook was run once and reached the JetBrains typecheck, but the local machine does not have a Java 21 toolchain. Per request, pushes used --no-verify; CI runs JetBrains checks separately.
  • A full local bun run test:unit from packages/kilo-vscode is not reliable in this Windows shell because unrelated tests depend on POSIX paths, symlink privileges, or /bin/bash. Substitute verification is the targeted VS Code unit coverage listed above plus CI.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

kilo-code-bot Bot and others added 5 commits July 14, 2026 18:48
Introduces authoritative step timing in the session schema and implements
visual dividers in the task timeline to clearly separate activity steps.

- Update `StepStartPart` and `StepFinishPart` schemas to include `time`
  metadata (start/end timestamps).
- Implement `withDividers` logic in `TaskTimeline` to inject visual
  separators after step-finish events.
- Update timeline geometry calculations to support divider positioning.
- Add detailed step information view in the task header.
- Update session processor to capture and attach step timing to parts.
Introduces authoritative step timing in the session schema and implements
visual dividers in the task timeline to clearly separate activity steps.

- Update `StepStartPart` and `StepFinishPart` schemas to include `time`
  metadata (start/end timestamps).
- Implement `withDividers` logic in `TaskTimeline` to inject visual
  separators after step-finish events.
- Update timeline geometry calculations to support divider positioning.
- Add detailed step information view in the task header.
- Update session processor to capture and attach step timing to parts.
// kilocode_change start - authoritative step timing for the activity timeline
time: {
start: ctx.stepStartAt || Date.now(),
end: Date.now(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: time.end includes unrelated post-step work, inflating the recorded step duration

end: Date.now() is captured here, after completedSnapshot tracking, finishReasoning, usage/model computation, KiloSessionProcessor.trackStep, the v2 event mirror publish, and reconcile() (which does an async DB round-trip via MessageV2.get). This makes the timeline's authoritative step duration include several unrelated async operations rather than just the LLM step itself, and it will be inconsistent with the elapsed value computed earlier (line 854) for telemetry on the very same step. Consider capturing end immediately when the step-finish event is received, before the snapshot/reconcile work runs.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

if (!ref || !["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) return
e.preventDefault()
const idx = navigate(selected(), bars().length, e.key)
const idx = navigate(selected(), items().length, e.key)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: No keyboard path to open the new bar context menu / "Step details" action

onKeyDown (this function) only wires Enter/Space to select() (jump-to-part) and arrow/Home/End to navigation. The new left-click menu (openMenuAt, opened via onPointerUp for a non-dragged left click) has no keyboard equivalent, so "Step details" is unreachable from the keyboard — only mouse users can open it. Consider adding a keyboard shortcut (e.g. a dedicated key, or Shift+Enter) that calls openMenuAt for the currently selected bar.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

font-size: var(--kilo-font-size-13);
}

.task-timeline-detail-badge {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Unused CSS selectors added by this PR

.task-timeline-detail-badge (262), .task-timeline-detail-meta (271), .task-timeline-detail-value (276), .task-timeline-detail-block (282), .task-timeline-detail-label (286), and .task-timeline-detail-pre (292) aren't referenced anywhere in webview-ui/src — the step details dialog in TaskTimeline.tsx only renders .task-timeline-detail, -summary, -body, -summary-body, -grid, -tokens, -token-label, and -token-line. These look like leftovers from an earlier iteration of the dialog. Consider removing the unused rules.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

})

it("renders slim dividers and hides the trailing one while idle", () => {
expect(src).toMatch(/function withDividers\(bars: TimelineBar\[], ends: string\[], tail: boolean\)/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: New tests assert on source text instead of exercising real behavior

The two new tests ("renders slim dividers and hides the trailing one while idle", "opens a context menu on right-clicked bars") use readFileSync + regex toMatch against the component's source string rather than calling withDividers, rendering the component, or dispatching real events and asserting on the resulting output. They'll pass unchanged even if the actual divider placement or menu logic is wrong, and will fail on purely cosmetic refactors that don't change behavior — this runs against the repo convention that "tests MUST test actual implementation, do not duplicate logic into a test." Consider testing withDividers directly with sample bars/ends/tail input and asserting on the resulting array, and/or rendering TaskTimeline to assert the menu opens with real DOM state.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

This is an incremental review at 64c7eaa. All 4 previously reported issues remain fixed. The only file-level differences since the last review (3f6fe3fb) come from merging main (the memory feature and incomplete-response-retry feature); the PR's own diff against its base is unchanged. No new issues found.

Files Reviewed (12 files)
  • .changeset/timeline-step-dividers-detail.md - unchanged, no issues
  • packages/core/src/v1/session.ts - unchanged, no issues
  • packages/opencode/src/session/processor.ts - unchanged (PR-owned diff), previous timing issue remains fixed
  • packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx - unchanged, previous keyboard-access issue remains fixed
  • packages/kilo-vscode/webview-ui/src/utils/timeline/dividers.ts - unchanged, no issues
  • packages/kilo-vscode/webview-ui/src/utils/timeline/geometry.ts - unchanged, no issues
  • packages/kilo-vscode/webview-ui/src/utils/timeline/sizes.ts - unchanged, no issues
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx - net PR diff unchanged, no issues
  • packages/kilo-vscode/webview-ui/src/styles/task-header.css - net PR diff unchanged, previous dead-CSS issue remains fixed
  • packages/kilo-vscode/webview-ui/src/types/messages/parts.ts - net PR diff unchanged, no issues
  • packages/kilo-vscode/tests/unit/task-timeline-tooltip.test.ts - unchanged, previous test-quality issue remains fixed
  • packages/sdk/js/src/v2/gen/types.gen.ts, packages/sdk/openapi.json - generated SDK updates picked up from base branch merge, no issues
Previous Review Summaries (2 snapshots, latest commit 3f6fe3f)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3f6fe3f)

Status: No Issues Found | Recommendation: Merge

All 4 previously reported issues in this PR have been fixed in the latest commit:

  • packages/opencode/src/session/processor.ts: step end timestamp is now captured before snapshot/reconcile/event-publish work.
  • packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx: keyboard users can now open the bar action menu via Shift+Enter, Shift+F10, or the Context Menu key (also reflected in aria-keyshortcuts).
  • packages/kilo-vscode/webview-ui/src/styles/task-header.css: the unused step-detail CSS selectors were removed.
  • packages/kilo-vscode/tests/unit/task-timeline-tooltip.test.ts: tests now exercise the extracted withDividers/resolveMenuIndex functions directly instead of asserting on source text.

No new issues found in the incremental diff.

Files Reviewed (7 files)
  • packages/opencode/src/session/processor.ts - previous issue fixed
  • packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx - previous issue fixed
  • packages/kilo-vscode/webview-ui/src/utils/timeline/dividers.ts - new file, extracted helpers, no issues
  • packages/kilo-vscode/webview-ui/src/styles/task-header.css - previous issue fixed
  • packages/kilo-vscode/webview-ui/src/types/messages/parts.ts - no issues (kilocode_change markers correctly removed from this kilo-only path)
  • packages/kilo-vscode/tests/unit/task-timeline-tooltip.test.ts - previous issue fixed
  • packages/kilo-vscode/webview-ui/tests/e2e/screenshots/chat/task-header-with-steps-chromium-linux.png - baseline screenshot, no issues

Previous review (commit 0b6d8ee)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 2
Issue Details (click to expand)

WARNING

File Line Issue
packages/opencode/src/session/processor.ts 889 time.end is captured after unrelated async work (snapshot tracking, telemetry, event publish, reconcile()), inflating the recorded step duration
packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx 455 No keyboard path to open the new left-click bar menu / "Step details" action

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/styles/task-header.css 262 Six new CSS selectors (-badge, -meta, -value, -block, -label, -pre) are unused by the step details dialog
packages/kilo-vscode/tests/unit/task-timeline-tooltip.test.ts 51 New tests assert on source text via regex instead of exercising real divider/menu behavior
Files Reviewed (28 files)
  • .changeset/timeline-step-dividers-detail.md - no issues (accurate, user-facing, appropriate bump types)
  • packages/core/src/v1/session.ts - no issues (schema additions follow existing patterns, correctly marked)
  • packages/opencode/src/session/processor.ts - 1 issue (timing capture)
  • packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx - 1 issue (keyboard accessibility)
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx - no issues
  • packages/kilo-vscode/webview-ui/src/styles/task-header.css - 1 issue (dead CSS)
  • packages/kilo-vscode/webview-ui/src/types/messages/parts.ts - no issues (types consistent with backend schema)
  • packages/kilo-vscode/webview-ui/src/utils/timeline/geometry.ts - no issues
  • packages/kilo-vscode/webview-ui/src/utils/timeline/sizes.ts - no issues
  • packages/kilo-vscode/tests/unit/task-timeline-tooltip.test.ts - 1 issue (test quality)
  • packages/kilo-i18n/src/{ar,br,bs,da,de,en,es,fr,it,ja,ko,nl,no,pl,ru,th,tr,uk,zh,zht}.ts (20 files) - no issues; all locales add the same 15 timeline.* keys with matching interpolation placeholders and no syntax errors

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 62 · Output: 14.5K · Cached: 1.8M

Review guidance: REVIEW.md from base branch main

@sylwester-liljegren

sylwester-liljegren commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the Kilo Code Review feedback in 3f6fe3fb1a:

  • Captured step-finish end time immediately when the event is received, before snapshot/reconcile/event-publish work.
  • Added keyboard access to the timeline action menu via Shift+Enter, Shift+F10, and the Context Menu key.
  • Removed stale step-detail CSS selectors left over from the part-details iteration.
  • Moved divider/menu logic into a timeline utility and replaced the new regex-only assertions with behavior tests against the actual helpers.
  • Added the generated VS Code webview visual baseline for task-header-with-steps.

Local validation run after fixes:

  • VS Code lint/typecheck
  • Focused timeline/font-size tests
  • opencode typecheck
  • Kilo-specific session processor test
  • opencode annotation guard

Sylwester Liljegren added 2 commits July 16, 2026 15:37
# Conflicts:
#	packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx
#	packages/opencode/src/session/processor.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant