Skip to content

Commit 85be169

Browse files
Copilotalexr00
andcommitted
Add icon path to empty commit webview panel
- Set git-commit icon for the webview panel tab - Icon appears in both light and dark themes - Uses codicons/git-commit.svg from resources Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 7f91865 commit 85be169

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,14 @@ declare module 'vscode' {
167167
constructor(value: ChatResponseDiffEntry[], title: string, readOnly?: boolean);
168168
}
169169

170-
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart;
170+
export class ChatResponseExternalEditPart {
171+
uris: Uri[];
172+
callback: () => Thenable<unknown>;
173+
applied: Thenable<void>;
174+
constructor(uris: Uri[], callback: () => Thenable<unknown>);
175+
}
176+
177+
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatResponsePullRequestPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart | ChatResponseMultiDiffPart | ChatResponseThinkingProgressPart | ChatResponseExternalEditPart;
171178
export class ChatResponseWarningPart {
172179
value: MarkdownString;
173180
constructor(value: string | MarkdownString);
@@ -301,6 +308,14 @@ declare module 'vscode' {
301308

302309
notebookEdit(target: Uri, isDone: true): void;
303310

311+
/**
312+
* Makes an external edit to one or more resources. Changes to the
313+
* resources made within the `callback` and before it resolves will be
314+
* tracked as agent edits. This can be used to track edits made from
315+
* external tools that don't generate simple {@link textEdit textEdits}.
316+
*/
317+
externalEdit<T>(target: Uri | Uri[], callback: () => Thenable<T>): Thenable<T>;
318+
304319
markdownWithVulnerabilities(value: string | MarkdownString, vulnerabilities: ChatVulnerability[]): void;
305320
codeblockUri(uri: Uri, isEdit?: boolean): void;
306321
push(part: ChatResponsePart | ChatResponseTextEditPart | ChatResponseWarningPart | ChatResponseProgressPart2): void;

src/@types/vscode.proposed.chatParticipantPrivate.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ declare module 'vscode' {
8787
* Events for edited files in this session collected since the last request.
8888
*/
8989
readonly editedFileEvents?: ChatRequestEditedFileEvent[];
90+
91+
readonly isSubagent?: boolean;
9092
}
9193

9294
export enum ChatRequestEditedFileEventKind {

src/github/emptyCommitWebview.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as vscode from 'vscode';
7+
import { EXTENSION_ID } from '../constants';
78

89
/**
910
* Opens a webview panel to display a message for an empty commit.
@@ -20,6 +21,15 @@ export function showEmptyCommitWebview(commitSha: string): void {
2021
}
2122
);
2223

24+
// Set icon for the webview panel tab
25+
const extensionUri = vscode.extensions.getExtension(EXTENSION_ID)?.extensionUri;
26+
if (extensionUri) {
27+
panel.iconPath = {
28+
light: vscode.Uri.joinPath(extensionUri, 'resources', 'icons', 'codicons', 'git-commit.svg'),
29+
dark: vscode.Uri.joinPath(extensionUri, 'resources', 'icons', 'codicons', 'git-commit.svg')
30+
};
31+
}
32+
2333
panel.webview.html = getEmptyCommitHtml();
2434
}
2535

0 commit comments

Comments
 (0)