Skip to content

Prompt timeline rail for the Agents window#324131

Draft
osortega wants to merge 4 commits into
mainfrom
osortega/prompt-timeline
Draft

Prompt timeline rail for the Agents window#324131
osortega wants to merge 4 commits into
mainfrom
osortega/prompt-timeline

Conversation

@osortega

@osortega osortega commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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

  • Self-contained contrib under src/vs/sessions/contrib/promptTimeline, attached per-widget via IChatWidgetContrib (no vs/workbench changes, no import cycle).
  • Recency-bucketed ticks — pure, unit-tested budgetBucketPrompts, capped so each tick keeps a >=24px hit target (WCAG 2.5.8).
  • Dense-at-rest visual that expands 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 the provider-agnostic IChatResponseFileChangesService (agent-host server-computed turn changeset) with an editing-session fallback. Diff sides are probed with readFile so a missing agent-host checkpoint blob renders the file 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 (experimental, default on) and ChatContextKeys.enabled; the rail is created/disposed reactively as the setting toggles.

Validation

  • npm run typecheck-client — pass
  • npm run valid-layers-check — pass
  • eslint on the contrib — pass
  • npm run precommit (hygiene) — pass (only non-blocking design-token suggestions remain)
  • promptBucketing unit tests

Follow-ups

  • Refine engaged interaction to the quiet gray-dense + single-mark accordion model.
  • Apply design-token suggestions (font-size / radius / spacing) once the visual is locked.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

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>
Copilot AI review requested due to automatic review settings July 3, 2026 00:02

Copilot AI left a comment

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.

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 promptTimeline sessions 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 in promptTimeline.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');
osortega and others added 3 commits July 2, 2026 17:12
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>
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.

2 participants