test(behavior): SDT right-arrow + shift-right navigation parity (SD-3237/SD-3218)#3561
Conversation
…SD-3237/SD-3218) First consumer of the parity axis helpers (#3558). Two lock-invariant navigation contracts: - inline-right-arrow-trailing: one Right-arrow exits the SDT (caretLocation inside-cc -> after-cc), asserted via caretLocation(). - inline-shift-right-boundary: Shift+Right crosses the boundary character-by-character (selectionScope reaches cc-and-beyond, never whole-content-control), asserted via selectionScope(). No divergence - SuperDoc matches Word. No new contracts, no raw Word data.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6168021323
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| } | ||
|
|
||
| // Crossed into the content (overlaps + extends past the leading edge)... | ||
| expect(scopes).toContain('cc-and-beyond'); |
There was a problem hiding this comment.
Verify the first SDT crossing is not a full-control jump
When a regression makes Shift+ArrowRight jump-select the entire content control while the anchor remains before the SDT (from < range.pos and to === range.nodeEnd), selectionScope() classifies that selection as cc-and-beyond, so this assertion still passes even though the contract says the boundary is crossed character-by-character rather than atomically. Please assert the first cc-and-beyond snapshot stops inside the control, or otherwise capture per-step positions, before accepting this state.
Useful? React with 👍 / 👎.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
First consumer of the parity axis helpers merged in #3558. Two lock-invariant navigation contracts, asserted through the helpers rather than hand-rolled from/to math.
sdt/inline-right-arrow-trailing: one Right-arrow moves the caret from inside the control to just after it -caretLocation(snap, sdt)goesinside-cc->after-ccin a single press.sdt/inline-shift-right-boundary: Shift+Right crosses the leading boundary character-by-character -selectionScopereachescc-and-beyondand neverwhole-content-control, i.e. it does not snap to the whole control as a unit.Both lock-invariant (asserted for unlocked + contentLocked, matching the contracts). No divergence here - SuperDoc matches Word, so no
test.fail. Narrow by design: no new contracts, no capture-script work, no broad refactor; the point is to show the helpers make the next consumer scenario a few readable lines.Verified:
playwright test ...right-arrow-trailing ...shift-right-boundary-> 12 passed across chromium, firefox, webkit.