Skip to content

Commit 849868b

Browse files
Copilotalexr00
andauthored
Fix copilot status icons in dev containers by using fallback colors (#7938)
* Initial plan * Initial plan for fixing GHPR status icons in dev containers Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Fix GHPR status icons in dev containers by using fallback colors Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Simplify optional chaining logic in color getter functions Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Revert proposal changes --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 9b23275 commit 849868b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/view/theme.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,18 @@ function getCurrentThemePaths(themeName: string): vscode.Uri | undefined {
7373
}
7474
}
7575

76-
export function getIconForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
77-
return (themeData.colors ? themeData.colors['icon.foreground'] : undefined) ?? (kind === 'dark' ? '#C5C5C5' : '#424242');
76+
export function getIconForeground(themeData: ThemeData | undefined, kind: 'light' | 'dark'): string {
77+
return themeData?.colors?.['icon.foreground'] ?? (kind === 'dark' ? '#C5C5C5' : '#424242');
7878
}
7979

80-
export function getListWarningForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
81-
return (themeData.colors ? themeData.colors['list.warningForeground'] : undefined) ?? (kind === 'dark' ? '#CCA700' : '#855F00');
80+
export function getListWarningForeground(themeData: ThemeData | undefined, kind: 'light' | 'dark'): string {
81+
return themeData?.colors?.['list.warningForeground'] ?? (kind === 'dark' ? '#CCA700' : '#855F00');
8282
}
8383

84-
export function getListErrorForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
85-
return (themeData.colors ? themeData.colors['list.errorForeground'] : undefined) ?? (kind === 'dark' ? '#F88070' : '#B01011');
84+
export function getListErrorForeground(themeData: ThemeData | undefined, kind: 'light' | 'dark'): string {
85+
return themeData?.colors?.['list.errorForeground'] ?? (kind === 'dark' ? '#F88070' : '#B01011');
8686
}
8787

88-
export function getNotebookStatusSuccessIconForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
89-
return (themeData.colors ? themeData.colors['notebookStatusSuccessIcon.foreground'] : undefined) ?? (kind === 'dark' ? '#89D185' : '#388A34');
88+
export function getNotebookStatusSuccessIconForeground(themeData: ThemeData | undefined, kind: 'light' | 'dark'): string {
89+
return themeData?.colors?.['notebookStatusSuccessIcon.foreground'] ?? (kind === 'dark' ? '#89D185' : '#388A34');
9090
}

src/view/treeNodes/pullRequestNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export class PRNode extends TreeNode implements vscode.CommentingRangeProvider2
270270
private async _getIcon(): Promise<vscode.Uri | vscode.ThemeIcon | { light: vscode.Uri; dark: vscode.Uri }> {
271271
const copilotWorkingStatus = await this.pullRequestModel.copilotWorkingStatus(this.pullRequestModel);
272272
const theme = this._folderReposManager.themeWatcher.themeData;
273-
if (!theme || copilotWorkingStatus === CopilotWorkingStatus.NotCopilotIssue) {
273+
if (copilotWorkingStatus === CopilotWorkingStatus.NotCopilotIssue) {
274274
return (await DataUri.avatarCirclesAsImageDataUris(this._folderReposManager.context, [this.pullRequestModel.author], 16, 16))[0]
275275
?? new vscode.ThemeIcon('github');
276276
}

0 commit comments

Comments
 (0)