Skip to content

NES: announce a meaningful screen reader message for next edit suggestions - #327666

Open
meganrogge with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-empty-screen-reader-announcement
Open

NES: announce a meaningful screen reader message for next edit suggestions#327666
meganrogge with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-empty-screen-reader-announcement

Conversation

Copilot AI commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Description

When a Next Edit Suggestion (NES / inline-edit) appeared, the screen reader announcement was empty. InlineCompletionsController passed '' to _provideScreenReaderUpdate for the inline-edit case, which resulted in:

  • A bare ", Inspect this in the accessible view (Option+F2)" (leading comma, "Inspect this" with no antecedent) when accessibility.verbosity.inlineCompletions was on.
  • A silent alert('') — no announcement at all — when verbosity was off, leaving only the audio signal.

Ghost-text completions were unaffected; only NES lacked a spoken description.

Changes

  • In inlineCompletionsController.ts, replace the empty announcement for the inlineEdit state with a self-describing message that includes the target line number and the relevant action:
    • Cursor not yet at the edit → "Next edit suggestion available on line {N}, press Tab to jump"
    • Cursor already at the edit (state.cursorAtInlineEdit) → "Next edit suggestion available on line {N}, press Tab to accept"
  • Because the content is now meaningful on its own, the announcement is spoken even with verbosity off, and the accessible-view hint is appended to it rather than being the whole message.
} else {
    const lineNumber = state.inlineSuggestion.targetRange.startLineNumber;
    const cursorAtInlineEdit = state.cursorAtInlineEdit.get();
    const content = cursorAtInlineEdit
        ? localize('nextEditSuggestionAccept', "Next edit suggestion available on line {0}, press Tab to accept", lineNumber)
        : localize('nextEditSuggestionJump', "Next edit suggestion available on line {0}, press Tab to jump", lineNumber);
    this._provideScreenReaderUpdate(content);
}

Notes

  • Scope is limited to the previously-empty inline-edit branch; ghost-text behavior is untouched.
  • The issue's "related" concern — that pressing Tab to jump changes cursor context without a re-announcement — is not addressed here, since the suggestion's semanticId is unchanged on jump and re-triggering would require broader changes to the announcement logic.

…readers

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 27, 2026 17:36
Copilot AI changed the title [WIP] Fix empty screen reader announcement for next edit suggestions NES: announce a meaningful screen reader message for next edit suggestions Jul 27, 2026
Copilot AI requested a review from meganrogge July 27, 2026 17:37
@meganrogge
meganrogge marked this pull request as ready for review July 27, 2026 17:39
Copilot AI review requested due to automatic review settings July 27, 2026 17:39
@meganrogge
meganrogge enabled auto-merge (squash) July 27, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds meaningful screen-reader announcements for Next Edit Suggestions.

Changes:

  • Announces the target line and whether Tab jumps to or accepts the suggestion.
  • Preserves accessible-view verbosity hints.
Show a summary per file
File Description
inlineCompletionsController.ts Adds localized NES announcements.

Review details

Comments suppressed due to low confidence (1)

src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.ts:353

  • This creates a second announcement for NES. Immediately above, playSignal(AccessibilitySignal.nextEditSuggestion) emits the signal's announcementMessage through a polite live region, and that announcement defaults to auto for screen-reader users; this call then emits the detailed text through an assertive alert. Users can hear both “Next Edit Suggestion” and this new message. Suppress the signal's announcement modality when the detailed editor announcement is enabled, while retaining its sound.
					this._provideScreenReaderUpdate(content);
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment on lines +349 to +352
const cursorAtInlineEdit = state.cursorAtInlineEdit.get();
const content = cursorAtInlineEdit
? localize('nextEditSuggestionAccept', "Next edit suggestion available on line {0}, press Tab to accept", lineNumber)
: localize('nextEditSuggestionJump', "Next edit suggestion available on line {0}, press Tab to jump", lineNumber);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit. The announcement now checks model.tabShouldAcceptInlineEdit and model.tabShouldJumpToInlineEdit to determine what action is available, and looks up the resolved keybinding via IKeybindingService.lookupKeybinding(...).getAriaLabel() for each respective command (inlineSuggestCommitId / jumpToNextInlineEditId). When neither command is active, or when the keybinding can't be resolved, the key hint is omitted from the announcement.

…s and actionable commands

Co-authored-by: meganrogge <29464607+meganrogge@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NES: screen reader announcement for next edit suggestions is empty (or a bare ", Inspect this in the accessible view")

3 participants