Announce new lines inserted with Enter - #3427
Open
Bryan Valverde U (BryanValverdeU) wants to merge 3 commits into
Open
Announce new lines inserted with Enter#3427Bryan Valverde U (BryanValverdeU) wants to merge 3 commits into
Bryan Valverde U (BryanValverdeU) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0b3e8c6f-5223-4b6e-b959-5f8b209e5b10
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0b3e8c6f-5223-4b6e-b959-5f8b209e5b10
…u/bvalverde/announce-new-line-inserted
Bryan Valverde U (BryanValverdeU)
requested review from
Jiuqing Song (JiuqingSong),
flyingbee2012,
Ian Elizondo (ianeli1),
Julia Roldi (juliaroldi) and
Vi Nguyen (vinguyen12)
and
a lite review from Copilot
August 4, 2026 17:58
Bryan Valverde U (BryanValverdeU)
marked this pull request as ready for review
August 4, 2026 17:58
Copilot started reviewing on behalf of
Bryan Valverde U (BryanValverdeU)
August 4, 2026 17:59
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an accessibility gap in the Content Model editing flow by providing an explicit screen-reader announcement when Enter splits a paragraph (inserting a new line/paragraph). It does so by introducing a new KnownAnnounceStrings key and wiring it into the paragraph-splitting edit step, while keeping the legacy editor adapter behavior unchanged by treating the new string as unsupported during event conversion.
Changes:
- Add
newLineInsertedtoKnownAnnounceStringsand demo announcement string mapping. - Set
formatContext.announceDatato announcenewLineInsertedwhenhandleEnterOnParagraphsuccessfully splits a paragraph. - Update legacy adapter event conversion to treat
newLineInsertedas unsupported, with unit tests covering this behavior and the paragraph announcement.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/roosterjs-editor-adapter/test/editor/utils/eventConverterTest.ts | Adds a unit test ensuring unsupported announce strings (including newLineInserted) don’t surface in legacy getAnnounceData(). |
| packages/roosterjs-editor-adapter/lib/editor/utils/eventConverter.ts | Adds newLineInserted to the new→old known-announce-string map as unsupported (undefined). |
| packages/roosterjs-content-model-types/lib/parameter/AnnounceData.ts | Extends KnownAnnounceStrings with the new newLineInserted key and documentation. |
| packages/roosterjs-content-model-plugins/test/edit/inputSteps/handleEnterOnParagraphTest.ts | Adds test coverage verifying handleEnterOnParagraph sets formatContext.announceData to newLineInserted. |
| packages/roosterjs-content-model-plugins/lib/edit/inputSteps/handleEnterOnParagraph.ts | Implements the announcement by setting formatContext.announceData after a successful paragraph split. |
| demo/scripts/controlsV2/mainPane/MainPane.tsx | Adds demo string mapping so newLineInserted resolves to “New line”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Julia Roldi (juliaroldi)
approved these changes
Aug 4, 2026
Jiuqing Song (JiuqingSong)
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a screen reader accessibility issue where pressing Enter in the message body silently inserts a new line.
This change:
newLineInsertedannouncement string.Issue
When composing a new message in Outlook, Narrator, NVDA, and JAWS remain silent after the user presses Enter in the message body. Users who rely on a screen reader do not receive confirmation that the insertion point moved to a new line.
Reproduction steps
Before this fix
The editor inserts a new line, but the screen reader remains silent.
After this fix
The editor announces "New line" after Enter successfully inserts a new paragraph.
User impact
This improves editing feedback for users with low vision or blindness who rely on Narrator, NVDA, or JAWS. It confirms that pressing Enter moved the insertion point to a new line rather than leaving the editor in an unknown state.
Accessibility
How to test
yarn test:fast --testPathPattern="handleEnterOnParagraph|eventConverter".yarn test:fast.