diff --git a/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts b/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts index 2ae76f14240..96873795ec8 100644 --- a/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts +++ b/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts @@ -115,6 +115,7 @@ class AICustomizationListDelegate implements IListVirtualDelegate { interface IAICustomizationItemTemplateData { readonly container: HTMLElement; readonly actionsContainer: HTMLElement; + readonly typeIcon: HTMLElement; readonly nameLabel: HighlightedLabel; readonly description: HighlightedLabel; readonly disposables: DisposableStore; @@ -194,6 +195,47 @@ class GroupHeaderRenderer implements IListRenderer c.toUpperCase()); +} + +/** + * Truncates a description string to the first sentence, with a maximum character fallback. + */ +export function truncateToFirstSentence(text: string, maxChars = 120): string { + const match = text.match(/^[^.!?]*[.!?]/); + if (match && match[0].length <= maxChars) { + return match[0]; + } + if (text.length > maxChars) { + return text.substring(0, maxChars).trimEnd() + '\u2026'; + } + return text; +} + /** * Renderer for AI customization list items. */ @@ -212,6 +254,7 @@ class AICustomizationItemRenderer implements IListRenderer { const uriLabel = this.labelService.getUriLabel(element.uri, { relative: false }); @@ -245,11 +293,12 @@ class AICustomizationItemRenderer implements IListRenderer { interface IMcpServerItemTemplateData { readonly container: HTMLElement; + readonly typeIcon: HTMLElement; readonly name: HTMLElement; readonly description: HTMLElement; readonly status: HTMLElement; @@ -113,13 +115,16 @@ class McpServerItemRenderer implements IListRenderer { interface IPluginInstalledItemTemplateData { readonly container: HTMLElement; + readonly typeIcon: HTMLElement; readonly name: HTMLElement; readonly description: HTMLElement; readonly status: HTMLElement; @@ -112,21 +114,24 @@ class PluginInstalledItemRenderer implements IListRenderer