Skip to content

test(behavior): SDT right-arrow + shift-right navigation parity (SD-3237/SD-3218)#3561

Merged
caio-pizzol merged 1 commit into
mainfrom
caio/sdt-navigation-parity
May 29, 2026
Merged

test(behavior): SDT right-arrow + shift-right navigation parity (SD-3237/SD-3218)#3561
caio-pizzol merged 1 commit into
mainfrom
caio/sdt-navigation-parity

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

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) goes inside-cc -> after-cc in a single press.
  • sdt/inline-shift-right-boundary: Shift+Right crosses the leading boundary character-by-character - selectionScope reaches cc-and-beyond and never whole-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.

…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.
@caio-pizzol caio-pizzol requested a review from a team as a code owner May 29, 2026 09:39
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 29, 2026

SD-3237

SD-3218

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@caio-pizzol caio-pizzol merged commit 1ee44eb into main May 29, 2026
35 checks passed
@caio-pizzol caio-pizzol deleted the caio/sdt-navigation-parity branch May 29, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants