Repository navigation
CI only: full matrix run for the heading announcer plain-text fix - #7
Open
Electro-Jam wants to merge 482 commits into
Open
Electro-Jam wants to merge 482 commits into
Electro-Jam wants to merge 482 commits into
Conversation
…coratorNode NodeSelection (meta#8526)
…cal-plain-text] Feature: Move triple click selection handling to NormalizeTripleClickSelectionExtension (meta#8520) Co-authored-by: Claude <noreply@anthropic.com>
…pe` (meta#8517) Co-authored-by: Bob Ippolito <bob@redivi.com> Co-authored-by: Claude <noreply@anthropic.com>
…links (meta#8531) Co-authored-by: Claude <noreply@anthropic.com>
…-indent (meta#8536) Co-authored-by: Claude <noreply@anthropic.com>
…eta#8537) Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…pty-input Backspace removes (meta#8534)
…ate away from legacy flow syntax (meta#8547)
…eta#8548) Co-authored-by: Bob Ippolito <bob@redivi.com>
…click after the last block (meta#8549)
… Allow null Tokenizer.defaultLanguage to preserve markdown ``` round-trip (meta#8553)
… before leading inline DecoratorNode (meta#8558)
…ncile (meta#8564) Co-authored-by: Claude <noreply@anthropic.com>
meta#8565) Co-authored-by: Claude <noreply@anthropic.com>
…tils][lexical-playground] Feature: Generalize DOMSlot and add DOMRenderExtension override surface (meta#8519) Co-authored-by: Bob Ippolito <bob@redivi.com> Co-authored-by: Claude <noreply@anthropic.com>
…ent-moved elements (meta#8569) Co-authored-by: Claude <noreply@anthropic.com>
…ed process (meta#8557) Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
meta#8570) Co-authored-by: Claude <noreply@anthropic.com>
meta#8528) Co-authored-by: Claude <noreply@anthropic.com>
…sions (meta#8546) Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
…errides (disabledForEditor/disabledForSession) (meta#8575) Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
…text in a fresh writable update (meta#8863)
… build (meta#8861) Co-authored-by: Claude <noreply@anthropic.com>
…ators on Firefox (meta#8862) Co-authored-by: Bob Ippolito <bob@redivi.com>
…fined col widths (meta#8850) Co-authored-by: Bob Ippolito <bob@redivi.com> Co-authored-by: Claude <noreply@anthropic.com>
…eTextFromCaretRange (meta#8872)
…aky webkit undo tests (meta#8874) Co-authored-by: Claude <noreply@anthropic.com>
…gisterNodeTransform generics (meta#8877) Co-authored-by: Bob Ippolito <bob@redivi.com>
…TL->BR direction (meta#8883)
…DOM (meta#8882) Co-authored-by: Shaï Halimi <shai.halimi@infomaniak.com>
…uts (meta#8879) Co-authored-by: Bob Ippolito <bob@redivi.com>
…shadow DOM safety (meta#8878)
…decorators regardless of preceding sibling (meta#8888)
…appen
Adds HeadingAnnounceExtension, announcing through the existing
AriaLiveRegionExtension sink:
block becomes a heading -> 'Heading level 2'
heading stops being one -> 'Heading level 2 removed'
The markdown heading shortcut is a number-sign character followed by the space
bar. Pressing space triggers the transformation: both keystrokes are consumed
and the block type changes. For a sighted user that is obvious - the characters
disappear and the text jumps to heading size. For a screen-reader user there is
no signal at all, so the reasonable conclusion is that the document now contains
a number sign, a space, and whatever is typed next. It does not.
And when the shortcut IS intended, the only way to confirm the level today is to
move the caret out of the block and arrow back in, mid-sentence, every time.
Follows HistoryAnnounceExtension: defineExtension + namedSignals + safeCast,
depends on AriaLiveRegionExtension, config {created, destroyed, disabled} with
%s substituted for the level so the strings stay translatable, and a disabled
signal gated from an effect so a disabled announcer registers no listener.
RichTextExtension is declared as a dependency because it registers HeadingNode:
attaching a mutation listener for a node the editor has not registered throws.
This matches how AutoLinkExtension depends on LinkExtension, and
CheckListExtension on ListExtension.
Note: a level change - typing "## " straight after "# ", with no text entered -
fires both a removal and a creation. In the first block of the document the
removal is what reached the live region, so it announced "Heading level 1
removed" instead of the new level. Announce the creation; only say "removed"
when nothing replaced it.
A destroyed node is gone from the current editor state, so its level is read
from the prevEditorState that registerMutationListener provides.
Silent otherwise. Typing inside a heading, moving the caret through it, and
deleting text while the heading survives do not announce - announcing on every
keystroke would make a heading impossible to type into.
Enabled in the playground alongside HistoryAnnounceExtension and
EditorModeAnnounceExtension.
Note: HeadingNode lives in @lexical/rich-text, so this adds that as a dependency
of @lexical/a11y - the first dependency beyond @lexical/extension,
@lexical/utils and lexical. See the PR description for the placement question.
Tests: seven cases in
packages/lexical-a11y/src/__tests__/unit/HeadingAnnounceExtension.test.ts,
following the structure of the existing HistoryAnnounceExtension tests. One
asserts silence while editing inside a heading; one covers a level change.
…is announced Announcing a heading split the surrounding edit into two undo steps, so a single undo took back only half of it. After a Markdown import the document stayed as rich text instead of returning to the Markdown code block, and Markdown.spec.mjs "can convert markdown text into rich text" failed on its undo assertion. The announcer read the new heading level with editor.read(). That call flushes any pending update before it reads, and a mutation listener runs while an update is being committed - so reading from inside one ended the update early and began a second. Reading the committed editor state directly avoids the flush. The removal branch alongside it already did this, through prevEditorState.read(). Markdown.spec.mjs passes in full, as do the @lexical/a11y unit tests.
…nto the editor Adding the heading announcer to a plain text editor stopped it building at all - "extension @lexical/plain-text conflicts with @lexical/rich-text" - because the announcer declared rich text as a dependency. Rich text is now a peer, so it is set up first when present and nothing is forced in when it is not, and the announcer registers nothing when the editor has no headings to watch.
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.
Not for merge. Opened purely to trigger the test matrix on our own runners, so the full plain-text / webkit / macOS / production-build jobs run before the fix goes to meta#8908.