@@ -42,7 +42,7 @@ import { IAccessibleViewService } from 'vs/workbench/contrib/accessibility/brows
42
42
import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding' ;
43
43
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' ;
44
44
import { IChatResponseViewModel , isResponseVM } from 'vs/workbench/contrib/chat/common/chatViewModel' ;
45
- import { KeyCode } from 'vs/base/ common/keyCodes ' ;
45
+ import { ICommandService } from 'vs/platform/commands/ common/commands ' ;
46
46
47
47
// Register configuration
48
48
const configurationRegistry = Registry . as < IConfigurationRegistry > ( ConfigurationExtensions . Configuration ) ;
@@ -133,8 +133,9 @@ class ChatAccessibileViewContribution extends Disposable {
133
133
const accessibleViewService = accessor . get ( IAccessibleViewService ) ;
134
134
const codeEditorService = accessor . get ( ICodeEditorService ) ;
135
135
const editor = codeEditorService . getActiveCodeEditor ( ) || codeEditorService . getFocusedCodeEditor ( ) ;
136
- const editorUri = editor ?. getModel ( ) ?. uri ;
137
136
const widgetService = accessor . get ( IChatWidgetService ) ;
137
+ const commandService = accessor . get ( ICommandService ) ;
138
+ const editorUri = editor ?. getModel ( ) ?. uri ;
138
139
const widget : IChatWidget | undefined = widgetService . lastFocusedWidget ;
139
140
const focused = widget ?. getFocus ( ) ;
140
141
if ( ! widget || ! focused ) {
@@ -159,12 +160,11 @@ class ChatAccessibileViewContribution extends Disposable {
159
160
id : 'chat' ,
160
161
provideContent,
161
162
onClose ( ) {
162
- widget . reveal ( focused , true ) ;
163
+ widget . reveal ( focused ) ;
164
+ commandService . executeCommand ( 'chat.action.focus' ) ;
163
165
} ,
164
166
onKeyDown ( e : IKeyboardEvent ) {
165
- if ( e . keyCode === KeyCode . Escape ) {
166
- widget . reveal ( focused , true ) ;
167
- }
167
+
168
168
} ,
169
169
options : { ariaLabel : nls . localize ( 'chatAccessibleView' , "Chat Accessible View" ) }
170
170
} ) ;
0 commit comments