Skip to content

Commit

Permalink
SCM - 💄 remove icon from SourceControlHistoryItem (#227364)
Browse files Browse the repository at this point in the history
  • Loading branch information
lszomoru authored Sep 2, 2024
1 parent 15405e8 commit 1c97a19
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/vs/workbench/api/browser/mainThreadSCM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ function getIconFromIconDto(iconDto?: UriComponents | { light: UriComponents; da
}

function toISCMHistoryItem(historyItemDto: SCMHistoryItemDto): ISCMHistoryItem {
const icon = getIconFromIconDto(historyItemDto.icon);
const labels = historyItemDto.labels?.map(l => ({ title: l.title, icon: getIconFromIconDto(l.icon) }));

return { ...historyItemDto, icon, labels };
return { ...historyItemDto, labels };
}

class SCMInputBoxContentProvider extends Disposable implements ITextModelContentProvider {
Expand Down
1 change: 0 additions & 1 deletion src/vs/workbench/api/common/extHost.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,6 @@ export interface SCMHistoryItemDto {
readonly message: string;
readonly displayId?: string;
readonly author?: string;
readonly icon?: UriComponents | { light: UriComponents; dark: UriComponents } | ThemeIcon;
readonly timestamp?: number;
readonly statistics?: {
readonly files: number;
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/api/common/extHostSCM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ function getHistoryItemIconDto(icon: vscode.Uri | { light: vscode.Uri; dark: vsc
}

function toSCMHistoryItemDto(historyItem: vscode.SourceControlHistoryItem): SCMHistoryItemDto {
const icon = getHistoryItemIconDto(historyItem.icon);
const labels = historyItem.labels?.map(l => ({ title: l.title, icon: getHistoryItemIconDto(l.icon) }));

return { ...historyItem, icon, labels };
return { ...historyItem, labels };
}

function compareResourceThemableDecorations(a: vscode.SourceControlResourceThemableDecorations, b: vscode.SourceControlResourceThemableDecorations): number {
Expand Down
2 changes: 0 additions & 2 deletions src/vs/workbench/contrib/scm/browser/scmHistoryViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ class HistoryItemActionRunner extends ActionRunner {
message: h.historyItemViewModel.historyItem.message,
displayId: h.historyItemViewModel.historyItem.displayId,
author: h.historyItemViewModel.historyItem.author,
icon: h.historyItemViewModel.historyItem.icon,
timestamp: h.historyItemViewModel.historyItem.timestamp,
statistics: h.historyItemViewModel.historyItem.statistics,
} satisfies ISCMHistoryItem)));
Expand All @@ -452,7 +451,6 @@ class HistoryItemActionRunner extends ActionRunner {
message: context.historyItemViewModel.historyItem.message,
displayId: context.historyItemViewModel.historyItem.displayId,
author: context.historyItemViewModel.historyItem.author,
icon: context.historyItemViewModel.historyItem.icon,
timestamp: context.historyItemViewModel.historyItem.timestamp,
statistics: context.historyItemViewModel.historyItem.statistics,
} satisfies ISCMHistoryItem);
Expand Down
1 change: 0 additions & 1 deletion src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ declare module 'vscode' {
readonly message: string;
readonly displayId?: string;
readonly author?: string;
readonly icon?: Uri | { light: Uri; dark: Uri } | ThemeIcon;
readonly timestamp?: number;
readonly statistics?: SourceControlHistoryItemStatistics;
readonly labels?: SourceControlHistoryItemLabel[];
Expand Down

0 comments on commit 1c97a19

Please sign in to comment.