mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-08 07:44:33 +01:00
clean up
This commit is contained in:
@@ -622,7 +622,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
const container = $('.chat-used-context', undefined, buttonElement);
|
||||
collapseButton.label = referencesLabel;
|
||||
collapseButton.element.append(iconElement);
|
||||
collapseButton.element.ariaLabel = element.usedReferencesExpanded ? localize('usedReferencesExpanded', "{0}, expanded", referencesLabel) : localize('usedReferencesCollapsed', "{0}, collapsed", referencesLabel);
|
||||
this.updateAriaLabel(collapseButton.element, referencesLabel, element.usedReferencesExpanded);
|
||||
container.classList.toggle('chat-used-context-collapsed', !element.usedReferencesExpanded);
|
||||
listDisposables.add(collapseButton.onDidClick(() => {
|
||||
iconElement.classList.remove(...ThemeIcon.asClassNameArray(icon(element)));
|
||||
@@ -630,7 +630,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
iconElement.classList.add(...ThemeIcon.asClassNameArray(icon(element)));
|
||||
container.classList.toggle('chat-used-context-collapsed', !element.usedReferencesExpanded);
|
||||
this._onDidChangeItemHeight.fire({ element, height: templateData.rowContainer.offsetHeight });
|
||||
collapseButton.element.ariaLabel = element.usedReferencesExpanded ? localize('usedReferencesExpandedLabel', "{0}, expanded", referencesLabel) : localize('usedReferencesCollapsedLabel', "{0}, collapsed", referencesLabel);
|
||||
this.updateAriaLabel(collapseButton.element, referencesLabel, element.usedReferencesExpanded);
|
||||
}));
|
||||
|
||||
const ref = listDisposables.add(this._contentReferencesListPool.get());
|
||||
@@ -666,6 +666,10 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
|
||||
};
|
||||
}
|
||||
|
||||
private updateAriaLabel(element: HTMLElement, label: string, expanded?: boolean): void {
|
||||
element.ariaLabel = expanded ? localize('usedReferencesExpanded', "{0}, expanded", label) : localize('usedReferencesCollapsed', "{0}, collapsed", label);
|
||||
}
|
||||
|
||||
private renderPlaceholder(markdown: IMarkdownString, templateData: IChatListItemTemplate): IMarkdownRenderResult {
|
||||
const codicon = $('.interactive-response-codicon-details', undefined, renderIcon({ id: 'sync~spin' }));
|
||||
codicon.classList.add('interactive-response-placeholder-codicon');
|
||||
|
||||
Reference in New Issue
Block a user