Skip to content

Commit 758a87c

Browse files
committed
rm focus from reveal
1 parent 4dac9b5 commit 758a87c

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class ChatAccessibleViewContribution extends Disposable {
150150
id: 'panelChat',
151151
provideContent(): string { return responseContent; },
152152
onClose() {
153-
widget.reveal(focusedItem, true);
153+
widget.focus(focusedItem);
154154
provider.dispose();
155155
},
156156
options: { ariaLabel: nls.localize('chatAccessibleView', "Chat Accessible View"), language: 'typescript', type: AccessibleViewType.View }

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ export interface IChatWidget {
5454
readonly inputEditor: ICodeEditor;
5555
readonly providerId: string;
5656

57-
reveal(item: ChatTreeItem, focus?: boolean): void;
57+
reveal(item: ChatTreeItem): void;
58+
focus(item: ChatTreeItem): void;
5859
getFocus(): ChatTreeItem | undefined;
5960
acceptInput(query?: string): void;
6061
focusLastMessage(): void;

src/vs/workbench/contrib/chat/browser/chatWidget.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,19 @@ export class ChatWidget extends Disposable implements IChatWidget {
376376
return withNullAsUndefined(this.tree.getFocus()[0]);
377377
}
378378

379-
reveal(item: ChatTreeItem, focus?: boolean): void {
379+
reveal(item: ChatTreeItem): void {
380380
this.tree.reveal(item);
381-
if (focus) {
382-
const items = this.tree.getNode(null).children;
383-
const node = items.find(i => i.element?.id === item.id);
384-
if (!node) {
385-
return;
386-
}
381+
}
387382

388-
this.tree.setFocus([node.element]);
389-
this.tree.domFocus();
383+
focus(item: ChatTreeItem): void {
384+
const items = this.tree.getNode(null).children;
385+
const node = items.find(i => i.element?.id === item.id);
386+
if (!node) {
387+
return;
390388
}
389+
390+
this.tree.setFocus([node.element]);
391+
this.tree.domFocus();
391392
}
392393

393394
async acceptInput(query?: string | IChatReplyFollowup): Promise<void> {

0 commit comments

Comments
 (0)