diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts b/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts index a9791e5bfa1..d7f3e421f30 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts @@ -15,7 +15,7 @@ import { EditMode } from 'vs/workbench/contrib/inlineChat/common/inlineChat'; import { IAccessibleViewService } from 'vs/workbench/contrib/accessibility/browser/accessibleView'; import { InlineChatController } from 'vs/workbench/contrib/inlineChat/browser/inlineChatController'; -export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat' | 'editor', currentInput?: string): string { +export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat' | 'inline', currentInput?: string): string { const keybindingService = accessor.get(IKeybindingService); const configurationService = accessor.get(IConfigurationService); const content = []; @@ -27,7 +27,7 @@ export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat content.push(descriptionForCommand('workbench.action.chat.nextCodeBlock', localize('workbench.action.chat.nextCodeBlock', 'The Chat: Next Code Block command ({0}) focuses the next code block within a response.'), localize('workbench.action.chat.nextCodeBlockNoKb', 'The Chat: Next Code Block command focuses the next code block within a response and is currently not triggerable by a keybinding.'), keybindingService)); content.push(descriptionForCommand('workbench.action.chat.clear', localize('workbench.action.chat.clear', 'The Chat Clear command ({0}) clears the request/response list.'), localize('workbench.action.chat.clearNoKb', 'The Chat Clear command clears the request/response list and is currently not triggerable by a keybinding.'), keybindingService)); } else { - content.push(localize('interactiveSession.makeRequest', "Tab once to reach the make request button, which will re-run the request.")); + content.push(localize('inlineChat.makeRequest', "Tab once to reach the make request button, which will re-run the request.")); const regex = /^(\/fix|\/explain)/; const match = currentInput?.match(regex); const command = match && match.length ? match[0].substring(1) : undefined; @@ -35,14 +35,14 @@ export function getAccessibilityHelpText(accessor: ServicesAccessor, type: 'chat const editMode = configurationService.getValue('interactiveEditor.editMode'); if (editMode === EditMode.Preview) { const keybinding = keybindingService.lookupKeybinding('editor.action.diffReview.next')?.getAriaLabel(); - content.push(keybinding ? localize('interactiveSession.diff', "Tab again to enter the Diff editor with the changes and enter review mode with ({0}). Use Up/DownArrow to navigate lines with the proposed changes.", keybinding) : localize('interactiveSession.diffNoKb', "Tab again to enter the Diff editor with the changes and enter review mode with the Go to Next Difference Command. Use Up/DownArrow to navigate lines with the proposed changes.")); - content.push(localize('interactiveSession.acceptReject', "Tab again to reach the action bar, which can be navigated with Left/RightArrow.")); + content.push(keybinding ? localize('inlineChat.diff', "Tab again to enter the Diff editor with the changes and enter review mode with ({0}). Use Up/DownArrow to navigate lines with the proposed changes.", keybinding) : localize('inlineChat.diffNoKb', "Tab again to enter the Diff editor with the changes and enter review mode with the Go to Next Difference Command. Use Up/DownArrow to navigate lines with the proposed changes.")); + content.push(localize('inlineChat.acceptReject', "Tab again to reach the action bar, which can be navigated with Left/RightArrow.")); } } else if (command === 'explain') { - content.push(localize('interactiveSession.explain', "/explain commands will be run in the chat view.")); - content.push(localize('interactiveSession.chatViewFocus', "To focus the chat view, run the GitHub Copilot: Focus on GitHub Copilot View command, which will focus the input box.")); + content.push(localize('inlineChat.explain', "/explain commands will be run in the chat view.")); + content.push(localize('inlineChat.chatViewFocus', "To focus the chat view, run the GitHub Copilot: Focus on GitHub Copilot View command, which will focus the input box.")); } else { - content.push(localize('interactiveSession.toolbar', "Use tab to reach conditional parts like commands, status message, message responses and more.")); + content.push(localize('inlineChat.toolbar', "Use tab to reach conditional parts like commands, status message, message responses and more.")); } } return content.join('\n'); @@ -56,7 +56,7 @@ function descriptionForCommand(commandId: string, msg: string, noKbMsg: string, return format(noKbMsg, commandId); } -export async function runAccessibilityHelpAction(accessor: ServicesAccessor, editor: ICodeEditor, type: 'chat' | 'editor'): Promise { +export async function runAccessibilityHelpAction(accessor: ServicesAccessor, editor: ICodeEditor, type: 'chat' | 'inline'): Promise { const widgetService = accessor.get(IChatWidgetService); const accessibleViewService = accessor.get(IAccessibleViewService); const inputEditor: ICodeEditor | undefined = type === 'chat' ? widgetService.lastFocusedWidget?.inputEditor : editor; @@ -73,7 +73,7 @@ export async function runAccessibilityHelpAction(accessor: ServicesAccessor, edi const cachedInput = inputEditor.getValue(); const cachedPosition = inputEditor.getPosition(); inputEditor.getSupportedActions(); - const helpText = getAccessibilityHelpText(accessor, type, type === 'editor' ? cachedInput : undefined); + const helpText = getAccessibilityHelpText(accessor, type, type === 'inline' ? cachedInput : undefined); const provider = accessibleViewService.registerProvider({ id: type, provideContent: () => helpText, @@ -81,12 +81,12 @@ export async function runAccessibilityHelpAction(accessor: ServicesAccessor, edi if (type === 'chat' && cachedPosition) { inputEditor.setPosition(cachedPosition); inputEditor.focus(); - } else if (type === 'editor') { + } else if (type === 'inline') { InlineChatController.get(editor)?.focus(); } provider.dispose(); }, - options: { ariaLabel: type === 'chat' ? localize('chat-help-label', "Chat accessibility help") : localize('interactive-editor-label', "Editor chat accessibility help") } + options: { ariaLabel: type === 'chat' ? localize('chat-help-label', "Chat accessibility help") : localize('inline-chat-label', "Inline chat accessibility help") } }); accessibleViewService.show(type); } diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts index 26e174beaec..39c54276dd3 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts @@ -594,12 +594,12 @@ export class ContractMessageAction extends AbstractInlineChatAction { export class InlineAccessibilityHelpContribution extends Disposable { constructor() { super(); - this._register(AccessibilityHelpAction.addImplementation(106, 'editor', async accessor => { + this._register(AccessibilityHelpAction.addImplementation(106, 'inline-chat', async accessor => { const codeEditor = accessor.get(ICodeEditorService).getActiveCodeEditor() || accessor.get(ICodeEditorService).getFocusedCodeEditor(); if (!codeEditor) { return; } - runAccessibilityHelpAction(accessor, codeEditor, 'editor'); + runAccessibilityHelpAction(accessor, codeEditor, 'inline'); }, CTX_INLINE_CHAT_FOCUSED)); } }