Skip to content

Timeline: multi-select, workspace timelines, and API cleanup for finalization - #341560

Merged
Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/agents/vscode-issue-145202-investigation
Oct 15, 2026
Merged

Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/agents/vscode-issue-145202-investigation

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #145202, refs #84297

Reshapes the proposed timeline API so it can be finalized in one step, and implements it in core, local history, git and github. Breaking changes to the proposal are intentional. Outside this repo, the distro product.json allowlists only GitHub.remotehub and ms-vscode.remote-repositories, and only the latter declares the proposal. It's updated in microsoft/vscode-remotehub#915, which requires ^1.143.0 and should be published after this lands in Insiders.

Why the larger changes

  • Selection as a 4th command argument: commands on timeline items now run with (item, uri, source, selectedItems?). It is appended rather than following tree views' (item, selectedItems) because timeline/item/context is a stable menu and existing commands rely on uri being second. Selected items are limited to the clicked item's provider, since the view mixes providers. Context menus now see listMultiSelection/listDoubleSelection; before this change, the !listMultiSelection clauses in git had no effect.

  • TimelineItem.resourceUri: the content of the resource as of that entry. It lets core own Compare Selected across providers (local history ↔ git, Timeline: cant select compare between local saves and git commits #225360) and gives other extensions something meaningful to act on (TimelineItem command callback values are now useless for "foreign" extensions #177319).

  • Read-only copies for other extensions: the extension that provided an item receives the original object, and other extensions get a frozen copy of its public properties without command. This follows jrieken's plan on TimelineItem command callback values are now useless for "foreign" extensions #177319. Copies are still only given to extensions with the proposal enabled until finalization.

  • Separate WorkspaceTimelineProvider: the workspace timeline was the blocker for finalizing in 2021. It gets its own interface rather than making uri optional on provideTimeline:

    • Implementing the interface is how a provider opts in.
    • scheme only applies where it means something.
    • TypeScript doesn't catch class providers typed uri: Uri against a Uri | undefined parameter, which would turn into runtime errors.
    • This follows the existing document/workspace symbol provider split.

    A timeline provider and a workspace timeline provider from the same extension can share an id and appear as one source in the filter.

  • Workspace timeline in the view: shown when following an editor without a resource, or pinned from the title menu (Show Workspace Timeline). Explorer's Open Timeline now also works for folders, and always opens the folder's own timeline, including for the workspace root. Opening a commit no longer replaces the timeline with the multi-diff editor's.

  • Simpler paging: limit is now just a count, and Timeline.paging.cursor becomes Timeline.cursor. The { timestamp, id } form of limit existed only so the view could reload the items already shown. The view now re-requests the newest items with a count at least as large as what is loaded, and drops duplicates by id. Paging confusion was the most common provider feedback (Cursor and limit properties are ambiguous #94155, Paging API suggestions #94178, API support for Timeline view #84297).

  • Change events: onDidChangeTimeline: Event<Uri | Uri[] | undefined> replaces TimelineChangeEvent. No provider ever sent reset: false, so a change always means the shown items are requested again, which also covers removed items (Timeline API has no way to signal an entry should be removed #145984).

  • TimelineTriggerKind: lets caching providers tell an explicit Refresh apart from automatic requests (requested by the Perforce extension author on API support for Timeline view #84297).

  • Cleanup: internal cacheResults/resetCache no longer reach providers (Merge internal options to timeline options #147304), the deprecated detail fallback is removed, iconPath uses IconPath, and both menus' arguments plus onView:timeline activation are documented.

Extensions and local history

  • git: implements the workspace timeline across all repositories (paged per repository by skip count), adds folder timelines (no --follow; selecting a commit opens it), and sets resourceUri on file items.
  • github: "Open on GitHub" now also shows for folder commits and is hidden on multi-select.
  • Local history: Delete works on the whole selection, single-item commands are hidden on multi-select, and entries set resourceUri.

How to test

  1. Open a folder that is a git repository and close all editors. The Timeline view shows "Workspace" with the repository's commits. Click a commit: it opens and the timeline stays on the workspace.
  2. In Explorer, right-click a folder → Open Timeline: only commits touching that folder are listed.
  3. Open a file, select two entries (for example a local history entry and a git commit), right-click → Compare Selected. The older one is on the left.
  4. Select two local history entries → Delete; the dialog asks to delete 2 entries.

Validation

Rebased onto main (after #341538 and #341549), including the review fixes.

  • npm run typecheck-client: passed
  • tsc -p extensions/git/tsconfig.json --noEmit and tsc -p extensions/github/tsconfig.json --noEmit: passed
  • npm run eslint -- <changed files>: passed
  • ./scripts/test.sh --run src/vs/workbench/api/test/browser/extHostTimeline.test.ts --run src/vs/workbench/api/test/browser/mainThreadTimeline.test.ts --run src/vs/workbench/contrib/timeline/test/browser/timelinePane.test.ts --run src/vs/workbench/contrib/timeline/test/browser/timeline.contribution.test.ts --run src/vs/workbench/contrib/timeline/test/common/timelineService.test.ts: 30 passing
  • ./scripts/test-integration.sh --suite git --grep 'parseGitFileLog|git timeline': 4 passing
  • Manual: ran steps 1–4 in Code OSS, driven with Playwright against a test repository. After the review fixes, also checked: a multi-root workspace with a repository without commits still shows the other repository's workspace timeline; Compare Selected across a file rename opens both versions; and git's inline Open Commit action is hidden on multi-selected rows.
  • Not exercised: remote/virtual workspaces and RemoteHub.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 14:34
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/agents/vscode-issue-145202-investigation branch from d67e770 to e3f62e9 Compare October 14, 2026 14:38

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.

🟡 Changes recommended

Unresolved correctness defects affect history completeness, provider lifecycle, item isolation, comparisons, and selection handling.

6 open findings
What changed in this PR

Updates VS Code’s proposed Timeline API and its core, Git, and local-history integrations toward finalization.

Changes:

  • Adds multi-selection, bulk deletion, and cross-provider comparisons.
  • Adds workspace and folder timelines.
  • Simplifies paging, change events, and extension command arguments.
File Description
src/​vscode-dts/​vscode.proposed.timeline.d.ts Defines the revised proposed API.
src/​vs/​workbench/​contrib/​timeline/​test/​browser/​timelinePane.test.ts Tests reload limits and selection arguments.
src/​vs/​workbench/​contrib/​timeline/​common/​timelineService.ts Routes workspace providers and events.
src/​vs/​workbench/​contrib/​timeline/​common/​timeline.ts Updates internal timeline contracts.
src/​vs/​workbench/​contrib/​timeline/​browser/​timelinePane.ts Implements workspace views and multi-selection.
src/​vs/​workbench/​contrib/​timeline/​browser/​timeline.contribution.ts Enables folder timeline commands.
src/​vs/​workbench/​contrib/​localHistory/​electron-browser/​localHistoryCommands.ts Restricts reveal to single selections.
src/​vs/​workbench/​contrib/​localHistory/​browser/​localHistoryTimeline.ts Supplies snapshot URIs and revised events.
src/​vs/​workbench/​contrib/​localHistory/​browser/​localHistoryCommands.ts Adds bulk deletion and selection-aware menus.
src/​vs/​workbench/​contrib/​localHistory/​browser/​localHistory.ts Defines single-selection menu conditions.
src/​vs/​workbench/​api/​test/​browser/​mainThreadTimeline.test.ts Tests workspace routing and events.
src/​vs/​workbench/​api/​test/​browser/​extHostTimeline.test.ts Tests revised extension API behavior.
src/​vs/​workbench/​api/​common/​extHostTypes.ts Adds timeline trigger kinds.
src/​vs/​workbench/​api/​common/​extHostTimeline.ts Adapts providers and command-item copies.
src/​vs/​workbench/​api/​common/​extHost.protocol.ts Updates timeline communication contracts.
src/​vs/​workbench/​api/​common/​extHost.api.impl.ts Exposes new API entry points.
src/​vs/​workbench/​api/​browser/​mainThreadTimeline.ts Bridges workspace providers and events.
extensions/​github/​package.json Updates GitHub timeline menu conditions.
extensions/​git/​src/​timelineProvider.ts Adds workspace history and snapshot URIs.
extensions/​git/​src/​commands.ts Opens workspace and folder commits.
extensions/​git/​package.json Extends commit menus to new timelines.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread extensions/git/src/timelineProvider.ts Resolved
Comment thread extensions/git/src/timelineProvider.ts Resolved
Comment thread extensions/git/src/timelineProvider.ts Resolved
…lization

Reshapes the proposed timeline API ahead of finalization and implements
it in core, git, github and local history.

- Commands on timeline items receive the selected items as a 4th argument;
  local history supports bulk delete and core adds Compare Selected for
  items that set the new `TimelineItem.resourceUri`.
- New `WorkspaceTimelineProvider`/`registerWorkspaceTimelineProvider`; the
  Timeline view shows the workspace timeline when no editor has a resource,
  and Explorer's Open Timeline works for folders. Git implements both.
- Other extensions receive read-only copies of timeline items.
- Simplified paging (`limit` count + `Timeline.cursor`), `TimelineTriggerKind`,
  and `onDidChangeTimeline: Event<Uri | Uri[] | undefined>`.

Fixes #145202
Refs #84297

Co-authored-by: Copilot <[email protected]>
- Git workspace timeline: treat repositories without commits as empty, only
  resolve details for repositories in the page, and only skip the commits a
  page took from the start of each log, so commits whose log order differs
  from their timestamps are not dropped.
- Git file timeline: resolve the path of the file at each commit with
  `--numstat`, so `resourceUri` points to the old name before a rename.
- Other extensions get copies of timeline items that share no mutable values
  with the original.
- Removing one kind of provider with a shared id reloads the other kind.
- Inline actions get the same selection context keys as the context menu and
  are re-rendered when items enter or leave a multi-selection.

Co-authored-by: Copilot <[email protected]>
@lramos15
Logan Ramos (lramos15) force-pushed the lramos15/agents/vscode-issue-145202-investigation branch from 89d05b0 to 726d433 Compare October 14, 2026 15:15
@gjsjohnmurray

Copy link
Copy Markdown
Contributor

This all looks good. I plan to wait for the PR to land in Insiders, then revise my extension to cater for the changes to the proposed API it's already leveraging.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Ladislau Szomoru (@lszomoru)

Matched files:

  • extensions/git/package.json
  • extensions/git/src/commands.ts
  • extensions/git/src/git.ts
  • extensions/git/src/test/git.test.ts
  • extensions/git/src/test/timelineProvider.test.ts
  • extensions/git/src/timelineProvider.ts
  • extensions/github/package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeline: support multi select commands

4 participants