Repository navigation
Core fields: Restore the previous Publish and Status panel date behaviour - #86065
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +2.34 kB (+0.03%) Total Size: 8.6 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome 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 insert content using the global inserter in does not select blocks in the canvas preview when editing from the sidebar in
|
|
cc @verofasulo |
| Edit: DateEdit, | ||
| // A cleared control gives `undefined`, which a save drops, so send `null`: | ||
| // the REST API resets the date on `null`. | ||
| setValue: ( { value } ) => ( { date: value ?? null } ), |
There was a problem hiding this comment.
Coming from #76076 (comment)
This would be the only thing we'd need to "clear" the date and respect "floating dates". However, this made it obvious how painful it was to clear (have to open the native control, etc.). It wasn't a great experience. We need to iterate on the default datetime control but it doesn't need to be tied to the 7.2 schedule. The rest of the PR is about changing the UI to a custom one.
|
To make sure I follow, one of the main reasons we are reverting is the lack of dedicated date and time inputs (see #82177 ) ? (cc @WordPress/gutenberg-components ) |
|
Feels reasonable, and it relates also to #81806, which we wouldn't want to regress, i.e. we should not bring the heading back to the panel title in the pre-publish state. The bigger difference in 81806 is that I used a "Now" label, and put it before the calendar, which would then grey out if it's today. To note, we reverted that to no button through the PR, but the initial image still shows it. |
It's a bit of a few things:
All compounded, it presents an experience that is worse than we have today. Given the time-constraints, I thought we'd maintain an UI similar to the existing while we iterate on the new one. Some direction for the new datetime experience could be along the lines of 1) all actions (including reset) are available in the popup without a secondary click and 2) we don't have two components to change the same behavior (e.g., date calendar). |
Agree. I've noticed that component and designed this to match it. Not right now, but I wonder if the components of the pre-publish panel can also reuse what we have in the inspector and quick edit. |
198d2de to
169b7b8
Compare
| @@ -10,4 +11,8 @@ export const fieldExtensions: FieldsScriptParts< PostWithDate >[ string ] = { | |||
| // Only the users who can publish the post see the control. | |||
| isVisible: ( item ) => hasActionLink( item, 'wp:action-publish' ), | |||
| render: DateView, | |||
There was a problem hiding this comment.
In WordPress 7.1, clicking "Now" in the Publish popover makes the summary show "Immediately" for a draft, because getPostScheduleLabel() returns it when ! date || isEditedPostDateFloating(). With this PR, clicking Reset doesn't do that: DateView has no floating case, so a draft shows "Modified: …" with the current time (getDate( null ) returns now).
Since view.tsx isn't part of the diff, I can't leave a suggestion there. How about using the isDateFloating() helper this PR adds at the top of DateView?
import type { PostWithDate } from './types';
+import { isDateFloating } from './is-date-floating';
...
const DateView = ( { item }: { item: PostWithDate } ) => {
+ if ( isDateFloating( item ) ) {
+ return __( 'Immediately' );
+ }
+
const isDraftOrPrivate = [ 'draft', 'private' ].includes(There was a problem hiding this comment.
I've pushed some changes to improve floating dates and the ability to reset. I'll do a second review.
In WordPress 7.1, clicking "Now" in the Publish popover makes the summary show "Immediately" for a draft
The problem with doing this is that "Immediately" would also be displayed in DataViews lists (e.g., in a table cell), where it is not obvious what it means.
There was a problem hiding this comment.
I think this matters even more for scheduled posts. In 7.1, clicking "Now" on a scheduled post made the summary show "Immediately", and saving published the post right away. With this PR Reset gives the same result on save, but the summary still says "Scheduled" with the current time and the note says "Changes to the time you save.", so only the pre-publish panel hints that the post will go live. Since the note only shows where the date is edited and not in the list cells, what do you think of saying "Publishes when you save." there when the saved status is future? It would avoid the problem of "Immediately" showing in table cells.
| // Only the users who can publish the post see the control. | ||
| isVisible: ( item ) => hasActionLink( item, 'wp:action-publish' ), | ||
| render: DateView, | ||
| Edit: DateEdit, |
There was a problem hiding this comment.
DataViews reuses field.Edit for filters, so this custom control now also appears in the Date filter of the Pages list. There, the DateTimePicker is wider than the filter popover and overflows horizontally, and the Reset button shows up even though it means nothing for a filter.
Could the custom control be limited to the form?
There was a problem hiding this comment.
I've made the filter popover grow to fit a custom control at b5469d8 (I'm stress testing this change)
There was a problem hiding this comment.
I've followed up on this, added a new story and checked a few scenarios. I've also tested our usage and haven't run into anything weird:
Screen.Recording.2026-11-03.at.16.53.08.mov
|
@oandregal gotcha, sounds more like an integration task than a lack of individual DS componentry. I'm still planning on working on date and time inputs soon, hoping it may help, too. Please be in touch if you have any further DS feedback! |
e78b24d to
e35f938
Compare
e35f938 to
e8800f1
Compare
…mediately A scheduled post whose date is reset or in the past goes public when it is saved, just as a floating draft does when it is published. Both now show the same note, "Publishes immediately.", instead of two wordings for the same outcome. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hes immediately The note under the date picker now shows only when the edited status is scheduled and the date is reset, floating, or in the past. Drafts and published posts get no note, and a draft scheduled in the same form but not saved yet gets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
So that the scheduled date control can share them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native datetime input could be cleared, which left an empty field. The new control has the date and time inputs of the date picker, without its calendar or a way to clear them, and says when the post publishes immediately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
984cba1 to
a320d14
Compare
WordPress Core copies their PHP files from the Gutenberg build in its `copy:gutenberg-php` Grunt task, like the block library, so a change to them reaches Core with the next package update and needs no backport PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
There was a conflict while trying to cherry-pick the commit to the wp/7.2 branch. Please resolve the conflict manually and create a PR to the wp/7.2 branch. PRs to wp/7.2 are similar to PRs to trunk, but you should base your PR on the wp/7.2 branch instead of trunk. |
|
Manual backport at #86295 |
…iour (#86065) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iour (#86065) (#86295) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. Built from https://develop.svn.wordpress.org/trunk@65379 git-svn-id: http://core.svn.wordpress.org/trunk@64518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `editor__schedule` spec failed on Gutenberg edge Simple sites, which run Gutenberg 24.5.0-rc.1, timing out while setting the publish date. WordPress/gutenberg#86065, first shipped in 24.5, put the post Date field back on the `DateTimePicker`, rendered inside the post summary's DataForm dropdown instead of the old `.editor-post-schedule__dialog` popover. `setScheduleDetails` waited for either the single `datetime-local` input of earlier DataForm builds or the picker's fields inside that popover, and found neither. The picker's fields are now looked up under `.components-datetime`, the `DateTimePicker` root, which renders in both the old popover and the new dropdown.
This updates the pinned commit hash of the Gutenberg repository from `c035c1a649ef68f5c1646694cf440df1d7ae6e62` to `1b0dc90c700746b108e080263a4dc67707b750a1` (fixes cherry-picked to the `wp/7.2` branch). A full list of changes included in this commit can be found on GitHub: WordPress/gutenberg@c035c1a...1b0dc90 - [WP 7.2] Components, UI: Use focus-visible for disabled item focus rings (WordPress/gutenberg#86269) - Notes: Keep the canvas still when a new note is added (WordPress/gutenberg#86283) (#86293) - Post summary: Show placeholders for an empty excerpt and a missing author (WordPress/gutenberg#85842) (#86294) - Core fields: Restore the previous Publish and Status panel date behaviour (WordPress/gutenberg#86065) (#86295) - Interactivity API: Show the data-wp-html fallback on created elements under Trusted Types (WordPress/gutenberg#84924) (#86306) - [WP 7.2] UI: Add LoadingIndicator to item popups (WordPress/gutenberg#86303) - Interactivity Router: Fix nested router regions without data-wp-interactive disappearing on navigation (WordPress/gutenberg#86061) (#86308) - Interactivity API: Run watch() cleanups and attachTo render callbacks without a directive scope (WordPress/gutenberg#86058) (#86311) - DataForm: Fix clipped focus ring of field values in panel layout (WordPress/gutenberg#86361) (#86369) - Tests: Avoid passing an object when invoking static methods via reflection. (WordPress/gutenberg#86329) - [WP 7.2] DropdownMenu: Invert the selected item indicator while highlighted (WordPress/gutenberg#86379) - Fields: Lowercase the (no excerpt), (no author) and (no description) placeholders (WordPress/gutenberg#86391) (#86424) - Core fields: Decode non-Latin slugs in the slug field (WordPress/gutenberg#86359) - Interactivity API: Show the new page's server content in kept data-wp-html elements (WordPress/gutenberg#86416) - DataForm: Tighten value density in the panel layout (WordPress/gutenberg#86389) (#86426) - Post summary: Show "Immediately" and relative publish dates in the Date row (WordPress/gutenberg#86367) - [WP 7.2] Block Styles: Show the active style variation in forced colors mode (WordPress/gutenberg#86450) - Site Editor: Fix the frame snapping to the mobile width when resized with the mouse (WordPress/gutenberg#86423) - Image: measure the lightbox container, not the image's parent (WordPress/gutenberg#82312) (#85491) - URL: Decode percent-encoded characters in getFilename (WordPress/gutenberg#86422) (#86477) - Fix: Hide the author avatar when the site does not show avatars and frame a blank one. (WordPress/gutenberg#86395) - Date picker: Mark the posts of the month a typed or reset date moves to (WordPress/gutenberg#86298) (#86463) - Fix iOS 27 tap into a heading leaving the caret in a quote (WordPress/gutenberg#85809) - Hand focus back to the field on a press in every browser (WordPress/gutenberg#86549) - Prevent jobs from running within forks on `push`. (WordPress/gutenberg#85968) - i18n: Add translator context to the "Copy error" button label (WordPress/gutenberg#85967) - Bubble editor canvas events to the outer iframe (WordPress/gutenberg#85263) - UI: Use LoadingIndicator in remaining popup consumers (WordPress/gutenberg#86501) - Block Editor: Keep the revision canvas read-only in preview mode (WordPress/gutenberg#84578) - Core Data: Rank an exact title match first among tied link suggestions (WordPress/gutenberg#86327) - Tests: Render the router-html-server context case through state (WordPress/gutenberg#86511) - iOS tests: De-flake the selection handle test (WordPress/gutenberg#85461) Props mamaduka, wildworks. See #66340. git-svn-id: https://develop.svn.wordpress.org/trunk@65379 602fd350-edb4-49c9-b593-d223f7449a82
…iour (WordPress#86065) Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>

What?
Follow up to #85081.
Brings back a way to reset the post date in the DataForm-based inspector, and edits the date with the same picker the previous Publish panel used. The Scheduled Date control in the Status panel gets the picker's date and time inputs, so it can no longer be cleared. It also brings back what the previous Status panel did to the date and password when the status changes, and lets a DataViews filter popover grow to fit a custom control such as this picker.
Why?
See #76076 (comment)
How?
nullwhen the date is cleared. Thedateandscheduled_datefields map an empty value tonull. The REST API resets the date onnull: a draft floats again (publishes immediately), and a published post takes the time it is saved. This is what the previous picker's Reset sent.Editfor thedatefield (packages/core-fields/src/post_type_supports/date/edit.tsx): theDateTimePickerfrom@wordpress/components, configured like the previous Publish panel (site time format for 12/24 hours, translated date order, start of week, and dots on the days of other published or scheduled posts of the same type), followed by a full-width Reset button.nulland announces "Publish date set to now." to screen readers. It is enabled whenever the post has a date, including a draft whose date floats. Once the date isnullit is disabled, but stays focusable, so focus doesn't drop when it is pressed.nullor equal to its modified date), or is in the past. As the editor does, a date less than a minute ahead counts as now (is-published-on-save.ts). The status checked is the edited one, so a draft scheduled in the same form gets the note before it is saved; whether the date floats checks the saved status, asisEditedPostDateFloating()does (is-date-floating.ts). Drafts and published posts get no note.operatorto the control), the Reset button, notes, and announcements are left out: the date a filter compares against isn't the post's date.Editfor thescheduled_datefield (packages/core-fields/src/post_type_supports/scheduled_date/edit.tsx), shown in the Status panel of a scheduled post. It replaces the native datetime input, which could be cleared and left an empty field, with the date and time inputs of the picker (TimePicker), without its calendar or a way to clear them. It shows the same "Publishes immediately." note as the date picker. The date helpers move to their own files (is-12-hour-time.ts,is-date-floating.ts,is-published-on-save.ts) so both controls share them.statusfield'ssetValuesets the date tonullwhen a scheduled post with a future date gets another status, and clears the password of a post made private, as the previous Status panel'shandleStatusdid.dataviews-filters/style.scss): a popover holding an input control now takes the control's narrowest width (at least 230px, no maximum) instead of being capped at 250px. The filter name and help text don't count toward that width (contain: inline-size), so they still wrap or truncate. A new "Filter Popover" Storybook story shows the cases: help text, a long name, a custom control that wraps, a custom control with a fixed width, and a list filter with a long element label.@wordpress/a11yas a dependency of@wordpress/core-fieldsfor the announcements..github/workflows/check-backport-changelog.yml): skips thecore-actionsandcore-fieldspackages. WordPress Core copies their PHP files from the Gutenberg build (copy:gutenberg-php), like the block library, so a change to them reaches Core with the next package update and needs no backport PR.The fields are shared, so the extensible site editor gets the same control.
Not in this PR: the previous popover had a "Now" action in its header. The DataForm dropdown header only takes a title and a close button, so that would need a change to
@wordpress/dataviews.Tests:
date-edit.jsdom.test.tsxcovers the Reset value, its disabled state, when the note shows (reset, floating, past and future dates, and a status changed but not saved, with a stand-incorestore), and the announcements in a post and in a filter.scheduled-date-edit.jsdom.test.tsxcovers the inputs of the Scheduled Date control, its value, and its note.post-type-supports.jsdom.test.tscovers thenullvalue of a cleareddateandscheduled_date, and the status side effects.Testing Instructions
/wp/v2/posts/<id>?context=edit)dateequalsmodified. A draft shows no note.npm run storybook:devand open "Design System / DataViews / DataViews / Filter Popover". Open each filter: the popover fits its content, help text wraps, and a long filter name is truncated on one line.Testing Instructions for Keyboard
Screenshots or screencast
Scheduled Date, in the Status panel of a scheduled post: the date and time inputs replace the native datetime input, without a calendar or a way to clear them.
Use of AI Tools
Claude Code was used to investigate the issue, write the changes and tests, check them in the editor, and draft this description. I reviewed the changes.