Prompt timeline rail for the Agents window#324131
Draft
osortega wants to merge 4 commits into
Draft
Conversation
Introduce a right-edge "prompt timeline" rail in the Agents window that lets users scan and jump between the prompts they have sent in a chat session, adapted from GitHub's "jump to your messages" affordance. - Self-contained contrib under src/vs/sessions/contrib/promptTimeline, attached per-widget via IChatWidgetContrib (no vs/workbench changes). - Recency-bucketed ticks (pure, unit-tested budgetBucketPrompts) capped so each tick keeps a >=24px hit target (WCAG 2.5.8). - Dense marks at rest that expand on hover/focus, with green/red per-turn diff magnitude and a solid-blue active mark. - Interactive hover card: prompt text, clickable +/- diff stats that open the per-request diff, and per-file drill-down rows. - Per-request diffs via provider-agnostic IChatResponseFileChangesService (agent-host server-computed turn changeset) with editing-session fallback; diff sides are probed so missing checkpoint blobs render as a pure add/delete instead of crashing the multi-diff editor. - Keyboard-first commands: Go to Next/Previous Prompt, Go to Prompt... (quick pick), Review Changes for Prompt, with ARIA announcements. - Gated behind the new sessions.promptTimeline.enabled setting and ChatContextKeys.enabled; rail is created/disposed reactively. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a self-contained prompt timeline rail to the Agents window (vs/sessions). It overlays a right-edge vertical rail on the chat transcript that lets users scan and jump between the prompts they have sent, showing recency-bucketed ticks with per-turn diff magnitude, an interactive hover card, and keyboard commands. It is implemented as a per-widget IChatWidgetContrib attached via ChatWidget.CONTRIBS (no vs/workbench changes), gated behind a new experimental sessions.promptTimeline.enabled setting, and reuses the provider-agnostic IChatResponseFileChangesService (with an editing-session fallback) for diffs.
Changes:
- New
promptTimelinesessions contrib: pure bucketing (promptBucketing.ts, unit-tested), a reactive model, a presentation rail, four keyboard commands, and CSS. - Registration wiring: side-effect import in
sessions.common.main.ts, config schema + contrib push + action registration inpromptTimeline.contribution.ts. - Build metadata: i18n resource entry and new stylelint known CSS variables.
Show a summary per file
| File | Description |
|---|---|
src/vs/sessions/sessions.common.main.ts |
Adds side-effect import to load the new contribution. |
src/vs/sessions/contrib/promptTimeline/common/promptTimeline.ts |
Shared constants: contrib id, setting key, min prompts, command ids. |
src/vs/sessions/contrib/promptTimeline/browser/promptTimeline.contribution.ts |
Registers the experimental setting, pushes the widget contrib, registers actions. |
src/vs/sessions/contrib/promptTimeline/browser/promptTimelineWidgetContrib.ts |
Per-widget lifecycle: creates/tears down the rail reactively with the setting; navigation API for commands. |
src/vs/sessions/contrib/promptTimeline/browser/promptTimelineModel.ts |
Derives bucketed ticks + active tick from the view model; resolves per-request diffs and opens reviews. |
src/vs/sessions/contrib/promptTimeline/browser/promptTimelineRail.ts |
DOM rail: ticks, magnify, hover card, fit/capacity measurement (flagged: toolbar keyboard nav). |
src/vs/sessions/contrib/promptTimeline/browser/promptTimelineActions.ts |
Four keyboard commands (flagged: keybinding collision with existing chat nav actions). |
src/vs/sessions/contrib/promptTimeline/browser/promptBucketing.ts |
Pure recency-bucketing with a hard MAX_TICKS cap; sampling/expansion helpers. |
src/vs/sessions/contrib/promptTimeline/browser/media/promptTimeline.css |
Rail/card styling (author defers design-token cleanup as follow-up). |
src/vs/sessions/contrib/promptTimeline/test/browser/promptBucketing.test.ts |
Unit tests for the bucketing algorithm. |
build/lib/stylelint/vscode-known-variables.json |
Registers the new custom CSS variables. |
build/lib/i18n.resources.json |
Registers the new module for localization. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Medium
Comment on lines
+45
to
+49
| keybinding: { | ||
| weight: KeybindingWeight.WorkbenchContrib, | ||
| when: ContextKeyExpr.and(TIMELINE_PRECONDITION, ChatContextKeys.inChatSession), | ||
| primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.DownArrow, | ||
| }, |
Comment on lines
+117
to
+119
| this._domNode = $('nav.prompt-timeline-rail'); | ||
| this._domNode.setAttribute('aria-label', localize('promptTimeline.railLabel', "Prompt timeline")); | ||
| this._domNode.setAttribute('role', 'toolbar'); |
Replace the whole-rail expand-on-engage behavior with a per-mark accordion. The rail now stays quiet, gray and dense at all times; only the mark under the pointer (or keyboard focus) expands to a >=24px pill and reveals its green/red diff, so the rail no longer becomes a column of slim pills with large gaps when interacted with. - CSS: drop the `.engaged` whole-rail slot expansion and the transform fisheye; expand only `:hover`/`:focus-visible` marks (8px -> 24px slot, fat pill, diff colors). Active mark stays solid blue in every state. - Rail: remove the fisheye magnify, the engaged-state tracking, and the magnitude width buckets; capacity now reserves headroom for a single expanded mark over the dense 8px rhythm, so more prompts fit. - Drop the now-unused --tick-scale/--tick-scale-y custom properties. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…t that file Clicking a file row in the hover card previously opened a standalone single-file diff. Route it through the same multi-file diff we already build for "Review Changes", passing viewState.revealData so it opens revealed at the clicked file. Per-file and whole-prompt review now share one multi-diff experience (and open in the modal editor when enabled), reusing the existing MultiDiffEditorInput without any new UI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…apshot The per-prompt diff was rendering before-turn vs the live working file, so it showed the combined changes of all later turns. The per-turn changeset already carries a frozen "after" snapshot; surface it and diff against it. - Add optional `modifiedContentURI` to IEditSessionEntryDiff: the frozen after-state RHS content, distinct from `modifiedURI` (the live file used for identity / go-to-file). Opt-in, so existing consumers (e.g. the chat "Changed N files" summary) keep their current behavior unchanged. - Populate it in AgentHostResponseFileChangesProvider from the changeset's after-content; extend its test to assert the mapping. - PromptTimelineModel now diffs originalURI (frozen before) against the frozen after snapshot, so review shows only that turn's changes, while go-to-file still opens the live working file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Prompt timeline
Adds a right-edge prompt timeline rail to the Agents window that lets users scan and jump between the prompts they have sent in a chat session — adapted from GitHub's "jump to your messages" affordance.
Note
Draft — sharing early to keep history. Interaction/visuals are still being iterated (a "quiet gray-dense rail + single-mark accordion on hover" refinement is planned next).
What's included
src/vs/sessions/contrib/promptTimeline, attached per-widget viaIChatWidgetContrib(novs/workbenchchanges, no import cycle).budgetBucketPrompts, capped so each tick keeps a >=24px hit target (WCAG 2.5.8).+/-diff stats that open the per-request diff, and per-file drill-down rows.IChatResponseFileChangesService(agent-host server-computed turn changeset) with an editing-session fallback. Diff sides are probed withreadFileso a missing agent-host checkpoint blob renders the file as a pure add/delete instead of crashing the multi-diff editor.sessions.promptTimeline.enabledsetting (experimental, default on) andChatContextKeys.enabled; the rail is created/disposed reactively as the setting toggles.Validation
npm run typecheck-client— passnpm run valid-layers-check— passeslinton the contrib — passnpm run precommit(hygiene) — pass (only non-blocking design-token suggestions remain)promptBucketingunit testsFollow-ups
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com