Skip to content

Commit 76745ed

Browse files
authored
Adding workbench hover to the View All File Changes button and making it focusable (microsoft#259178)
adding workbench hover to the `View All File Changes` button and making it focusable
1 parent 62bab67 commit 76745ed

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import { MultiDiffEditorInput } from '../../../multiDiffEditor/browser/multiDiff
2929
import { MultiDiffEditorItem } from '../../../multiDiffEditor/browser/multiDiffSourceResolverService.js';
3030
import { IEditorGroupsService } from '../../../../services/editor/common/editorGroupsService.js';
3131
import { Emitter } from '../../../../../base/common/event.js';
32+
import { IHoverService } from '../../../../../platform/hover/browser/hover.js';
33+
import { localize2 } from '../../../../../nls.js';
3234

3335
export class ChatCheckpointFileChangesSummaryContentPart extends Disposable implements IChatContentPart {
3436

@@ -51,6 +53,7 @@ export class ChatCheckpointFileChangesSummaryContentPart extends Disposable impl
5153
constructor(
5254
content: IChatFileChangesSummaryPart,
5355
context: IChatContentPartRenderContext,
56+
@IHoverService private readonly hoverService: IHoverService,
5457
@IChatService private readonly chatService: IChatService,
5558
@IEditorService private readonly editorService: IEditorService,
5659
@IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService,
@@ -132,7 +135,12 @@ export class ChatCheckpointFileChangesSummaryContentPart extends Disposable impl
132135

133136
private renderViewAllFileChangesButton(container: HTMLElement): IDisposable {
134137
const button = container.appendChild($('.chat-view-changes-icon'));
138+
this.hoverService.setupDelayedHover(button, () => ({
139+
content: localize2('chat.viewFileChangesSummary', 'View All File Changes')
140+
}));
135141
button.classList.add(...ThemeIcon.asClassNameArray(Codicon.diffMultiple));
142+
button.setAttribute('role', 'button');
143+
button.tabIndex = 0;
136144

137145
return dom.addDisposableListener(button, 'click', (e) => {
138146
const resources: { originalUri: URI; modifiedUri?: URI }[] = [];

0 commit comments

Comments
 (0)