Skip to content

share recent folders between apps#311963

Merged
sandy081 merged 1 commit intomainfrom
sandy081/top-ape
Apr 22, 2026
Merged

share recent folders between apps#311963
sandy081 merged 1 commit intomainfrom
sandy081/top-ape

Conversation

@sandy081
Copy link
Copy Markdown
Member

Co-authored-by: Copilot copilot@github.com

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 18:34
@sandy081 sandy081 enabled auto-merge (squash) April 22, 2026 18:34
@sandy081 sandy081 self-assigned this Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 31320b4c Current: 6059b25b

Changed (5)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Dark
Before After
before after
chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates workspace/session pickers and storage so that “recent folders” can be shared across apps (e.g. VS Code and the Agents/Sessions app) and displayed with richer metadata (grouping + secondary text).

Changes:

  • Persist “recently opened” history in application-shared storage to enable cross-app sharing.
  • Extend session workspace metadata (description + group) and surface VS Code recents in the sessions workspace picker.
  • Update the action widget list/dropdown UI to support a dedicated detail second line, inline descriptions, and group-title display.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.ts Switch picker secondary text from description to detail.
src/vs/sessions/services/sessions/common/sessionsProvider.ts Allow resolveWorkspace to return undefined when URI can’t be handled.
src/vs/sessions/services/sessions/common/session.ts Add optional description and group to ISessionWorkspace.
src/vs/sessions/contrib/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts Stub ILabelService and adjust assertions for optional workspace resolution.
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts Add workspace description/group and return undefined for unsupported schemes.
src/vs/sessions/contrib/copilotChatSessions/test/browser/copilotChatSessionsProvider.test.ts Stub ILabelService and adjust assertions for optional workspace resolution.
src/vs/sessions/contrib/copilotChatSessions/browser/permissionPicker.ts Use detail for subtext; remove descriptionBelow list option.
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsProvider.ts Add workspace description/group derived from URI; make resolveWorkspace scheme-aware.
src/vs/sessions/contrib/copilotChatSessions/browser/claudePermissionModePicker.ts Use detail and updated list options.
src/vs/sessions/contrib/chat/test/browser/sessionWorkspacePicker.test.ts Stub new services and handle optional resolveWorkspace.
src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts Merge VS Code “recent folders” into sessions recents; add grouping and inline description list options.
src/vs/sessions/contrib/chat/browser/scopedWorkspacePicker.ts Display workspace descriptions in the scoped picker.
src/vs/sessions/contrib/changes/browser/changesView.ts Switch picker secondary text to detail; update list options usage.
src/vs/sessions/contrib/agentHost/test/browser/localAgentHostSessionsProvider.test.ts Stub ILabelService and adjust assertions for optional workspace resolution.
src/vs/sessions/contrib/agentHost/browser/localAgentHostSessionsProvider.ts Add workspace description/group and return undefined for unsupported schemes.
src/vs/sessions/contrib/agentHost/browser/baseAgentHostSessionsProvider.ts Make resolveWorkspace optional and guard create flow when it returns undefined.
src/vs/sessions/common/agentHostSessionWorkspace.ts Plumb optional workspace description through builder options.
src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts Store/load recents from APPLICATION_SHARED scope for cross-app sharing.
src/vs/platform/storage/electron-main/storageMainService.ts Broaden application storage main service APIs to accept APPLICATION_SHARED.
src/vs/platform/actionWidget/browser/actionWidgetDropdown.ts Forward new detail field into action list items.
src/vs/platform/actionWidget/browser/actionWidget.css Add styling for detail, inline description mode, and group-title display.
src/vs/platform/actionWidget/browser/actionList.ts Add detail, group-title rendering logic, updated list options, and accessibility label composition.

Copilot's findings

Comments suppressed due to low confidence (3)

src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts:927

  • URI.revive does no validation and the recent-workspace entries come from profile storage. Please use URI.from(stored.uri, true) (and handle invalid components) when building ownUris to avoid accepting malformed/untrusted URI components from storage.
		// Collect URIs already in sessions history to avoid duplicates
		const ownRecents = this._getStoredRecentWorkspaces();
		const ownUris = new Set(ownRecents.map(r => URI.revive(r.uri).toString()));

src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts:883

  • removeRecentlyOpened returns a promise; calling it without await/void means rejections can become unhandled. Please await it or explicitly void ...catch(...) depending on whether failures should be surfaced.
	protected _removeVSCodeRecentWorkspace(selection: IWorkspaceSelection): void {
		const uri = selection.workspace.repositories[0]?.uri;
		if (!uri) {
			return;
		}
		this.workspacesService.removeRecentlyOpened([uri]);

src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts:259

  • Switching the MRU storage from StorageScope.APPLICATION to APPLICATION_SHARED will cause existing users’ recents (stored under APPLICATION) to appear empty after upgrade. Consider migrating: if shared is empty but application has data, read from the old scope once and store it into APPLICATION_SHARED (and/or fall back to the old scope for reads).
		// First try with storage service
		const storedRecentlyOpenedRaw = this.applicationStorageMainService.get(WorkspacesHistoryMainService.RECENTLY_OPENED_STORAGE_KEY, StorageScope.APPLICATION_SHARED);
		if (typeof storedRecentlyOpenedRaw === 'string') {
			try {
				storedRecentlyOpened = JSON.parse(storedRecentlyOpenedRaw);
			} catch (error) {
  • Files reviewed: 22/22 changed files
  • Comments generated: 3

Comment thread src/vs/platform/storage/electron-main/storageMainService.ts
Comment thread src/vs/sessions/contrib/chat/browser/sessionWorkspacePicker.ts
@sandy081 sandy081 merged commit e65f99d into main Apr 22, 2026
44 of 45 checks passed
@sandy081 sandy081 deleted the sandy081/top-ape branch April 22, 2026 20:58
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 22, 2026
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.

3 participants