Skip to content

Commit 015e26c

Browse files
authored
Changing session icons to copilot ones (#7402)
1 parent 75bbb9f commit 015e26c

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

src/github/copilotRemoteAgent.ts

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import { GitHubRemote } from '../common/remote';
1414
import { CODING_AGENT, CODING_AGENT_AUTO_COMMIT_AND_PUSH, CODING_AGENT_ENABLED } from '../common/settingKeys';
1515
import { ITelemetry } from '../common/telemetry';
1616
import { CommentEvent, CopilotFinishedEvent, CopilotStartedEvent, EventType, ReviewEvent, TimelineEvent } from '../common/timelineEvent';
17-
import { toOpenPullRequestWebviewUri } from '../common/uri';
17+
import { DataUri, toOpenPullRequestWebviewUri } from '../common/uri';
18+
import { getIconForeground, getListErrorForeground, getListWarningForeground, getNotebookStatusSuccessIconForeground } from '../view/theme';
1819
import { OctokitCommon } from './common';
1920
import { ChatSessionWithPR, CopilotApi, getCopilotApi, RemoteAgentJobPayload, SessionInfo, SessionSetupStep } from './copilotApi';
2021
import { CopilotPRWatcher, CopilotStateModel } from './copilotPrWatcher';
@@ -781,7 +782,7 @@ export class CopilotRemoteAgentManager extends Disposable {
781782
}
782783
return [];
783784
}
784-
785+
785786
private extractPromptFromEvent(event: TimelineEvent): string {
786787
let body = '';
787788
if (event.event === EventType.Commented) {
@@ -1407,14 +1408,42 @@ export class CopilotRemoteAgentManager extends Disposable {
14071408
return undefined;
14081409
}
14091410

1410-
private getIconForSession(status: CopilotPRStatus): ThemeIcon {
1411+
private getIconForSession(status: CopilotPRStatus): vscode.Uri | vscode.ThemeIcon {
1412+
// Use the same icons as webview components for consistency
1413+
const themeData = this.repositoriesManager.folderManagers[0]?.themeWatcher?.themeData;
1414+
if (!themeData) {
1415+
// Fallback to theme icons if no theme data available
1416+
switch (status) {
1417+
case CopilotPRStatus.Completed:
1418+
return new vscode.ThemeIcon('pass-filled', new vscode.ThemeColor('testing.iconPassed'));
1419+
case CopilotPRStatus.Failed:
1420+
return new vscode.ThemeIcon('close', new vscode.ThemeColor('testing.iconFailed'));
1421+
default:
1422+
return new vscode.ThemeIcon('circle-filled', new vscode.ThemeColor('list.warningForeground'));
1423+
}
1424+
}
1425+
1426+
// Use the same SVG icons as webview components with theme-appropriate colors
1427+
const isDark = vscode.window.activeColorTheme.kind === vscode.ColorThemeKind.Dark ||
1428+
vscode.window.activeColorTheme.kind === vscode.ColorThemeKind.HighContrast;
1429+
const themeKind = isDark ? 'dark' : 'light';
1430+
14111431
switch (status) {
14121432
case CopilotPRStatus.Completed:
1413-
return new ThemeIcon('pass-filled', new vscode.ThemeColor('testing.iconPassed'));
1433+
return DataUri.copilotSuccessAsImageDataURI(
1434+
getIconForeground(themeData, themeKind),
1435+
getNotebookStatusSuccessIconForeground(themeData, themeKind)
1436+
);
14141437
case CopilotPRStatus.Failed:
1415-
return new ThemeIcon('close', new vscode.ThemeColor('testing.iconFailed'));
1438+
return DataUri.copilotErrorAsImageDataURI(
1439+
getIconForeground(themeData, themeKind),
1440+
getListErrorForeground(themeData, themeKind)
1441+
);
14161442
default:
1417-
return new ThemeIcon('circle-filled', new vscode.ThemeColor('list.warningForeground'));
1443+
return DataUri.copilotInProgressAsImageDataURI(
1444+
getIconForeground(themeData, themeKind),
1445+
getListWarningForeground(themeData, themeKind)
1446+
);
14181447
}
14191448
}
14201449

0 commit comments

Comments
 (0)