Repository navigation
PT-4678: Regression coverage for gutter markers on new paragraphs in Simple - #31
Conversation
9ff39a4 to
f5f89c5
Compare
irahopkinson
left a comment
There was a problem hiding this comment.
@irahopkinson+AI made 4 comments.
Reviewable status: 0 of 7 files reviewed, 3 unresolved discussions (waiting on katherinejensen00).
a discussion (no related file):
I reviewed the leading-space change in ParaNodePlugin.tsx and the new gutter tests, and left 4 findings inline. Each one shows the severity I settled on. checked and confirmed means the finding was verified against the code; needs a human call means it could not be settled either way, so it's yours to judge.
(AI-assisted, with my guidance)
packages/platform/src/editor/gutterParaMarkers.test.tsx line 28 at r1 (raw file):
* checked once in {@link mountSimple}. */ const GUTTER_GLYPH_SELECTOR = ":scope > .marker:not(.verse):not(.chapter):first-child";
#5 - low · checked and confirmed
If the gutter rule's selector in usj-nodes.css changes, these tests keep passing while the real gutter stops showing markers.
What happens: GUTTER_GLYPH_SELECTOR at gutterParaMarkers.test.tsx:28 is a hand copy of the per-paragraph half of the .psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-child rule in packages/platform/src/usj-nodes.css. Nothing ties the copy to the stylesheet.
Why it matters: maintenance only, with no behavior effect.
Fix: Add a node-environment test beside the stylesheet, for example packages/platform/src/editor/usj-nodes.css.test.ts, modeled on editor.css.test.ts (start with // @vitest-environment node, read ../usj-nodes.css with readFileSync(new URL("../usj-nodes.css", import.meta.url), "utf-8"), flatten whitespace with .replace(/\s+/g, " ")). Assert with toContain that the flattened CSS includes .psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-child. To keep the copy in gutterParaMarkers.test.tsx:28 in step with it, either build GUTTER_GLYPH_SELECTOR from that same string constant (exported from a small shared test helper) or note in its TSDoc that the new CSS test pins the selector. Add no ticket IDs to any new comment.
How this was checked: gutterParaMarkers.test.tsx:28 defines GUTTER_GLYPH_SELECTOR as a hand copy of the per-paragraph part of the rule at packages/platform/src/usj-nodes.css:2752 (.psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-child). Nothing in the test file reads usj-nodes.css, and the test runs in jsdom, which does not apply the stylesheet. So an edit to the CSS selector would leave the tests green. packages/platform/src/editor/editor.css.test.ts exists and guards editor.css the same way it is being asked for here: it runs under // @vitest-environment node, reads the file with readFileSync(new URL("./editor.css", import.meta.url)), whitespace-flattens it and asserts toContain on selector strings. The test file is new in this PR (230 added lines), so the anchor line is changed; usj-nodes.css is untouched. Impact is maintenance only.
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 38 at r1 (raw file):
*/ function $paraNodeTransform(node: ParaNode, editor: LexicalEditor): void { if (wasNodeCreated(editor, node.getKey())) {
#1 - low · checked and confirmed
In the paragraph-structure view, changing the paragraph style from the dropdown with the caret in a paragraph that has no leading verse removes the spaces at the start of its text, as the formatted and standard views already do.
What happens: formatPara with a caret (not a selected marker) calls $retagBlocksInSelection (packages/platform/src/editor/Editor.tsx:363), which uses Lexical's $setBlocksType to move the children into a fresh ParaNode. wasNodeCreated is therefore true at ParaNodePlugin.tsx:38, the first child is the moved gutter glyph, and $removeLeadingSpace now runs on first.getNextSibling() (:40), trimming the text after the glyph. Before this change the glyph was the first child, so the trim was a no-op in this view.
Why it matters: a style change now deletes text the user typed, in a view where it did not before. The formatted and standard views already trim the same spaces on a retag, so this brings the paragraph-structure view into line with them rather than making it uniquely lossy; only the unformatted view still keeps them. It hits only paragraphs with no leading verse whose text starts with a space. The CHANGELOG entry at packages/platform/CHANGELOG.md:114 describes splits only, so the new retag behavior is undocumented.
Fix: Decide whether a retag should keep a paragraph's leading spaces in every view or in none, and apply it consistently: either document in the CHANGELOG entry at packages/platform/CHANGELOG.md:114 that a style change also drops the leading spaces (matching formatted and standard), or skip the trim in $paraNodeTransform (ParaNodePlugin.tsx:37) for paragraphs created by $setBlocksType in $retagBlocksInSelection (Editor.tsx:363) in all views. Either way the Enter-split trim must stay, add a retag-with-leading-space case to gutterParaMarkers.test.tsx, and rebuild packages/platform/dist/ with scripts/rebuild-committed-output.mjs.
Other findings in this file: #2, #3
#3 - low · checked and confirmed
A collaborator in the paragraph-structure view now drops a leading space from a paragraph an applied update creates, leaving their document one character different from the sender's, as the other views already did.
What happens: remote deltas create a fresh ParaNode led by a gutter glyph through $createPara in libs/shared-react/src/plugins/usj/collab/delta-apply-update.utils.ts, used for an implied paragraph (:440) and for the head of a split (around :1591-1640). wasNodeCreated is true for that paragraph, so $paraNodeTransform (ParaNodePlugin.tsx:38-40) now trims the text after the glyph. The apply reports the incoming ops, not this trim, so peers never learn of it.
Why it matters: collaboration only, and only for remote content whose paragraph text starts with a space, which is rare. Once the documents diverge, later remote edits can land one position off.
Fix: In $paraNodeTransform (libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx), skip the leading-space trim when getApplyingUpdateSource(editor) (from shared) is defined, so only paragraphs created by the user's own typing are trimmed; the check covers both "local" and "remote" applies, since both report their ops unchanged. Add a co-located Vitest case in the delta-apply tests (and a ParaNodePlugin test) with a leading-space implied paragraph in the gutter view that asserts the space survives an applied update and is still trimmed when the user presses Enter mid-paragraph. Add an entry under ## [Unreleased] in packages/platform/CHANGELOG.md, and rebuild the committed output with node scripts/rebuild-committed-output.mjs (extract-api after build) so packages/platform/dist/ matches.
How this was checked: The delta apply creates the paragraph with $createPara (delta-apply-update.utils.ts:440, :1591) inside editor.update in Editor.tsx:933-950, so wasNodeCreated is true in the commit's transforms. Before this PR the trim looked only at node.getFirstChild(), which is the gutter glyph in the gutter view, so $removeLeadingSpace was a no-op there. The PR now skips the glyph (ParaNodePlugin.tsx:38-41) and trims the text after it, so a remote-created gutter paragraph whose text starts with a space loses it while the reported ops still contain it. The same trim already happens for remote-created paragraphs in the non-gutter views (unchanged line before the PR), so the divergence is an existing pattern that this PR extends to the gutter view. Still rare and collaboration-only. getApplyingUpdateSource exists and is exported from shared (libs/shared/src/nodes/usj/applyingUpdate.utils.ts:33, re-exported by nodes/usj/index.ts:20); the signal is set for both "remote" and "local" applies (Editor.tsx:948).
Other findings in this file: #1, #2
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 40 at r1 (raw file):
if (wasNodeCreated(editor, node.getKey())) { const first = node.getFirstChild(); $removeLeadingSpace($isGutterMarkerNode(first) ? first.getNextSibling() : first);
#2 - low · checked and confirmed
Removing the glyph skip from $paraNodeTransform leaves the shared-react ParaNodePlugin tests passing, so the library change is pinned only through the platform package's plugin order.
What happens: libs/shared-react/src/plugins/usj/ParaNodePlugin.test.tsx builds only paragraphs without a gutter glyph. The only test that exercises the skip at ParaNodePlugin.tsx:40 is in packages/platform/src/editor/gutterParaMarkers.test.tsx, and it fails without the fix only because ParaMarkerPrefixGuardPlugin registers before ParaNodePlugin in packages/platform/src/editor/Editor.tsx (:2038 vs :2043).
Why it matters: test-only, with no behavior effect. A reorder of the plugins in Editor.tsx would make the platform test pass without the fix, and nothing in shared-react would catch a regression.
Fix: Add a case to libs/shared-react/src/plugins/usj/ParaNodePlugin.test.tsx that first calls testEnvironment(), then, in a separate update via sutUpdate (from ./react-test.utils, imported next to pressEnterAtSelection), runs $getRoot().append($createParaNode().append($createGutterMarkerNode("\\q1 "), $createTextNode(" text"))), and asserts that $getRoot().getAllTextNodes() contains a node whose text is "text". The paragraph must be added in its own update rather than the initial editor state, because wasNodeCreated is false for nodes in the initial state and the transform would not strip the space. Import $createGutterMarkerNode from "shared" and keep the appends chained inside $getRoot().append(...). The case must fail when ParaNodePlugin.tsx:40 is reverted to $removeLeadingSpace(first).
How this was checked: ParaNodePlugin.tsx:40 now skips a gutter marker glyph before calling $removeLeadingSpace, but ParaNodePlugin.test.tsx only builds paragraphs without a glyph. I reverted the line to $removeLeadingSpace(first) in a scratch worktree and all three existing ParaNodePlugin tests still passed, so nothing in shared-react pins the change. In Editor.tsx, ParaMarkerPrefixGuardPlugin registers at line 2038, before ParaNodePlugin at line 2043, which is the only reason gutterParaMarkers.test.tsx exercises the skip. A reorder of those plugins would let that test pass without the fix. I also ran the proposed test shape (below): it passes with the fix and fails with the line reverted.
katherinejensen00
left a comment
There was a problem hiding this comment.
@katherinejensen00 made 4 comments.
Reviewable status: 0 of 7 files reviewed, 3 unresolved discussions (waiting on irahopkinson+AI).
a discussion (no related file):
Previously, irahopkinson+AI (Agent AI for Ira Hopkinson) wrote…
I reviewed the leading-space change in
ParaNodePlugin.tsxand the new gutter tests, and left 4 findings inline. Each one shows the severity I settled on.checked and confirmedmeans the finding was verified against the code;needs a human callmeans it could not be settled either way, so it's yours to judge.(AI-assisted, with my guidance)
Thank you for the review, Ira! I appreciate it :)
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 38 at r1 (raw file):
Previously, irahopkinson+AI (Agent AI for Ira Hopkinson) wrote…
#1 - low · checked and confirmed
In the paragraph-structure view, changing the paragraph style from the dropdown with the caret in a paragraph that has no leading verse removes the spaces at the start of its text, as the formatted and standard views already do.
What happens:
formatParawith a caret (not a selected marker) calls$retagBlocksInSelection(packages/platform/src/editor/Editor.tsx:363), which uses Lexical's$setBlocksTypeto move the children into a freshParaNode.wasNodeCreatedis therefore true atParaNodePlugin.tsx:38, the first child is the moved gutter glyph, and$removeLeadingSpacenow runs onfirst.getNextSibling()(:40), trimming the text after the glyph. Before this change the glyph was the first child, so the trim was a no-op in this view.Why it matters: a style change now deletes text the user typed, in a view where it did not before. The formatted and standard views already trim the same spaces on a retag, so this brings the paragraph-structure view into line with them rather than making it uniquely lossy; only the unformatted view still keeps them. It hits only paragraphs with no leading verse whose text starts with a space. The CHANGELOG entry at
packages/platform/CHANGELOG.md:114describes splits only, so the new retag behavior is undocumented.Fix: Decide whether a retag should keep a paragraph's leading spaces in every view or in none, and apply it consistently: either document in the CHANGELOG entry at packages/platform/CHANGELOG.md:114 that a style change also drops the leading spaces (matching formatted and standard), or skip the trim in
$paraNodeTransform(ParaNodePlugin.tsx:37) for paragraphs created by$setBlocksTypein$retagBlocksInSelection(Editor.tsx:363) in all views. Either way the Enter-split trim must stay, add a retag-with-leading-space case togutterParaMarkers.test.tsx, and rebuildpackages/platform/dist/withscripts/rebuild-committed-output.mjs.Other findings in this file: #2, #3
#3 - low · checked and confirmed
A collaborator in the paragraph-structure view now drops a leading space from a paragraph an applied update creates, leaving their document one character different from the sender's, as the other views already did.
What happens: remote deltas create a fresh
ParaNodeled by a gutter glyph through$createParainlibs/shared-react/src/plugins/usj/collab/delta-apply-update.utils.ts, used for an implied paragraph (:440) and for the head of a split (around :1591-1640).wasNodeCreatedis true for that paragraph, so$paraNodeTransform(ParaNodePlugin.tsx:38-40) now trims the text after the glyph. The apply reports the incoming ops, not this trim, so peers never learn of it.Why it matters: collaboration only, and only for remote content whose paragraph text starts with a space, which is rare. Once the documents diverge, later remote edits can land one position off.
Fix: In
$paraNodeTransform(libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx), skip the leading-space trim whengetApplyingUpdateSource(editor)(fromshared) is defined, so only paragraphs created by the user's own typing are trimmed; the check covers both "local" and "remote" applies, since both report their ops unchanged. Add a co-located Vitest case in the delta-apply tests (and a ParaNodePlugin test) with a leading-space implied paragraph in the gutter view that asserts the space survives an applied update and is still trimmed when the user presses Enter mid-paragraph. Add an entry under## [Unreleased]inpackages/platform/CHANGELOG.md, and rebuild the committed output withnode scripts/rebuild-committed-output.mjs(extract-api after build) sopackages/platform/dist/matches.How this was checked: The delta apply creates the paragraph with $createPara (delta-apply-update.utils.ts:440, :1591) inside editor.update in Editor.tsx:933-950, so wasNodeCreated is true in the commit's transforms. Before this PR the trim looked only at node.getFirstChild(), which is the gutter glyph in the gutter view, so $removeLeadingSpace was a no-op there. The PR now skips the glyph (ParaNodePlugin.tsx:38-41) and trims the text after it, so a remote-created gutter paragraph whose text starts with a space loses it while the reported ops still contain it. The same trim already happens for remote-created paragraphs in the non-gutter views (unchanged line before the PR), so the divergence is an existing pattern that this PR extends to the gutter view. Still rare and collaboration-only. getApplyingUpdateSource exists and is exported from shared (libs/shared/src/nodes/usj/applyingUpdate.utils.ts:33, re-exported by nodes/usj/index.ts:20); the signal is set for both "remote" and "local" applies (Editor.tsx:948).
-
#1: "Kept the trim and documented it. A caret retag now drops leading spaces in this view, matching formatted and standard. Keeping them would mean telling a retag apart from an Enter, which $setBlocksType gives no signal for. Added a CHANGELOG line and a regression test. Writing that test exposed a crash in the same flow (caret at the end, leading space, style change), which $removeLeadingSpace now handles by moving the caret back."
-
#3: "Fixed. The trim is skipped while getApplyingUpdateSource(editor) is set. Added a unit test, a platform test going through applyUpdate, and a CHANGELOG entry."
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 40 at r1 (raw file):
Previously, irahopkinson+AI (Agent AI for Ira Hopkinson) wrote…
#2 - low · checked and confirmed
Removing the glyph skip from
$paraNodeTransformleaves theshared-reactParaNodePlugintests passing, so the library change is pinned only through the platform package's plugin order.What happens:
libs/shared-react/src/plugins/usj/ParaNodePlugin.test.tsxbuilds only paragraphs without a gutter glyph. The only test that exercises the skip atParaNodePlugin.tsx:40is inpackages/platform/src/editor/gutterParaMarkers.test.tsx, and it fails without the fix only becauseParaMarkerPrefixGuardPluginregisters beforeParaNodePlugininpackages/platform/src/editor/Editor.tsx(:2038 vs :2043).Why it matters: test-only, with no behavior effect. A reorder of the plugins in
Editor.tsxwould make the platform test pass without the fix, and nothing inshared-reactwould catch a regression.Fix: Add a case to
libs/shared-react/src/plugins/usj/ParaNodePlugin.test.tsxthat first callstestEnvironment(), then, in a separate update viasutUpdate(from./react-test.utils, imported next topressEnterAtSelection), runs$getRoot().append($createParaNode().append($createGutterMarkerNode("\\q1 "), $createTextNode(" text"))), and asserts that$getRoot().getAllTextNodes()contains a node whose text is"text". The paragraph must be added in its own update rather than the initial editor state, becausewasNodeCreatedis false for nodes in the initial state and the transform would not strip the space. Import$createGutterMarkerNodefrom"shared"and keep the appends chained inside$getRoot().append(...). The case must fail whenParaNodePlugin.tsx:40is reverted to$removeLeadingSpace(first).How this was checked: ParaNodePlugin.tsx:40 now skips a gutter marker glyph before calling $removeLeadingSpace, but ParaNodePlugin.test.tsx only builds paragraphs without a glyph. I reverted the line to $removeLeadingSpace(first) in a scratch worktree and all three existing ParaNodePlugin tests still passed, so nothing in shared-react pins the change. In Editor.tsx, ParaMarkerPrefixGuardPlugin registers at line 2038, before ParaNodePlugin at line 2043, which is the only reason gutterParaMarkers.test.tsx exercises the skip. A reorder of those plugins would let that test pass without the fix. I also ran the proposed test shape (below): it passes with the fix and fails with the line reverted.
- #2: "Fixed. Added a gutter-glyph case to ParaNodePlugin.test.tsx; it fails with line 40 reverted."
packages/platform/src/editor/gutterParaMarkers.test.tsx line 28 at r1 (raw file):
Previously, irahopkinson+AI (Agent AI for Ira Hopkinson) wrote…
#5 - low · checked and confirmed
If the gutter rule's selector in
usj-nodes.csschanges, these tests keep passing while the real gutter stops showing markers.What happens:
GUTTER_GLYPH_SELECTORatgutterParaMarkers.test.tsx:28is a hand copy of the per-paragraph half of the.psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-childrule inpackages/platform/src/usj-nodes.css. Nothing ties the copy to the stylesheet.Why it matters: maintenance only, with no behavior effect.
Fix: Add a node-environment test beside the stylesheet, for example
packages/platform/src/editor/usj-nodes.css.test.ts, modeled oneditor.css.test.ts(start with// @vitest-environment node, read../usj-nodes.csswithreadFileSync(new URL("../usj-nodes.css", import.meta.url), "utf-8"), flatten whitespace with.replace(/\s+/g, " ")). Assert withtoContainthat the flattened CSS includes.psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-child. To keep the copy ingutterParaMarkers.test.tsx:28in step with it, either buildGUTTER_GLYPH_SELECTORfrom that same string constant (exported from a small shared test helper) or note in its TSDoc that the new CSS test pins the selector. Add no ticket IDs to any new comment.How this was checked: gutterParaMarkers.test.tsx:28 defines GUTTER_GLYPH_SELECTOR as a hand copy of the per-paragraph part of the rule at packages/platform/src/usj-nodes.css:2752 (
.psc-gutter-markers .para > .marker:not(.verse):not(.chapter):first-child). Nothing in the test file reads usj-nodes.css, and the test runs in jsdom, which does not apply the stylesheet. So an edit to the CSS selector would leave the tests green. packages/platform/src/editor/editor.css.test.ts exists and guards editor.css the same way it is being asked for here: it runs under// @vitest-environment node, reads the file withreadFileSync(new URL("./editor.css", import.meta.url)), whitespace-flattens it and assertstoContainon selector strings. The test file is new in this PR (230 added lines), so the anchor line is changed; usj-nodes.css is untouched. Impact is maintenance only.
- #5: "Fixed. usj-nodes.css.test.ts now pins the gutter rule, and the comment on GUTTER_GLYPH_SELECTOR points to it."
In the paragraph-structure view, an Enter split gives the new paragraph a gutter marker glyph from another ParaNode transform. Depending on plugin registration order that glyph can already be the first child when ParaNodePlugin looks for the leading space the split left, so the space survived. Look past a leading gutter glyph. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re view Mounts the platform Editor in the paragraph-structure view and checks, in the same update, that the gutter shows the right marker after an Enter split (mid-paragraph and at the end), after undoing one, and after a retag from the caret, of an Enter-made paragraph, and of a selected marker. Also checks that a split drops the space it leaves at the new paragraph's start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The paragraph-retag comments predated the gutter view's own glyph and described a glyph-less retag as a bare state change. Name the gutter glyph and the transform that gives a glyph-less paragraph one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Regenerated with nx extract-api. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f5f89c5 to
7c27e32
Compare
irahopkinson
left a comment
There was a problem hiding this comment.
@irahopkinson+AI made 1 comment.
Reviewable status: 0 of 7 files reviewed, 4 unresolved discussions (waiting on katherinejensen00).
a discussion (no related file):
Previously, katherinejensen00 wrote…
Thank you for the review, Ira! I appreciate it :)
Thanks, Katherine! Those all sound right. One thing: the latest push (7c27e32) is only the rebase. I don't see the new tests, the getApplyingUpdateSource check or the CHANGELOG lines in it yet. Could you push them? I'll check each thread once they're in.
…w paragraph - Move a selection point back with the text $removeLeadingSpace trims, so a caret retag with the caret at the end of a paragraph that starts with a space no longer throws. - Skip the trim for a paragraph an applied update creates, so the document stays in step with the ops that were applied. - Pin the gutter-glyph skip in the shared-react ParaNodePlugin tests, and pin the usj-nodes.css gutter rule that the jsdom gutter tests rely on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Oops, that is a new problem. Sorry about that. The changes are pushed now. |
irahopkinson
left a comment
There was a problem hiding this comment.
@irahopkinson+AI made 4 comments and resolved 4 discussions.
Reviewable status: 0 of 11 files reviewed, all discussions resolved.
a discussion (no related file):
Previously, irahopkinson+AI (Agent AI for Ira Hopkinson) wrote…
Thanks, Katherine! Those all sound right. One thing: the latest push (7c27e32) is only the rebase. I don't see the new tests, the getApplyingUpdateSource check or the CHANGELOG lines in it yet. Could you push them? I'll check each thread once they're in.
Thanks for pushing these, Katherine. All four threads check out.
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 38 at r1 (raw file):
Previously, katherinejensen00 wrote…
#1: "Kept the trim and documented it. A caret retag now drops leading spaces in this view, matching formatted and standard. Keeping them would mean telling a retag apart from an Enter, which $setBlocksType gives no signal for. Added a CHANGELOG line and a regression test. Writing that test exposed a crash in the same flow (caret at the end, leading space, style change), which $removeLeadingSpace now handles by moving the caret back."
#3: "Fixed. The trim is skipped while getApplyingUpdateSource(editor) is set. Added a unit test, a platform test going through applyUpdate, and a CHANGELOG entry."
Thanks! Confirmed in 5600e69: the retag trim is documented, the caret now moves back with the trimmed text, and applied updates keep their leading space. Reverting the caret move or the getApplyingUpdateSource check fails the tests you added.
libs/shared-react/src/plugins/usj/ParaNodePlugin.tsx line 40 at r1 (raw file):
Previously, katherinejensen00 wrote…
- #2: "Fixed. Added a gutter-glyph case to ParaNodePlugin.test.tsx; it fails with line 40 reverted."
Thanks! Confirmed: reverting line 40 fails the new gutter-glyph case.
packages/platform/src/editor/gutterParaMarkers.test.tsx line 28 at r1 (raw file):
Previously, katherinejensen00 wrote…
- #5: "Fixed. usj-nodes.css.test.ts now pins the gutter rule, and the comment on GUTTER_GLYPH_SELECTOR points to it."
Thanks! Confirmed: usj-nodes.css.test.ts pins the gutter rule and the GUTTER_GLYPH_SELECTOR comment points to it.
irahopkinson
left a comment
There was a problem hiding this comment.
@irahopkinson made 1 comment.
Reviewable status: 0 of 11 files reviewed, all discussions resolved (waiting on irahopkinson+AI).
Summary
PT-4678: in Simple mode (the paragraph-structure view), a paragraph made with Enter showed its style in the dropdown but not in the gutter, and changing a marker (e.g.
\p→\q) left the old one in the gutter for a while.mainby PT-4540 (b5c29f5, PT-4540: Make a paragraph's gutter marker selectable #22). That change replaced the old transform with$restoreGutterMarkerIfMissing, which gives every new paragraph its gutter glyph in the same update. Before it, Enter gave the new paragraph no glyph, and a\q1split mid-paragraph was demoted to\p. I confirmed this by restoring the old transform: the new tests fail with both symptoms.gutterParaMarkers.test.tsx. It mounts the real<Editor>in the paragraph-structure view and checks the gutter in the same update after:ParaNodePluginruns (that depends on the order the plugins register in), the space a split leaves at the start of the new paragraph was kept.ParaNodePluginnow looks past a leading gutter glyph. Covered by a test and noted in the CHANGELOG.applyParaMarker.utils.tsandEditor.tsxnow mention the gutter glyph.dist/withnx extract-api. The API report is unchanged.Not covered here
formatPara→$applyParaMarker→$syncParaMarkerGlyph) has relabelled the existing glyph in place since late August, and the tests show it updating in the same update. QA: please retest on a build from after Oct 21 (PT-4540) to see whether this still happens and, if so, the exact steps.Test plan
Rebased onto
mainwith PT-4703 (#27).nx test shared-react: 2202 passed, 1 skippednx test @eten-tech-foundation/platform-editor: 3969 passed, 17 skipped,gutterParaMarkers.test.tsx7/7. The full parallel run had 10 timeouts under load, one in each of 10 files. Rerun on their own, all 11 matching files pass (87 tests).ParaNode.updateDOMskipping the marker class, a glyph without the gutter flag, and a glyphupdateDOMthat doesn't write text each make the tests that target them faildist/rebuilt withextract-apias the last step.dist/index.d.tsis the rolled-up form (no barefrom "shared"/"shared-react"imports) and matchesmain; onlyindex.jsand its map change.🤖 Generated with Claude Code
This change is