-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Adding browse repositories as a command #3145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds a "Browse repositories" command to the repository picker in the Copilot Cloud Sessions feature, replacing the previous inline search functionality with a dedicated command that opens a searchable QuickPick interface.
Changes:
- Added a new
commandsproperty toChatSessionProviderOptionGroupinterface in the proposed API - Implemented a new command
github.copilot.chat.cloudSessions.openRepositorythat displays a searchable QuickPick for browsing repositories - Changed repository option items to use the option group ID instead of unique repository names as their IDs
- Replaced the inline
onSearchcallback with a command-based approach for repository browsing
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/extension/vscode.proposed.chatSessionsProvider.d.ts | Added commands property to ChatSessionProviderOptionGroup to support action buttons in option group dropdowns |
| src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts | Implemented browse repositories command, added event emitter for session option changes, and modified repository option items structure |
| package.nls.json | Added localization string for the browse repositories command title |
| package.json | Registered the new browse repositories command with appropriate metadata |
Comments suppressed due to low confidence (3)
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:351
- The onDidAccept event listener is not being disposed. Consider registering the disposable returned by onDidAccept to ensure proper cleanup when the QuickPick is disposed.
quickPick.onDidAccept(() => {
const selected = quickPick.selectedItems[0];
if (selected && sessionItemResource) {
this.sessionRepositoryMap.set(sessionItemResource, selected.label);
this._onDidChangeChatSessionOptions.fire({
resource: sessionItemResource,
updates: [{
optionId: REPOSITORIES_OPTION_GROUP_ID,
value: { id: REPOSITORIES_OPTION_GROUP_ID, name: selected.label, icon: new vscode.ThemeIcon('repo') }
}]
});
}
quickPick.hide();
});
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:620
- All repository option items now use REPOSITORIES_OPTION_GROUP_ID as their 'id', but previously they used the full repository name. This change makes all items have the same 'id', which could cause issues in UI selection and tracking. According to the ChatSessionProviderOptionItem interface, the 'id' field should be a "Unique identifier for the option item". Consider using the repository name as the 'id' to maintain uniqueness.
id: REPOSITORIES_OPTION_GROUP_ID,
name: nwo,
icon: new vscode.ThemeIcon('repo'),
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:609
- All repository option items now use REPOSITORIES_OPTION_GROUP_ID as their 'id', but previously they used the full repository name. This change makes all items have the same 'id', which could cause issues in UI selection and tracking. According to the ChatSessionProviderOptionItem interface, the 'id' field should be a "Unique identifier for the option item". Consider using the repository name as the 'id' to maintain uniqueness.
id: REPOSITORIES_OPTION_GROUP_ID,
name: `${repoId.org}/${repoId.repo}`,
default: index === 0,
icon: new vscode.ThemeIcon('repo'),
});
No description provided.