Skip to content

Status field: Own the rules that clear the date and the password - #87547

Merged
oandregal merged 2 commits into
trunkfrom
update/quick-edit-status-side-effects
Nov 27, 2026
Merged

oandregal merged 2 commits into
trunkfrom
update/quick-edit-status-side-effects

Conversation

@oandregal

@oandregal oandregal commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What?

Removes the status side effects that three forms repeated in their onChange, since the status field already applies them in its setValue:

  • the quick edit modal of the site editor (packages/edit-site/src/components/post-list/quick-edit-modal.tsx);
  • the quick edit modal of the extensible site editor (routes/post-list/quick-edit-modal.tsx);
  • the post summary in the editor's inspector (packages/editor/src/components/sidebar/dataform-post-summary.jsx), which keeps its routing of namespaced edits to their entities.

Related: #87541, which moves another rule of the quick edit modals (the template of the front page and the posts page) into its field. And #85947 (comment)

Why?

The status field in @wordpress/core-fields clears a scheduled post's future date when the post leaves future, and the password when the post becomes private (#86065). The radio control of the field sends every change through setValue, so by the time a form's onChange runs, those edits are already in it. The copies in the forms only duplicated the rule, and could drift from it.

How?

Each onChange now passes the edits on as they come. The forms render the same data the field reads (the record merged with the local edits), so the outcome is the same.

The field compares the date with isInTheFuture() from @wordpress/date, which uses the site's timezone, while the forms compared new Date( date ) > new Date() in the browser's timezone. That only mattered when the field's edits were overridden by the form's, so the field's rule now applies everywhere.

Testing Instructions

Unschedule:

  1. Schedule a page for a date in the future.
  2. In Pages of the site editor, open quick edit for it and set the status to Draft. Press Done: the page is a draft and its date is no longer the scheduled one.
Screen.Recording.2026-11-27.at.12.11.22.mov

Remove password:

  1. Give another page a password. Open quick edit for it and set the status to Private. Press Done: the page is private and has no password.
  2. Repeat steps 2 and 3 in the extensible site editor (with the gutenberg-extensible-site-editor experiment on) and in the inspector of the editor.
    The rules themselves are covered by the unit tests of the field (packages/core-fields/src/test/post-type-supports.jsdom.test.ts).
Screen.Recording.2026-11-27.at.12.12.44.mov

Testing Instructions for Keyboard

No UI changes.

Use of AI Tools

Written with Claude Code (Claude Opus 5.5), reviewed by the author.

oandregal and others added 2 commits November 27, 2026 11:41
The status field's `setValue` already clears a scheduled post's future date
when it leaves `future`, and the password when it becomes `private`. The
quick edit modals of the site editor (v1 and v2) repeated both rules in
their `onChange`, so drop them there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The post summary's `onChange` cleared the future date and the password on
status changes, as the status field's `setValue` already does. Keep only the
routing of namespaced edits to their entities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oandregal oandregal added the [Type] Code Quality Issues or PRs that relate to code quality label Nov 27, 2026
Copilot AI balanced review requested due to automatic review settings November 27, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: oandregal <oandregal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: -130 B (0%)

Total Size: 8.73 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 384 kB -66 B (-0.02%)
build/scripts/editor/index.min.js 575 kB -64 B (-0.01%)

46b9516 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 10fec67 trunk % Change
timeToFirstByte 47.45 ms +5.69% -6.32% 44.55 ms +3.93% -4.38% 6.51%
largestContentfulPaint 78 ms +5.13% -10.26% 68 ms +11.76% -0% 14.71%
lcpMinusTtfb 26.5 ms +24.15% -8.11% 24.15 ms +23.6% -4.76% 9.73%
wpBeforeTemplate 23.46 ms +6.65% -3.71% 22.15 ms +5.96% -2.12% 5.91%
wpTemplate 19.2 ms +4.01% -5.52% 18.46 ms +4.77% -5.85% 4.01%
wpTotal 43.7 ms +3.89% -6.73% 41.1 ms +4.11% -4.74% 6.33%
wpMemoryUsage 7.75 MB +0% -0% 7.72 MB +0% -0% 0.45%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 10fec67 trunk % Change
timeToFirstByte 37.95 ms +6.19% -2.5% 36.2 ms +3.18% -1.8% 4.83%
largestContentfulPaint 68 ms +5.88% -0% 64 ms +3.13% -0% 6.25%
lcpMinusTtfb 30.75 ms +4.23% -3.74% 28.45 ms +5.1% -2.28% 8.08%
wpBeforeTemplate 20.65 ms +6.34% -3.2% 19.42 ms +2.94% -3.09% 6.33%
wpTemplate 14.38 ms +5.98% -5.84% 13.56 ms +2.06% -4.06% 6.05%
wpTotal 34.81 ms +7.5% -2.36% 33.22 ms +1.44% -1.63% 4.79%
wpMemoryUsage 6.44 MB +0% -0% 6.41 MB +0% -0% 0.56%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 10fec67 trunk % Change
mediaProcessingJpeg 350.49 ms +1.18% -0.67% 341.94 ms +0.75% -0.83% 2.5%
mediaProcessingAvif 5112.94 ms +0.23% -0.35% 5005.9 ms +0.46% -0.13% 2.14%
mediaProcessingJpegToAvif 3474.28 ms +0.27% -0.12% 3405.13 ms +0.76% -0.29% 2.03%

