Repository navigation
fix(richtext): text reads the way it is written, in either document direction - #7723
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| richtext/RichTextView | 285.2 kB (+1.4 kB) · 2.4 kB CSS (+95 B) | 184 (+3) | — · ✓ · — |
| richtext/RichTextEditor · Storybook | 308.0 kB (+944 B) · 2.7 kB CSS (+87 B) | 696 (+3) | — · ✓ · ✓ |
| lab/CommentThread | 370.3 kB (+130 B) · 2.4 kB CSS (0) | — | — · — · — |
20 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/Comments | 377.0 kB (+116 B) · 2.5 kB CSS (0) | — | — · — · — |
| Markdown | 205.5 kB (+109 B) · 22.1 kB CSS (0) | — | — · — · — |
| ChatToolCalls | 33.8 kB (+15 B) · 8.5 kB CSS (0) | — | — · — · — |
| Typeahead | 89.2 kB (+15 B) · 13.5 kB CSS (0) | — | — · — · — |
| lab/DiffViewer | 94.4 kB (+15 B) · 2.1 kB CSS (0) | — | — · — · — |
| ChatComposer | 85.8 kB (+14 B) · 12.9 kB CSS (0) | — | — · — · — |
| ChatTokenizedText | 7.6 kB (+14 B) · 4.0 kB CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 102.4 kB (+14 B) · 1.8 kB CSS (0) | — | — · — · — |
| Badge | 4.4 kB (+13 B) · 4.0 kB CSS (0) | — | — · — · — |
| ChatComposerDrawer | 18.2 kB (+13 B) · 4.7 kB CSS (0) | — | — · — · — |
| InputGroupText | 6.9 kB (+13 B) · 3.9 kB CSS (0) | — | — · — · — |
| MultiSelector | 103.2 kB (+13 B) · 17.8 kB CSS (0) | — | — · — · — |
| lab/CommentComposer | 180.5 kB (+13 B) · 1.9 kB CSS (0) | — | — · — · — |
| ChatComposerInput | 83.5 kB (+12 B) · 12.1 kB CSS (0) | — | — · — · — |
| ChatComposerTokenElement | 83.5 kB (+12 B) · 12.1 kB CSS (0) | — | — · — · — |
| PowerSearch | 310.3 kB (+11 B) · 25.6 kB CSS (0) | — | — · — · — |
| Token | 29.7 kB (+10 B) · 4.9 kB CSS (0) | — | — · — · — |
| Tokenizer | 105.9 kB (+9 B) · 20.4 kB CSS (0) | — | — · — · — |
| List | 19.0 kB (0) · 790 B CSS (0) | — | ✓ · ✓ · — |
| ListItem | 79.5 kB (0) · 12.1 kB CSS (0) | — | ✓ · ✓ · ✓ |
Package size:
- @astryxdesign/core 7.66 MB packed (+1.9 kB); no new dependencies
- @astryxdesign/richtext 261.4 kB packed (+13.2 kB) 🔴; no new dependencies
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Thanks for chasing down the inverted caret: it is real, and this change fixes it for top-level Hebrew paragraphs. Approval waits on a maintainer decision. spec:AST-061 FR6 currently says a surface does not choose a block's direction from its text, so a maintainer needs to either update FR6 to allow this exception (and say whether core Markdown follows it) or keep FR6 as written. Separately, these need fixing whichever way that goes:
- A list whose first item is Hebrew now turns every item right-to-left in an English document, so
Buy milk.renders as.Buy milk; keepingul/olon the surface direction avoids it. - A fenced code block whose first line is a Hebrew comment turns right-to-left, so
const x = 1;renders as;const x = 1and the copy button covers the first line; keepingcodeon the surface direction avoids it. - The changeset says such a block reads right-to-left "wherever it sits", but a Hebrew item in a list that starts in English is unchanged, and the parity test should keep its nested-direction check for core
Markdown.
[Automated review]
There was a problem hiding this comment.
Thanks for the careful write-up: the inverted caret is real on the base, and this head fixes it for top-level Hebrew paragraphs. Approval waits on a maintainer decision, because spec:AST-061 FR6 currently says a surface does not choose a block's direction from its text, so a maintainer needs to amend FR6 and its verification row (and say whether core Markdown follows) or keep it as written. Independently of that decision, these need fixing:
- Undo gets stuck once a keystroke changes a block's own direction: typing
- Helloand pressing Ctrl+Z stops atHinstead of removing the list, because the direction sweep inBlockDirectionPluginruns as its own history step. - A list whose first item is Hebrew, or a code block whose first line is a Hebrew comment, still turns right-to-left as a whole, so
Buy milk.renders as.Buy milkandconst x = 1;as;const x = 1. - The Markdown half of the FR6 parity test should keep its nested
tr, th, td, li, pcheck, since this change does not touch Markdown.
[Automated review]
… direction write out of history Review feedback from astracat-bot on meta#7723. A list and a fenced code block hold several lines under one element, so one `dir` on the element imposes the first line's direction on all of them: under a Hebrew first item `Buy milk.` rendered `.Buy milk`, and under a Hebrew first comment `const x = 1;` rendered `;const x = 1`. They leave `dir="auto"` now, which the theme styles as the document's direction and under which the browser reads each line on its own. ParagraphNode, HeadingNode and QuoteNode are read as one piece of prose and keep their own direction. The direction write also cost an undo step. Typing inside an existing text node dirties the text node, not the block, so no element transform ran and the update listener was doing the work -- in an `editor.update` of its own, which became its own history entry. Undo restored the stale direction, the listener swept again, and undo never got past it: `- ` + `Hello` then Ctrl+Z left `H`. A TextNode transform now writes the direction inside the update that changed the text, and the whole-state sweep that RichTextView needs is tagged `history-merge`. The Markdown half of the FR6 parity test keeps its nested `tr, th, td, li, p` check: this change does not touch core Markdown.
|
Thanks — all three are real, and all three are fixed in Lists and fenced code blocks. You are right, and the fix is the one you suggested. Worth noting what the browser then does, because it is better than "no direction handling": under Per-item direction inside a list is a real improvement and is reachable — the reconciler emits Undo. Good catch, and your diagnosis was exactly right, including why: typing inside an existing text node dirties the text node and not the block, so no element transform ran for that keystroke and the update listener was doing the work — in an Fixed the way you suggested: a Both of your repros are now regression tests in a new The parity test's nested check. Restored. The Markdown half keeps the base's Changeset. Narrowed. "Wherever it sits" now says paragraph, heading or quote, and names what keeps the document's direction. On the FR6 decision, which is yours and not mine: the PR body sets out why I think the editor should be narrower than FR6 reads today, and I have no attachment to winning it. If FR6 is meant to bind Suite after the changes: 94 chromium, 600 unit, no new typecheck errors, lint and repo checks clean. |
There was a problem hiding this comment.
Thanks for the careful fixes: the undo regression and the Hebrew-first list and code block cases from the last round are resolved, and the caret now follows the arrow keys in a right-to-left paragraph. Approval waits on a maintainer, because spec:AST-061 FR6 currently says content blocks take the provider's direction and that a surface does not choose a block's direction from its text, so a maintainer needs to update FR6 and its verification row to allow own-text direction for paragraphs, headings and quotes (and say whether that covers RichTextEditor only, RichTextView too, or core Markdown as well) or keep FR6 as written. Independently of that decision, one fix is needed:
- A list, code block or table-cell paragraph that arrives with an explicit
dir(pasted HTML or a stored value) now keeps it, becauseblock()still buildsul,olandcodeon the new rule: a pasted<ul dir="rtl">rendersBuy milk.as.Buy milkin an English document, so keeping those classes on the unconditional document direction, astablePartdoes, and clearingdiron nested paragraphs would fix it.
[Automated review]
Review feedback from astracat-bot on meta#7723. `ul`, `ol` and the table parts were built on the conditional rule, which leaves an explicit `dir` alone. Nothing in the editor writes one onto a container, but $setDirectionFromDOM does when HTML is pasted, and an older stored document can carry one -- so a list pasted as `<ul dir="rtl">` kept its markers and indent on the right in an English document. Measured before this change: `ul=rtl li=ltr`. Containers are built on the unconditional document direction now, as the tables already were, and BlockDirectionPlugin clears a direction that arrives on a list, a code block or a table part, so the stored state says what the document shows. The item inside still carries its own, which is what keeps `Buy milk.` reading `Buy milk.`. A cell paragraph that arrives with an explicit `dir` keeps it, which the review also raised: since the previous commit a cell's prose carries its own direction by design, so an English paragraph in a right-to-left table reading left-to-right is the intended behaviour, not a leftover.
|
Thanks — the pasted-container case is real and is fixed in The list. Confirmed and fixed as you suggested. The symptom had already narrowed by the time I measured it: since The cell paragraph. This one I have deliberately left, because it is now the intended behaviour rather than a leftover. Since Also fixed since your review, both reported against the published build:
Suite: 96 chromium, 601 unit, no new typecheck errors, lint and repo checks clean. The FR6 scope question is still yours. |
e0fcff5 to
0047093
Compare
|
Rebased onto current
One conflict, in Re-run after the rebase: 603 unit tests pass, I force-pushed with |
… direction write out of history Review feedback from astracat-bot on meta#7723. A list and a fenced code block hold several lines under one element, so one `dir` on the element imposes the first line's direction on all of them: under a Hebrew first item `Buy milk.` rendered `.Buy milk`, and under a Hebrew first comment `const x = 1;` rendered `;const x = 1`. They leave `dir="auto"` now, which the theme styles as the document's direction and under which the browser reads each line on its own. ParagraphNode, HeadingNode and QuoteNode are read as one piece of prose and keep their own direction. The direction write also cost an undo step. Typing inside an existing text node dirties the text node, not the block, so no element transform ran and the update listener was doing the work -- in an `editor.update` of its own, which became its own history entry. Undo restored the stale direction, the listener swept again, and undo never got past it: `- ` + `Hello` then Ctrl+Z left `H`. A TextNode transform now writes the direction inside the update that changed the text, and the whole-state sweep that RichTextView needs is tagged `history-merge`. The Markdown half of the FR6 parity test keeps its nested `tr, th, td, li, p` check: this change does not touch core Markdown.
spec:AST-061 FR6 gives a prose block the direction of its own text on every surface. Core Markdown already follows it. RichText still took the provider's direction for every block, so a Hebrew paragraph in an English document flushed left and its caret moved opposite to the arrow key, and an English list item in a Hebrew document did the mirror. BlockDirectionPlugin writes each prose container's own direction onto it, at any depth, from the shared first-strong classifier. A container -- a list, a table and its parts, a fenced code block -- takes its parent's direction instead, and gives up a dir that arrives with pasted HTML or an older stored document. A fenced code block adds unicode-bidi: plaintext, so each line reads its own way: a Hebrew comment reads right-to-left while const x = 1; keeps its semicolon at the end. That is the one place the surfaces differ, and core Markdown wants the same treatment. Only text a reader reads decides a direction. A decorator shows no prose of its own and getTextContent gives its alternative text, so an English caption would have turned a Hebrew item left-to-right; core Markdown skips the same nodes. Writing the direction, not deriving it in CSS, is what separates a block with no direction of its own from one that is strongly left-to-right: under dir=auto, digits, an image and an empty block all resolve left-to-right exactly like English, and a CSS rule cannot tell them apart. An empty paragraph keeps its caret on a right-to-left document's start edge because the plugin writes nothing onto it. A list reserves marker room on both inline sides. An outside marker is drawn beyond its item's own start edge, so room on one side left the marker of an item that reads against its list outside the field, and flattened a nesting step to nothing where a wrapper read against the items inside it. The direction write rides in the keystroke's own update, through a TextNode transform that walks every prose ancestor. An update listener sweeps a whole-state replacement, which runs no transforms, and is tagged history-merge so undo does not bounce off it. The shared classifier gains the four Arabic marks whose script is Common -- the semicolon, the letter mark, the question mark and tatweel, all Bidi_Class AL -- and loses the Rumi, Indic Siyaq and Ottoman Siyaq numerals, which are AN inside ranges the strong set covers. JavaScript exposes no Bidi_Class escape, so the sets approximate it from script and category and name the characters where the two disagree. The parity spec now states one rule for both surfaces, and reads only document blocks: a toolbar dialog's heading is chrome and follows the provider. The right-to-left resize test puts its image in a right-to-left block, since the document's own last block is English and reads that way. 1895 unit tests pass, eslint reports no errors, tsc is clean on both packages, and the richtext Chromium suite is 108 passed. The one failure, a selected image resizes by its handle, fails the same way on main.
CI caught a parity regression from the previous revision. Reserving marker room on both inline sides of every list cost one inset of measure on the end side at every level, so a long RichTextView item wrapped onto a second line where core Markdown kept it on one, and ListMarkers.a11y failed on line counts at 1440px and 390px. The inset goes back on the item, where an earlier revision had it. An outside marker is drawn beyond its item's own start edge, so an inset held by the item is always on the side the marker uses, whichever way that item reads, and it costs the same measure either way: a list whose items agree with it wraps exactly where core Markdown wraps. Measured in a built Storybook, this keeps what the both-sides inset was for. A nested list whose wrapper agrees with the items inside it still steps 24 / 48 / 72, because a wrapper takes its direction from the first text under it and so normally agrees with its own first item. No marker escapes the field at 390px in either direction. One narrower case stays open: a sibling that disagrees with the nested list holding it starts one inset short, because the wrapper spent its inset on the other side. Only room on both sides of that wrapper can fix it, and that is what cost the measure, so it needs a rule that fires only for a wrapper that disagrees with its items -- a change that moves core Markdown too, since its lists are inset the same way. ListMarkers.a11y keeps its two right-to-left fixme guards, with the reason they actually have now. Both surfaces give a block its own direction, so the old reason is spent; they still differ because Markdown pads the list on its start side while RichText insets each item, which is one inset apart exactly where an item reads against its list. One of the four guarded cases passes with the guard removed; three do not. 1079 unit tests pass, ListMarkers is 17 passed and 4 skipped, and the richtext Chromium suite is 109 passed with the image-resize failure that reproduces on main.
Review findings on the green head. The Siyaq numerals are not weak. I put the Indic and Ottoman Siyaq blocks in the weak set beside Rumi on the strength of their names; they are Bidi_Class AL, and only Rumi is AN. Checked against the browser's own implementation of the algorithm, which is what dir=auto runs: a Siyaq numeral resolves right-to-left where a Rumi numeral falls through to the next strong character. Both blocks come back out, the test that pinned the wrong answer is corrected, and so is the changeset line. This was mine, and it shipped in the shared classifier core Markdown already uses. Lexical puts a nested list in an item of its own after the item it hangs from. That holder was read as prose, so it took the direction of the list inside it, which is whichever language the first nested item happens to use. Two things followed: an item reading the other way lost its nesting step, because the holder had spent its inset on the far side, and a neutral item -- digits, an image -- followed that first item rather than the document. A holder is not a block a reader sees. It belongs to the item above it, and FR5 anchors a nested list on its parent item's text start, so it takes that item's direction. Measured at 390px, an English sibling under a Hebrew-first nested list moves from 24 to 48px, a neutral item from the Hebrew item's edge to the parent item's, and an agreeing nested list still steps 24 / 48 / 72. One wording note for the record, not a code change: FR6 says a block with no strong character takes the provider's direction, and a neutral item here takes its parent item's. The two agree unless the parent item reads against the provider. Writing the provider's direction onto the block instead would store a value its own text does not carry and freeze it for a reader who opens the document the other way round, so the inherited value is kept and the parity test says so. FR6 verification, in both document directions: a nested list whose items read both ways with a neutral one among them, and a fenced code line's own direction with the caret walking it the way the arrow points. A fence keeps its lines in one text run separated by newlines, so the line geometry is read from character ranges rather than nodes. The two jsdom tests that drove a holder directly described the old rule and used a holder with no item above it, which no document produces. They now use the shapes that do, and a new one pins what the ancestor walk is for: a quote two levels above the text that changed is settled in the keystroke's own update, where a transform on the nearest block alone leaves it reading left-to-right. 885 unit tests pass, tsc and eslint are clean, and the richtext and List Chromium suites are 130 passed with the image-resize failure that reproduces on main. blockNesting.test.tsx fails on main too.
Three review fixes. The comment at $ownDirection cited FR5 for the rule it follows, which is a claim id in source and what the provenance baseline exists to catch. Regenerating the baseline had added an entry for the new file, which switches the rule off for it rather than satisfying it. The sentence now states the rule in its own words, the generated entry is gone, and the baseline is byte-identical to main again: this change does not touch it. A new export is a compatible capability, so it needs its own [feat] entry rather than riding the [fix] one, which never named it. The changeset says what firstStrongDirection answers and that both surfaces now share it.
check:changesets requires a contributor handle on its own line, which the new [feat] entry was missing.
astracat found Hanifi Rohingya digits read as strongly right-to-left. Rather than add one block, I swept both supplementary ranges in STRONG_RTL against the browser's own implementation of the algorithm, code point by code point, asking dir=auto what it makes of each one followed by a letter. That found eight disagreements, not one. The ranges are drawn around whole planes, so besides those scripts' letters they swallow their digits and punctuation: the Phoenician word separator, Avestan punctuation, the Hanifi Rohingya, Garay and Yezidi digits, a Garay mark, and the Arabic mathematical operators. The Rumi range also ran one code point past the block's end, onto a code point the browser reads as strong. All are Bidi_Class AN, EN, ET or ON, so none of them decides a direction, and they join the set the scan passes over. The set is no longer only numbers, so it is renamed. Re-running the sweep over all 2,816 code points in the two ranges now reports no disagreement with the browser. The test names each block with the class that put it there. Restores the table-cell test from the review of 4 November, which asked for leading Hebrew marks, combining-only content and Roman numerals in both document directions through import and the editing path. It was in the pre-rebase branch and I did not carry it over in the respin. 1918 unit tests pass, and the richtext and List Chromium suites are 132 passed. The image-resize and deep-nesting failures reproduce on main.
The new changeset claimed firstStrongDirection follows Unicode rules P2 and P3. It approximates them, and astracat's example shows where the approximation was wrong rather than merely incomplete: ०१ שלום answered rtl where P2 gives ltr, because a Devanagari digit is Bidi_Class L and the classifier read every digit as neutral. Sweeping all 770 decimal digits in the first two planes against the browser, with two probes per code point to tell strong L from strong R from weak, found 320 of them misread across 32 scripts -- Devanagari, Bengali, Gurmukhi, Gujarati, Oriya, Tamil, Telugu, Kannada, Malayalam, Sinhala, Thai, Lao and the rest. Their digits are L, so a line that opens with them reads left to right. Decimal digits join the strong left-to-right set, and the digits that are not L are named in the weak set that is read before it: the European and fullwidth ones are EN, the Arabic-Indic ones AN, and the mathematical, segmented and Nag Mundari ones EN. NKo's and Adlam's stay R through their own script escapes. Re-running the sweep reports no disagreement on any of the 770. The changeset now says the function approximates P2 and P3 from script and category, and names what it does not do: isolates. 22,028 unit tests pass. Two failures, blockNesting and postinstall, reproduce on main.
The [feat] entry still said firstStrongDirection reads a Bidi_Class L digit as neutral. That was true when the sentence was written and the commit after it made those digits strong, so the entry described the behaviour it had just removed. The isolates clause stands.
Two wording notes from review, both non-blocking. The JSDoc on the newly public firstStrongDirection still claimed to follow rules P2 and P3. It approximates them from script and category, and it does not skip isolated runs, which is what the changeset already said; the two now agree. The [fix] changeset named only the Arabic marks and the Rumi numerals. Reading a Bidi_Class L digit as strong changes Markdown output as well: a line opening with Devanagari digits before Hebrew now reads left-to-right where it read right-to-left. The entry says so and names the scripts.
The rebase onto main moved RichText's plugins into src/internal/, which made BlockDirectionPlugin an internal module that RichTextEditor and RichTextView import from outside its folder with no current record naming it. AST-061 already decides the rule the module implements, so it claims the four files that carry it through a path-applicability block: the shared classifier, core Markdown's resolver, the plugin and its test, and the RichText editor theme. Its Current-state impact now says what the plugin is for and why core's Markdown/blockDirection.ts does not cover it. Markdown renders from a syntax tree and can resolve a block's direction as it renders. The RichText surfaces render from Lexical's stored editor state, so the direction is written onto the node inside the update that changed the text: that is what puts it in the keystroke's own undo step, and what makes a reopened document read the way it was written. A render-time resolver does neither. A module record would be the narrower home, but each one here declares a parent_component that must resolve to an active component record, and neither RichTextEditor nor RichTextView has one. The test file's header named its pre-rebase filename.
Cindy decided both open questions on the pull request. firstStrongDirection stays internal. It is no longer exported from @astryxdesign/core/i18n; RichText reaches it through a new internal entry point, @astryxdesign/core/internal/first-strong-direction, beside the other internal entries, so the two surfaces still share one classifier and nothing outside Astryx gains API. The [feat] changeset that announced the public export is gone with it. no-core-internal-import reserved those subpaths for Core and Lab, so it now covers RichText too, which is an Astryx package shipped from this repository. This widens a shared rule, so it is called out for an owner rather than buried. A block with no strongly directional text takes the document's direction, as FR6 says and as Markdown already resolves one, instead of the direction of the list or item holding it. The nested list still anchors on its parent item's line, which the holder rule already does. The mechanism stores nothing: the plugin puts the document's direction on the editor root as a custom property, and a block with no written direction reads that property. A custom property arrives unchanged through a container whose own direction differs, where inherit handed the block that container's direction. Nothing about a block's own text is written unless its text decided it, so reopening a document under the other provider direction still reads correctly. Lexical leaves a top-level block at dir=auto and writes no attribute below it, so the rule covers both spellings. List items now take the block class that carries it; they took only their own layout styles before, which is why a nested item followed its container. 958 unit tests pass and the parity suite is 46 passed.
Cindy corrected her earlier instruction: Core's internal entry points are reserved for Core and Lab by architecture:public-component-api, and widening no-core-internal-import to RichText changes that rule, which is a separate owner decision. So RichText keeps its own copy of the classifier in packages/richtext/src/internal, with the same tests, and both copies carry a SYNC comment naming the other. The Core internal entry point and both lint-file edits are reverted: packages/core/package.json, eslint.config.js and the rule are byte-identical to main again, which also clears the sync-exports check that was failing on the generated exports map. AST-061 said both surfaces read the direction with the classifier in core's i18n entry point, which is no longer true for RichText, and its path-applicability block did not list the new file. Both corrected. Comment drift: the holder item takes its direction from the item it hangs from, not from the text under it, and three Arabic AL characters are written into the strong set, not four. The changeset now names Badge, Token and InputGroupText, which read the same strong set to decide whether their own text is right-to-left, so the digit correction reaches them too. 1329 unit tests pass, tsc and eslint are clean on both packages, and check:knowledge, check-changesets, sync-exports and the provenance baseline all pass.
design:bidirectionality DR9 rules out script where CSS can express the same thing, and an Effect was writing the document's direction onto the editor root after render. The surface root now sets a private custom property from a :dir() rule, as CodeBlock's root does, and a block whose own text decided nothing reads that property. A custom property still arrives unchanged through a list or table that reads the other way, which is what the property is for. The Effect, the useDirection() read, the root listener and the exported DOCUMENT_DIRECTION_VAR name are all gone; the plugin registers its transforms and nothing else. main gained component:CodeBlock FR16 while this branch sat, and it puts each fence line's code in its own dir=auto element. Core Markdown therefore meets FR6's per-line rule, where the theme comment, the plugin comment, a unit-test comment and the description all still said it reorders a whole block. Each now says both surfaces reach the rule, by different means. The changeset said Badge, Token and InputGroupText follow a label that opens with any of the listed characters. They read the strong set to ask whether the label holds a right-to-left character anywhere, so only the three Arabic marks change them, wherever those sit. Description: the plugin uses RichText's own copy of the classifier, not a shared one; the Markdown-visible change lists every character the sweep found, not only the first few; the real-editor test removes a paragraph from a quote; twelve commits; and the R7 line cites the gap form this edit leaves rather than the line it removes. Also the weak-set comment in both classifier copies, which said the set holds the right-to-left scripts' characters while it also holds the ASCII, fullwidth and mathematical digits. 968 unit tests pass and the parity suite is 46 passed with no Effect in the plugin.
DOCUMENT_DIRECTION_VAR named --astryx-richtext-document-direction and described an Effect writing it on the editor root. Both went when the surface root started setting --_richtext-document-direction from a :dir() rule, and nothing imported the constant afterwards. Both classifier comments said the sets name the characters where script and category disagree with Bidi_Class. They name the ones this surface has needed; others still disagree, as they did before this change, so the comments say that instead of claiming the sets are complete.
The sweep cleared an arriving dir from lists, tables and code blocks but walked from the root's children, so the root itself was never visited. Lexical writes a stored root direction onto the editable element and every container under it inherits, so a value saved in a right-to-left document laid its tables and code frames out that way in an English one, with the copy button over the code, and kept the stale value when saved again. The root is a container: it carries no text of its own, so it gives the direction up and the surface decides. It joins the swept set, and $isSettled answers for it directly, since $wantedDirection already returns null for anything that is not a prose block. The container test's fixture already carried a root direction, so the case was there and unasserted; it now checks the root as well as the list. Both assertions compare against the stored rtl rather than null, because Lexical spells "no direction of its own" differently on a node it rendered than on one it did not, and the direction the containers take is what the test is about. The inset comment on ol repeated ul's seven lines; it points at ul now. 968 unit tests pass and the richtext Chromium suite is 116 passed, with the image-resize failure that reproduces on main.
The plugin registered its transforms in an ordinary effect, which React runs after the browser has painted, so the first frame showed a block in the document's direction and the write moved it. It registers in a layout effect now, which React runs after Lexical has written the document into the DOM and before paint, and settles the document already in the editor in that same frame: registering only arms the transforms, and a document loaded with the editor has run none of them. This does not make the rule expressible in CSS, which is what DR9 asks first. Under dir=auto the HTML Standard resolves a block with no strongly directional character to ltr, not to the surrounding direction, so no selector separates a block of English from a block of digits: both are :dir(ltr). unicode-bidi: plaintext resolves the same way, and lays a neutral line out left in a right-to-left page while leaving the computed direction saying rtl, which is why the parity tests pass over it. The one direction the platform cannot express is therefore the only one still written from script, and it is now written before anything is shown. Also: the SYNC line named two files that do not mirror this plugin; they mount it and set the custom property. And editorTheme.ts had a stray blank line. 968 unit tests pass, the parity suite is 46 passed, tsc and eslint are clean, and the provenance baseline is untouched.
|
On the
It reaches this pull request only because The branch is rebased onto |
|
/approve-spec 65c4833 |
There was a problem hiding this comment.
Changes requested: the right-to-left behaviour and the record change hold up at this head, and the direction write now runs in a layout effect before the browser's first paint, which addresses the flash from the previous round, so what remains is two description fixes.
- The description says the classifier's sets "now name the characters where the two disagree", but the code comment in
firstStrongDirection.ts(and your own count of about 3,600) says others still disagree, so please reword it to match the comment. - The Respin and Commits sections say the branch is 15 commits on
main, but this head is 16, so please correct or drop the number.
Approval also waits on the change request an engineering owner left on 4 November, which stays open until that owner reviews again or dismisses it. CI's heavy jobs did not run on this head because CI was full, and one non-blocking comment suggestion is inline.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- Changeset: RichText blocks take their own text's direction in either document: verified (Chromium suite, captured frames).
- Changeset: the shared classifier reclassifies three Arabic marks, the Rumi numerals and digits whose bidi class is L, so a line opening with Devanagari digits before Hebrew now reads left-to-right in Markdown: verified (code-point sweep, unit tests).
- Changeset: Badge, Token and InputGroupText now count the three Arabic marks anywhere in a label: verified (only those three characters change there).
- Changeset: code lines read their own way, top-level containers keep the document's order, a nested list follows its holder, and the stored value drops an arriving direction: verified (theme, plugin, unit and Chromium tests).
- Description: Markdown changes only for the listed characters, and no API is added or removed: verified (sweep; API surface comparison shows no rows).
- Description: RichText keeps its own copy of the classifier with SYNC comments and the same tests: verified (identical tests, identical answers on every code point).
- Description: on the base, RichText takes the provider's direction and the caret walks against the arrow key: verified (caret probe).
- Description: the plugin writes direction at any depth, containers give up an arriving direction, and decorators are skipped as Markdown skips them: verified.
- Description: the list inset sits on each item and uniform lists keep their geometry: verified (theme values, nested-list parity test).
- Description: the write lands in the keystroke's own undo step: verified (unit and Chromium undo tests).
- Description: the classifier's before rows: verified.
- Description: the sets now name every character where script and category disagree with the bidi class: false.
- Description: ten core test cases, and reverting the change fails the named groups: verified.
- Description: the record change is approved for this head: verified.
- Description: the branch is 15 commits on main: false (16).
Files:
.changeset/richtext-text-block-own-direction.md: cleardocs/specs/AST-061-document-surface-parity/spec.md: clearpackages/core/src/List/ListMarkers.a11y.chromium.spec.ts: clearpackages/core/src/i18n/firstStrongDirection.test.ts: clearpackages/core/src/i18n/firstStrongDirection.ts: clearpackages/richtext/src/RichTextEditor.tsx: clearpackages/richtext/src/RichTextView.tsx: clearpackages/richtext/src/__tests__/BlockDirection.a11y.chromium.spec.ts: clearpackages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts: clearpackages/richtext/src/__tests__/Playground.a11y.chromium.spec.ts: clearpackages/richtext/src/editorTheme.ts: clearpackages/richtext/src/internal/BlockDirectionPlugin.test.tsx: clearpackages/richtext/src/internal/BlockDirectionPlugin.tsx: non-blocking (settle comment; holder lag)packages/richtext/src/internal/firstStrongDirection.test.ts: clearpackages/richtext/src/internal/firstStrongDirection.ts: clear
| // Registering only arms the transforms; a document already in the | ||
| // editor has run none of them. Settle it now, in this same frame. |
There was a problem hiding this comment.
Non-blocking: in Lexical 0.52, registerNodeTransform marks every existing node of that class dirty and queues a transform pass, so the loaded document would be transformed anyway, just in a later microtask and without the root. This discrete sweep is what makes it synchronous. Suggested:
// Registering queues a transform pass over the loaded nodes, but not the
// root and not synchronously. Settle the whole document now, in this commit.|
(Posted by Cindy's agent.) Thank you, the first-frame fix works. A real-browser screencast of a fully right-to-left page shows left-to-right blocks on the left from the first painted frame, and neutral blocks on the right from the first frame too. The code block header, tables and code lines also check out against
CodeBunny's two description fixes (the classifier sentence and the commit count) still apply. |
humbertovirtudes
left a comment
There was a problem hiding this comment.
Approved at 65c483334eb51ecbde58f983f40268263733a194 for the Table-direction change and its direct dependencies. This supersedes the 4 November change request: the four Hebrew-mark and Roman-numeral failures are resolved, with the no-strong fallback preserved.
Validation at this unchanged head: 32 committed unit tests and 8 Chromium tests passed, including table direction in both document directions and undo. Removing the combining-mark guard or Roman-numeral handling reproduces the respective failures. A review-only seed-mount probe also passed all 3 cases without firing onChange.
Non-blocking follow-ups, pls address:
- Add a first-painted-frame browser regression test in an RTL page for English and digit-only blocks.
- Commit the seed-mount test asserting that opening a document does not fire
onChange. - Record the server-render/hydration limitation in AST-061 FR6 verification.
- Correct the description: the classifier is an approximation, not an exhaustive Bidi_Class implementation; update the commit count to 16 or remove it.
These items do not block this code approval. Other review gates and CI remain independent; this is not a claim that all CI checks passed.
(Posted by an agent with Humberto’s explicit approval.)
… from a seeded mount A real-browser case records each seeded block's computed direction on the first frame that holds it, in a right-to-left page: an English paragraph reads ltr and a digit-only paragraph rtl. Unit cases check that mounting with a seeded document, or mounting the plugin on a document already shown, fires no onChange. The AST-061 FR6 verification row names the gap left for server-rendered documents without stored directions. Co-authored-by: potatowagon <[email protected]>
|
/approve-spec 8e34922 |
There was a problem hiding this comment.
Changes requested: the right-to-left behaviour, the first-frame fix and the record change hold up at this head, and the three additions an engineering owner asked for are in, but one new record line is wrong.
- The line added to the end of
spec:AST-061FR6's verification row says server-rendered documents whose strong blocks have no stored direction take the provider's side until hydration, but neitherRichTextEditornorRichTextViewrenders any block on the server (both render an empty editable, and the client settles each block's direction before its first paint), so please drop that sentence or say what holds, and drop the description's matching "remaining gap" and "follow-up fix" lines.
Both earlier description fixes are in, and the 4 November change request is settled by that owner's later approval. The record edit will need an engineering owner's /approve-spec again at the new head. CI's heavy jobs did not run on this head because CI was full; Lint passed. The record line and one non-blocking suggestion are commented inline.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- Changeset: RichText blocks take their own text's direction at any depth, in either document: verified (Chromium suite, captured frames).
- Changeset: code lines read their own way; top-level containers keep the document's order; a nested list follows its holder; the stored value drops an arriving direction: verified (theme, plugin, unit and Chromium tests).
- Changeset: the shared classifier reclassifies three Arabic marks, the Rumi numerals and digits whose bidi class is L, so a line opening with Devanagari digits before Hebrew reads left-to-right in Markdown: verified (classifier tests, code-point sweep).
- Changeset: Badge, Token and InputGroupText count the three Arabic marks anywhere in a label: verified.
- Description: Markdown changes only through the shared classifier, and no API is added or removed: verified (API surface comparison shows no rows).
- Description: RichText keeps its own classifier copy with sync comments and the same tests: verified (identical answers on every code point).
- Description: on the base, RichText takes the provider's direction and the caret walks against the arrow key: verified.
- Description: the plugin writes direction at any depth, containers give up an arriving direction, and decorators are skipped: verified.
- Description: the list inset sits on each item and uniform lists keep their geometry: verified (theme values, nested-list test); the three-deep 390 px numbers were not re-measured.
- Description: the write lands in the keystroke's own undo step: verified (unit and Chromium undo tests).
- Description: the classifier's sets name the characters this surface needed, and about 3,600 others still disagree: verified (about 3,540 under the available Unicode data).
- Description: ten core test cases and the listed RichText unit and Chromium tests: verified.
- Description: the record change is approved for this head: verified.
- Description: no RichTextEditor or RichTextView component record exists to parent a module record: verified.
- Description: this head changes no component code, styles or markup: verified.
- Description: the first-frame test passes and fails with an ordinary effect: verified (5 of 5 each way).
- Description: a seeded mount fires no onChange, and Lexical already tags those updates as history merges: verified.
- Description: the record names a remaining server-render gap and a follow-up is queued: false (no block is server-rendered).
- Description: local gates (970 unit tests; 135 Chromium passed, 4 skipped; lint, types and records clean): verified.
Files:
.changeset/richtext-text-block-own-direction.md: clearapps/storybook/stories/RichTextEditor.stories.tsx: cleardocs/specs/AST-061-document-surface-parity/spec.md: blocking (server-render gap line)packages/core/src/List/ListMarkers.a11y.chromium.spec.ts: clearpackages/core/src/i18n/firstStrongDirection.test.ts: clearpackages/core/src/i18n/firstStrongDirection.ts: clearpackages/richtext/src/RichTextEditor.tsx: clearpackages/richtext/src/RichTextView.tsx: clearpackages/richtext/src/__tests__/BlockDirection.a11y.chromium.spec.ts: non-blocking (header names the wrong story)packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts: clearpackages/richtext/src/__tests__/Playground.a11y.chromium.spec.ts: clearpackages/richtext/src/editorTheme.ts: clearpackages/richtext/src/internal/BlockDirectionPlugin.test.tsx: clearpackages/richtext/src/internal/BlockDirectionPlugin.tsx: non-blocking (settle comment; holder lag)packages/richtext/src/internal/firstStrongDirection.test.ts: clearpackages/richtext/src/internal/firstStrongDirection.ts: clear
|
|
||
| /** | ||
| * @file BlockDirection.a11y.chromium.spec.ts | ||
| * @input The RichTextEditor "Default" story in a built Storybook. |
There was a problem hiding this comment.
Non-blocking: the first-frame test below reads the MixedDirectionSeed story, not "Default". Suggested: @input The RichTextEditor "Default" and "MixedDirectionSeed" stories in a built Storybook.
Neither RichTextEditor nor RichTextView renders a block on the server: both render an empty editable, and the client settles each block's direction before the first paint. The gap line described a state that does not occur. Co-authored-by: potatowagon <[email protected]>
|
/approve-spec 118a69b |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet, and the merge guard waits for its required checks to pass.
RichTextEditor and RichTextView now give each paragraph, heading, quote and list item the direction of its own text in either document, as spec:AST-061 FR6 requires, and the record sentence about server-rendered documents that held the previous head is gone. Three non-blocking notes stay open in their inline threads: the settle comment in BlockDirectionPlugin.tsx, the holder item's one-edit lag, and the spec header that names only the Default story.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- Changeset: RichText paragraphs, headings, quotes and list items take their own text's direction at any depth, in either document: verified (Chromium suite, captured frames).
- Changeset: each code line reads its own way; top-level lists, tables and code blocks keep the document's order and a nested list follows its holder; the stored value drops an arriving direction: verified (theme, plugin, unit and Chromium tests).
- Changeset: the shared classifier reclassifies three Arabic marks, the Rumi numerals and digits whose bidi class is L, so a line opening with Devanagari digits before Hebrew now reads left-to-right in Markdown: verified (classifier tests, red-first run, code-point sweep).
- Changeset: Badge, Token and InputGroupText count the three Arabic marks anywhere in a label: verified.
- Description: Markdown changes only through the shared classifier, for the characters listed, and no API is added or removed: verified (API surface comparison shows no rows).
- Description: RichText keeps its own classifier copy with sync comments and the same tests: verified (identical answers on every code point).
- Description: on the base, RichText takes the provider's direction and the caret walks against the arrow key: verified (caret probe).
- Description: the plugin writes direction at any depth, containers give up an arriving direction, and decorators are skipped as Markdown skips them: verified.
- Description: the list inset sits on each item, uniform lists keep their geometry and nothing overflows: verified at 390 px; the three-deep before and after numbers were not re-measured.
- Description: the write lands in the keystroke's own undo step: verified (unit and Chromium undo tests).
- Description: the classifier's sets name the characters this surface needed, and about 3,600 others still disagree: verified (about 3,540 under the available Unicode data).
- Description: ten core test cases, and the Arabic-mark and numeral groups fail with the change reverted: verified.
- Description: the listed RichText unit and Chromium tests, and the two tests that move with the rule: verified.
- Description: the record claims six files and its change is approved for this head: verified.
- Description: no RichTextEditor or RichTextView component record exists to parent a module record: verified.
- Description: this head changes no component code, styles or markup, and the record reads as it did at the earlier approved head: verified.
- Description: the first-frame test passes and fails with an ordinary effect: verified (3 of 3 each way).
- Description: a seeded mount fires no onChange, and Lexical already tags those updates as history merges: verified.
- Description: local gates (970 unit tests; 135 Chromium passed, 4 skipped; lint, types and records clean): verified.
Files:
.changeset/richtext-text-block-own-direction.md: clearapps/storybook/stories/RichTextEditor.stories.tsx: cleardocs/specs/AST-061-document-surface-parity/spec.md: clearpackages/core/src/List/ListMarkers.a11y.chromium.spec.ts: clearpackages/core/src/i18n/firstStrongDirection.test.ts: clearpackages/core/src/i18n/firstStrongDirection.ts: clearpackages/richtext/src/RichTextEditor.tsx: clearpackages/richtext/src/RichTextView.tsx: clearpackages/richtext/src/__tests__/BlockDirection.a11y.chromium.spec.ts: non-blocking (header names only the Default story)packages/richtext/src/__tests__/MarkdownParitySandbox.a11y.chromium.spec.ts: clearpackages/richtext/src/__tests__/Playground.a11y.chromium.spec.ts: clearpackages/richtext/src/editorTheme.ts: clearpackages/richtext/src/internal/BlockDirectionPlugin.test.tsx: clearpackages/richtext/src/internal/BlockDirectionPlugin.tsx: non-blocking (settle comment; holder lag)packages/richtext/src/internal/firstStrongDirection.test.ts: clearpackages/richtext/src/internal/firstStrongDirection.ts: clear
Scope
Packages:
@astryxdesign/richtext,@astryxdesign/core.Components:
component:Markdown,firstStrongDirection.component:Markdowndoes render differently, in one way: it shares theclassifier, so a line that opens with tatweel, the Arabic semicolon or
question mark, a Rumi digit, or a digit of any script whose digits are
Bidi_Class
L— Devanagari, Bengali, Gujarati, Telugu, Tamil, Thai, Lao,Myanmar, Khmer, Tibetan and 46 others — now takes a different direction, and
so does one opening with a Hanifi Rohingya,
Garay or Yezidi digit, the Phoenician word separator, Avestan punctuation, a
Garay hyphen or an Arabic mathematical operator — every character the sweep
against the browser found misread. Nothing else about its output changes. The
change to
@astryxdesign/coreis that correction alone: no API is added orremoved.
RichText keeps its own copy of the classifier in
packages/richtext/src/internal/firstStrongDirection.ts, because Core'sinternal/*entry points are reserved for Core and Lab. Each copy carries aSYNC comment naming the other, and each has the same test, so a correction
to either set is visible in both. Sharing one classifier across packages is
its own decision, not this one.
The bug
spec:AST-061FR6 gives a prose block the direction of its own text on everysurface. Core
Markdownalready follows it.RichTextEditorandRichTextViewstill take the provider's direction for every block, so aHebrew paragraph in an English document flushes left and its caret moves
opposite to the arrow key; an English paragraph, list item or table cell in a
Hebrew document does the mirror.
Repro: open RichTextEditor → Playground, paste
פסקה בעברית לבדיקת כיוון הטקסט., click into it and press Right.The fix
BlockDirectionPluginwrites each prose container's own direction onto it, atany depth, from RichText's own copy of
firstStrongDirection. Containers take theirparent's direction instead and give up a
dirthat arrives with pasted HTMLor an older stored document.
Why write it rather than derive it in CSS. Under
dir="auto"a block ofEnglish, a block of digits, an image-only block and an empty block are all
:dir(ltr), so a rule that catches the first catches the other three. Anearlier draft used a symmetric
:dir()rule and broke the right-to-leftimage-resize test. Writing the attribute is the only thing that can say "this
block has no direction of its own"; such a block is left alone and follows the
document, so an empty paragraph keeps its caret on a right-to-left document's
start edge.
Only text a reader reads decides it. A decorator shows no prose of its
own, and
getTextContentreturns its alternative text, so an English captionwould turn a Hebrew list item left-to-right. Core
Markdownskips the samenodes.
Containers. A list orders its markers and insets in its parent's
direction; a table reads its columns that way; a fenced code block frames its
lines that way and adds
unicode-bidi: plaintext, so each line reads its ownway — a Hebrew comment right-to-left while
const x = 1;keeps its semicolonat the end. Core
Markdownreaches the same rule a different way: it rendersfences through CodeBlock, which puts each line's code in its own
dir="auto"element (
component:CodeBlockFR16). RichText has no per-line node to carryone.
Where the two surfaces still differ, recorded as a gap in AST-061: the
text start of an item that reads against the list holding it, where the two
hold the themed inset in different places.
List geometry. The themed inset sits on each item's own start side, not
on the list. An
outsidemarker is drawn beyond its item's own start edge,which is the opposite edge from the list's when the two disagree, so an inset
held by the list reserved room on the side the marker is not on and let it
escape the field. Held by the item it is always on the marker's side and costs
the same measure either way, so a list whose items agree with it wraps where
core
Markdownwraps. Measured at 390 px, English items three deep under aHebrew-first
wrapper go from
24 / 24 / 24to24 / 48 / 72; a uniform list in eitherdirection keeps the geometry it had, and nothing overflows.
Undo. Typing dirties a text node, not its container, so the write happens
in a
TextNodetransform that walks every prose ancestor — inside thekeystroke's own update, and so in its own history entry. An update listener
sweeps a whole-state replacement, which runs no transforms, tagged
history-mergeso undo does not bounce off it.The shared classifier
This also fixes two defects in
packages/core/src/i18n/firstStrongDirection.ts,which Markdown already ships:
Three
ALcharacters whose script isCommon— the semicolon, the questionmark and tatweel — join the strong set (the letter mark was already there),
and the Rumi numerals join the weak one. The Indic and Ottoman Siyaq blocks
look like company for Rumi and are not: they are
AL, so they stay strong. JavaScript exposes no\p{Bidi_Class=…}escape, so the sets approximate it from script and category.They name the characters this surface has needed where the two disagree; about
3,600 others still disagree, as before: some Arabic and NKo
ONsigns,ONmodifier letters, and
Lpunctuation (firstStrongDirection.ts).firstStrongDirection.test.tscovers the named ones.Both copies of the classifier carry the fix, and both test files cover it.
manual test (by human)
BUG: cursor moving in the opposite direction of the arrow key for RTL in a LTR doc and LTR in a RTL doc
before:
Screen.Recording.2026-10-28.at.7.49.25.PM.mov
^ a RTL in a LTR document has the cursor moving in the opposite direction of the arrow key. eg. arrow right moves cursor left. Vice versa for a LTR in a RTL document
after:
Screen.Recording.2026-10-28.at.4.00.20.PM.mov
known issue due to an unrelated factor
after:

^ why in a RTL the LTR doc doesnt flush all the way right and theres a gap:
Prose is capped at 680px (PROSE_MEASURE, editorTheme.ts:34) per spec:AST-061 FR2–FR4, matching core Markdown's content width — long lines are hard to read. Tables and code blocks are exempt, which is why the table reaches the edge and the Hebrew paragraph stops 220px short.
Tests
Core.
firstStrongDirection.test.ts— ten cases over the classifier,including leading combining marks, letter numbers, the three Arabic
ALmarks and the three
ANnumeral blocks. The last two groups fail with thischange reverted.
RichText, jsdom.
internal/BlockDirectionPlugin.test.tsx—ltr/rtl/autoon theright containers in both surfaces, a rewrite when the view is handed a new
document, a stored
<ul dir="rtl">giving its direction up, a three-deeplist whose wrappers all carry a direction, and three that drive a real Lexical
editor and read the state of the update that is not tagged
history-merge— the one a caller'sonChangesees — to prove the writelands in the keystroke's own update, reaches a grandparent block, and
survives a paragraph being removed from a quote.
RichText, Chromium.
BlockDirection.a11y.chromium.spec.tsis the undoguard:
-+Hello+Ctrl+Z and123+שלום+Ctrl+Z both walk back to anempty document.
MarkdownParitySandboxnow states one rule for bothsurfaces, and adds a nested list stepping in once per level whichever way its
items read, and a table cell read past a combining mark and a letter number,
each in both document directions.
Two existing tests move with the rule rather than against it. The parity
sweep reads only document blocks, since a toolbar dialog's heading is chrome
and follows the provider. The right-to-left resize test puts its image in a
right-to-left block it writes itself: this document's own last block is
English, so under FR6 it reads left-to-right and an image in it has its handle
on the right.
At
804d6ed: 1895 unit tests pass,eslint0 errors,tsc --noEmitclean on both packages, Prettier clean. The richtext Chromium suite is 108
passed, 1 failed —
a selected image resizes by its handle, which failsthe same way on pure
main(expected > 585, received 584) and is not thisbranch's.
The record
spec:AST-061claims the six files that carry the rule — both copies of theclassifier,
Markdown/blockDirection.ts, the plugin and its test, and theRichText editor theme — through a
path-applicability:v1block. That recordchange is approved for this head.
Its Current-state impact says what the plugin is for and why core's
Markdown/blockDirection.tsdoes not cover it:Markdownrenders from anabstract syntax tree and can resolve a block's direction as it renders, while
the RichText surfaces render from Lexical's stored editor state, so the
direction has to be written onto the node inside the keystroke's own update —
to sit in that keystroke's undo step, and to survive storing and reopening the
document. A render-time resolver can do neither.
A module record would be the narrower home, but every one in this repository
declares a
parent_componentthat must resolve to an active component record,and there is no
component:RichTextEditororcomponent:RichTextViewtoparent it to. Authoring those is maintainers' work, not an outside
contributor's, so the rule stays with the system spec that already decides it.
Writing rubric results
describes what each surface does. No proposal, history or porting language.
code-point sweeps stay in this pull request's comments.
is cited.
decisions are stated in this description, not in the record.
FR5 gap:form and name an observable mismatch.Maintainer additions (this head)
Carried for the maintainers on the contributor's branch, with
mainmerged in. There are no changes to the component's code, styles or markup, and the AST-061 record reads as it did at the approved head.BlockDirection.a11y.chromium.spec.tsgains "a seeded document paints every block on its own side on the first frame (rtl page)". The story's provider and the page around the editor read right to left. A frame callback installed before any page script records each block's computed direction on the first frame that holds them: the English paragraph isltrand the digit-only paragraph isrtl. Moving the plugin's settle from a layout effect to an ordinary effect fails it (3 of 3 runs). The newMixedDirectionSeedstory holds the seeded document.BlockDirectionPlugin.test.tsxchecks that RichTextEditor mounted with a seeded document fires noonChange. A second case mounts the plugin on a document the editor already shows, whose list item has no stored direction, and checks that the write fires noonChangeeither. Lexical already tags its first commit, and a transform registration's update, as a history merge, so removing the plugin's own tag alone is not observable here; the test pins the outcome.check:knowledgeare clean.Respin
This branch was rebuilt on current
main.It had fallen 862 commits behind while the spec amendment was decided, and in
that time
maingained the Markdown half of FR6 — the shared classifier,Markdown/blockDirection.ts, and a parity fixture that describes Markdowntaking its own text's direction. Replaying the old sixteen commits through
that conflicted from the first one and produced intermediate states that did
not build, so the work was re-applied onto
maininstead: same behaviour,with RichText keeping its own copy of the classifier, which Core's
internal-entry rule requires.
The review history above refers to those commits. Every finding from it is in
this one, and the two that were parked behind the spec decision — the
mixed-direction nesting step and the wrapper's stored direction — are fixed
here.
Commits
On current
main, which is merged in. The first commit carries the behaviour;the rest are the review rounds over it.
git log --oneline upstream/main..HEADon the head gives the current list.