Skip to content

Fill in placeholders in block validation messages - #5161

Merged
chubes4 merged 1 commit into
trunkfrom
fix/fill-block-validator-messages
Oct 16, 2026
Merged

chubes4 merged 1 commit into
trunkfrom
fix/fill-block-validator-messages

Conversation

@chubes4

@chubes4 chubes4 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude (via the Pi coding agent in a Roadie session) found this while comparing Studio Code agent runs, traced it to the code, wrote the change and its test, and ran the verification below. Opened as a draft for human review.

Proposed Changes

  • Gutenberg logs block validation problems as console-style format strings, for example Expected attribute \%s` of value `%s`, saw `%s`., followed by the values. validate_blocks` joined these pieces as they came, so the agent read the template with its placeholders still in it and the values tacked on afterwards.
  • Placeholders are now filled in from the values that follow them, so each issue reads as one sentence.

Before:

Expected attribute `%s` of value `%s`, saw `%s`. class wp-block-heading has-text-color wp-block-heading

After:

Expected attribute `class` of value `wp-block-heading has-text-color`, saw `wp-block-heading`.

Testing Instructions

  • With a site running, call validate_blocks on <!-- wp:heading {"style":{"color":{"text":"#faf8f5"}}} --><h2 class="wp-block-heading" style="color:#faf8f5">Hi</h2><!-- /wp:heading -->. The issue reads like the "After" output above. This was checked against a running site's editor.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@chubes4
chubes4 marked this pull request as ready for review October 16, 2026 20:25
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 777e460 vs trunk

app-size

Metric trunk 777e460 Diff Change
App Size (Mac) 930.72 MB 930.72 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 777e460 Diff Change
load 1178 ms 1145 ms 33 ms ⚪ 0.0%

site-startup

Metric trunk 777e460 Diff Change
siteCreation 8555 ms 8576 ms +21 ms ⚪ 0.0%
siteStartup 5900 ms 5902 ms +2 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@chubes4
chubes4 merged commit 4bf3a5c into trunk Oct 16, 2026
14 checks passed
@chubes4
chubes4 deleted the fix/fill-block-validator-messages branch October 16, 2026 21:03
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.

2 participants