media-upload

Metric 10fec67 trunk % Change
jpegUploadProcessing 1470.4 ms +2.04% -0.58% 1444.22 ms +0.96% -0.17% 1.81%
pngUploadProcessing 238.42 ms +2.46% -4.31% 224.59 ms +2.39% -4.03% 6.16%
largeJpegUploadProcessing 1445.43 ms +0.26% -1.11% 1443.51 ms +0.69% -0.84% 0.13%
multipleImageUploadProcessing 1525.66 ms +0.3% -0.21% 1497.51 ms +1.33% -0.12% 1.88%

post-editor

Metric 10fec67 trunk % Change
serverResponse 418.25 ms +3.21% -8.04% 402.04 ms +4.27% -7.86% 4.03%
firstPaint 459.76 ms +1.86% -4.06% 434.81 ms +6.35% -11.78% 5.74%
domContentLoaded 825.81 ms +0.55% -3.29% 806.21 ms +3.67% -1.94% 2.43%
loaded 826.96 ms +0.56% -3.29% 807.06 ms +3.69% -1.91% 2.47%
firstContentfulPaint 463.02 ms +1.14% -4.55% 458.7 ms +6.62% -4.99% 0.94%
firstBlock 2187.5 ms +11.6% -0.44% 2118.43 ms +1.76% -1.07% 3.26%
type 16.58 ms +7.36% -7.36% 17.21 ms +1.69% -10.28% -3.66%
typeWithoutInspector 16.21 ms +3.64% -6.48% 16.35 ms +1.35% -6.73% -0.86%
typeWithTopToolbar 20.88 ms +5.56% -7.38% 22.03 ms +0.82% -12.03% -5.22%
typeContainer 7.66 ms +7.31% -8.62% 8.15 ms +4.66% -11.66% -6.01%
focus 107.86 ms +4.23% -5.59% 102.83 ms +6.66% -2.88% 4.89%
firstFocus 279.54 ms +0% -0% 250.93 ms +0% -0% 11.4%
selectAll 364.94 ms +1.3% -2.59% 372.54 ms +1.73% -4.95% -2.04%
undo 27.26 ms +8.22% -2.71% 28.48 ms +3.02% -6.11% -4.28%
listViewOpen 36.19 ms +8.62% -4.7% 36.72 ms +11.55% -3.54% -1.44%
inserterOpen 39.13 ms +11.01% -1.56% 37.63 ms +10.84% -5.1% 3.99%
inserterHover 11.18 ms +3.58% -10.02% 10.96 ms +4.2% -2.55% 2.01%
inserterSearch 8.56 ms +3.86% -2.69% 8.02 ms +7.11% -5.86% 6.73%
loadPatterns 607.96 ms +2.71% -3.56% 600.08 ms +4.91% -3.6% 1.31%
wpTotal 407.35 ms +3.02% -8.27% 391.08 ms +4.42% -8.01% 4.16%
wpMemoryUsage 14.81 MB +0% -0% 14.76 MB +0% -0% 0.33%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 10fec67 trunk % Change
serverResponse 400.57 ms +0.59% -6.75% 399.87 ms +0.32% -8.24% 0.18%
firstPaint 382.33 ms +14.13% -4.95% 413.58 ms +7.44% -9.92% -7.56%
domContentLoaded 801.05 ms +6.37% -2.04% 803.37 ms +0.28% -2.21% -0.29%
loaded 801.89 ms +6.39% -2.03% 804.1 ms +0.36% -2.19% -0.27%
firstContentfulPaint 439.98 ms +14.01% -2.19% 455.36 ms +2.9% -2.45% -3.38%
firstBlock 2431.1 ms +8.81% -1.67% 2396.82 ms +0.53% -0.61% 1.43%
type 16.06 ms +4.42% -8.72% 16.59 ms +3.44% -9.4% -3.19%
navigate 108.54 ms +6.24% -1.11% 105.93 ms +5.48% -8.77% 2.46%
loadPatterns 1233.11 ms +10.01% -11.75% 1309.77 ms +7.35% -13.63% -5.85%
loadPages 929.18 ms +2.38% -0.82% 918.29 ms +1.92% -1.21% 1.19%
wpTotal 391.64 ms +0.64% -6.92% 390.82 ms +0.34% -8.37% 0.21%
wpMemoryUsage 12.84 MB +0% -0% 12.80 MB +0% -0% 0.28%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

46b9516 Run

🏁 Flaky tests

Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

Should display legacy widgets in /test/e2e/specs/widgets/editing-widgets.spec.js, passed after 1 failed attempt.

46b9516 Run

@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Edit Site /packages/edit-site labels Nov 27, 2026
@oandregal oandregal self-assigned this Nov 27, 2026
@oandregal
oandregal merged commit 18b8369 into trunk Nov 27, 2026
103 checks passed
@oandregal
oandregal deleted the update/quick-edit-status-side-effects branch November 27, 2026 11:14
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Nov 27, 2026
@oandregal oandregal changed the title Quick edit and editor: Leave the status side effects to the status field Status field: Own the rules that clear the date and the password Nov 27, 2026
Vedant-Gandhi pushed a commit to Vedant-Gandhi/gutenberg that referenced this pull request Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Package] Editor /packages/editor [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants