Skip to content

test: pin sidecar-array patch routing for containers and custom arrays#2980

Merged
christianhg merged 1 commit into
mainfrom
test-sidecar-array-patch-coverage
Jul 20, 2026
Merged

test: pin sidecar-array patch routing for containers and custom arrays#2980
christianhg merged 1 commit into
mainfrom
test-sidecar-array-patch-coverage

Conversation

@christianhg

Copy link
Copy Markdown
Member

Test-only follow-up to #2974. Its suite pins marks/markDefs routing on root-level text blocks; during review the container-nested case was verified by a throwaway probe, and the "does this hold for arrays that aren't marks?" question wasn't pinned at all. This promotes both into the repo.

Five new scenarios in event.patches.sidecar-arrays.test.tsx, all passing against the shipped implementation unchanged:

  • marks insert on a container-nested span, and an annotation toggle (marks + markDefs inserts) on a container-nested block, the case where the "root block" the data patch applies on is the container itself and the block-relative path descends field-generically.
  • marks unset two containers deep (table > row > cell > block > span).
  • insert into a void block object's custom array (image.tags[-1]), a sidecar array that isn't marks/markDefs.
  • unset of an element in a container-owned data array (callout.tags[0]) sitting beside the container's structural child field (content), pinning that the classifier distinguishes the two arrays on the same node.

Beyond documenting the shipped contract, these are the regression net for the planned replacement of the classifier/fallback machinery with field-generic handlers (tracked separately as a follow-up): tests that predate that refactor and pin today's observable behavior. No production code changes, no changeset.

@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portable-text-editor-documentation Ready Ready Preview, Comment Jul 20, 2026 7:02am
portable-text-example-basic Ready Ready Preview, Comment Jul 20, 2026 7:02am
portable-text-playground Ready Ready Preview, Comment Jul 20, 2026 7:02am

Request Review

@changeset-bot

changeset-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d8ce1d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @portabletext/editor

Compared against main (4d775222)

@portabletext/editor

Metric Value vs main (4d77522)
Internal (raw) 802.3 KB -
Internal (gzip) 153.7 KB -
Bundled (raw) 1.41 MB -
Bundled (gzip) 318.0 KB -
Import time 75ms -0ms, -0.3%

@portabletext/editor/behaviors

Metric Value vs main (4d77522)
Internal (raw) 467 B -
Internal (gzip) 207 B -
Bundled (raw) 424 B -
Bundled (gzip) 171 B -
Import time 2ms -0ms, -0.3%

@portabletext/editor/plugins

Metric Value vs main (4d77522)
Internal (raw) 2.7 KB -
Internal (gzip) 894 B -
Bundled (raw) 2.5 KB -
Bundled (gzip) 827 B -
Import time 6ms +0ms, +1.6%

@portabletext/editor/selectors

Metric Value vs main (4d77522)
Internal (raw) 81.2 KB -
Internal (gzip) 14.9 KB -
Bundled (raw) 76.9 KB -
Bundled (gzip) 13.8 KB -
Import time 6ms +0ms, +2.5%

@portabletext/editor/traversal

Metric Value vs main (4d77522)
Internal (raw) 28.1 KB -
Internal (gzip) 5.6 KB -
Bundled (raw) 28.1 KB -
Bundled (gzip) 5.5 KB -
Import time 5ms +0ms, +1.3%

@portabletext/editor/utils

Metric Value vs main (4d77522)
Internal (raw) 29.7 KB -
Internal (gzip) 6.2 KB -
Bundled (raw) 27.4 KB -
Bundled (gzip) 5.9 KB -
Import time 5ms +0ms, +1.9%

🗺️ . · ./behaviors · ./plugins · ./selectors · ./traversal · ./utils · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @portabletext/markdown

Compared against main (4d775222)

Metric Value vs main (4d77522)
Internal (raw) 53.8 KB -
Internal (gzip) 9.8 KB -
Bundled (raw) 348.9 KB -
Bundled (gzip) 96.3 KB -
Import time 31ms +2ms, +8.6%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@christianhg
christianhg force-pushed the test-sidecar-array-patch-coverage branch from 214c374 to 685901c Compare July 20, 2026 06:50
@christianhg
christianhg force-pushed the test-sidecar-array-patch-coverage branch from 685901c to 6d0e943 Compare July 20, 2026 06:53
@christianhg
christianhg force-pushed the test-sidecar-array-patch-coverage branch from 6d0e943 to d06e8e0 Compare July 20, 2026 06:54
@christianhg
christianhg force-pushed the test-sidecar-array-patch-coverage branch from d06e8e0 to 893b2e6 Compare July 20, 2026 06:57
The sidecar-array suite covered `marks`/`markDefs` on root-level text
blocks only. Extend it with the shapes the routing must also handle:
`marks` and `markDefs` on container-nested blocks (one and two container
depths, where the root block the data patch applies on is the container
and the block-relative path descends field-generically), a custom array
on a void block object, and a container-owned data array sitting beside
the container's structural child field. All pass against the shipped
implementation; they exist to hold as the regression net when the
classifier/fallback machinery is replaced by field-generic handlers.
@christianhg
christianhg force-pushed the test-sidecar-array-patch-coverage branch from 893b2e6 to d8ce1d3 Compare July 20, 2026 07:00
@christianhg
christianhg marked this pull request as ready for review July 20, 2026 07:03
@christianhg
christianhg enabled auto-merge (rebase) July 20, 2026 07:03
@christianhg
christianhg merged commit 72d344d into main Jul 20, 2026
17 checks passed
@christianhg
christianhg deleted the test-sidecar-array-patch-coverage branch July 20, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant