Repository navigation
Quick edit: Show frequently edited fields inline - #85775
jameskoster wants to merge 8 commits into
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: +19.9 kB (+0.23%) Total Size: 8.7 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. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
|
Thanks so much for kicking this off, @jameskoster ! A few thoughts and questions:
|
One reason is to avoid overwhelming the panel with lots of text. For example the Parent field (which is not used for most pages, in most situations) includes the following help text:
This is useful, and I wouldn't want to remove it from the UI entirely, but it also doesn't need to permanently be on display imo. It adds a lot of noise an draws attention to a typically irrelevant field.
I'll give this a try.
Yes. I would personally be in favor of using the term "Slug", but previous feedback deemed it too technical. We've flip-flopped on this a few times so probably a detail to unpack separately with all the associated context.
Would you also remove them in the status field on the Pages DataView? My feeling is that we should be consistent; show the icons everywhere to reinforce the association, or show icons nowhere.
I think excerpt only shows on posts currently. There is no bulk edit for posts in the site editor.
I think mainly because bulk editing the title doesn't really make much sense. But perhaps we could show a field when the selection only contains a single item? This would be a different change though so best explored separate.
These are all consistent with trunk, and should be addressed separately. I tend to agree they should all be bulk editable but there's could be a good reason they aren't!
Agree, I'll look into this. |
Hmm, unless it's a bug, I see it in the site editor:
I see it in the block editor as well, in the inspector panel:
Not necessarily; I think they are different surfaces. I'd personally keep the dropdown cleaner, but I don't have a strong opinion.
Yeah, editing the title for a single item only would be the most common action. But as a general rule, I'd keep all fields that aren't unique visible in bulk editing as well, and the title is not unique.
Maybe @jasmussen or @oandregal know why?
Hmm, maybe we can find a way to make it a bit less overwhelming? |
oandregal
left a comment
There was a problem hiding this comment.
Did a first past focusing on implementation. Though I suppose, at this point, you're more interested on the design aspects of this. Feel free to ignore for now.
| * radio group the editor's document sidebar uses, with the icon of each | ||
| * status next to its label, and its description in the list. | ||
| */ | ||
| export function StatusSelectEdit( { |
There was a problem hiding this comment.
I gather this is the Edit component for the status field: it should live in core-fields.
There was a problem hiding this comment.
Moved to core-fields. The status field now ships its own Edit: radios by default (so the editor sidebar is unchanged) and a compact select when the form asks for it via a new form-field config option ({ id: 'status', config: { compact: true } }). Trash is never offered as a choice. Both route-level copies are gone.
| const fieldsWithRegularLayout = [ | ||
| 'status', | ||
| 'slug', | ||
| 'author', | ||
| 'template', | ||
| 'excerpt', | ||
| ]; |
There was a problem hiding this comment.
Note that we've landed new APIs for extenders to add/update/remove fields and actions for entities in WordPress 7.2. It's through those APIs (core-fields, core-actions packages + view config endpoint) and the view config that we need to make changes going forward.
This info (whether fields are displayed using the regular panel) should live in the view config endpoint. That's what allow us to build a coherent experience (be shared across editor inspector, site editor v1 and site editor v2) as well as offer extensibility for 3rd parties.
There was a problem hiding this comment.
Agreed, done. The view config endpoint now returns a quick_edit_form next to form (compat 7.3), and both drawers only split it by layout type: regular fields inline, panels pinned below. All the hardcoded field lists, the password reordering, the scheduled-date removal and the status override are gone from the client. Extenders filter it through get_entity_view_config_* just like form. Post types with their own form get no default and the drawer falls back to form. One thing I'd like your eyes on: Gutenberg_View_Config_Data checks keys against self::CONFIG_KEYS, so I added the new key to the 7.1 class (with @since 7.3.0) rather than subclassing. Happy to change that if you'd prefer another approach.
| padding-top: $grid-unit-20; | ||
| // Password is a field of its own in the quick edit form, so drop the divider | ||
| // the editor's document sidebar draws above it inside the status group. | ||
| .dataviews-action-modal__quick-edit .fields-controls__password { |
There was a problem hiding this comment.
I wonder if we're ready to move this style to core-fields.
There was a problem hiding this comment.
Rather than moving it, I removed the divider altogether: the editor sidebar rule (the #75916 TODO) and the drawer overrides are gone, and the core-fields password module only resets the fieldset defaults now.
|
|
||
| const fieldsWithBulkEditSupport = [ 'status', 'date', 'author', 'discussion' ]; | ||
|
|
||
| /* |
There was a problem hiding this comment.
I'm ignoring the implementation for site editor v2 in this 1st round of review, as it's not important for WordPress 7.2 beta (not becoming stable), but the same comments I mentioned about core-fields, core-actions and view config APIs apply.
There was a problem hiding this comment.
Same changes applied to v2: it reads quick_edit_form, uses the core-fields status Edit, and has no route-level field logic left.
APIs for extending (add/update/remove) fields and actions from PHP landed and will be released with WordPress 7.2. We also have the View Config API since 7.1 (also PHP), which is about providing the form and view configs (for DataForm and DataViews, respectively). I touched on this on my review. |
|
After my first pass at this the key question I have is: is this something we aim to get ready for WordPress 7.2 (for context, we're past beta 2)? Does revisiting how fields look and are interacted with impact the plans to make the DataForm-driven inspector stable for 7.2 (what I'm looking at here)? |
|
re: why some fields are not bulk editable. Not all of them are because it may not make sense (e.g., title, feature image) and fields need to support working with multiple records. It seems How a field declares it's bulk editable is something we need to improve. We have an allowlist of editable fields, but this doesn't scale to fields added by extender (they won't be bulk editable by default). A potential solution is that fields declare if they can be bulk editable, like actions do. |
|
@jay, I explored some of the things I mentioned above in a prototype: https://dataviews-panel-vs-drawer.space.fast/?screen=pages&editView=drawer&plugins=three. Please ignore that it’s in wp-admin and focus on the drawer. 🙏
pages-drawer.mp4 |
I don't think it's urgent. @verofasulo yeah the date field is a bit weird. Iirc it's meaning changes based on status. For drafts it's 'last modified' but for published content it's the publish date. This makes bulk editing the date create some unpredictable results. Maybe it should be conditional; you can only bulk edit the date if the selection contains content with the same status? It's a bit opaque, but probably better than allowing folks to mistakenly publish a bunch of drafts..? I've said for a while that modified date and published date could probably be separate datapoints, but that's a bigger change.
I don't love panels that contain only a single field. We might as well use the As it stands I do feel the need to point out that this is basically what I was suggesting originally (use I'm still unconvinced about bulk editing the title. I can't think of a single case where you'd want posts/pages/media etc. to have the exact same title :p |
297e871 to
2b6a7f6
Compare
|
@oandregal thanks for the review! To clarify the target: this is aimed at 7.3, not 7.2, so it shouldn't affect the plan to make the DataForm-driven inspector stable for 7.2. The editor sidebar is untouched apart from dropping the password divider. On extensibility: the drawer layout now lives in the view config ( On bulk editing: thanks for #85947. Whichever PR lands second can rebase; the drawer still filters by the bulk allowlist. I agree fields should declare bulk support like actions do, but I'd keep that out of scope here. |
|
@verofasulo I think there's plenty still to do here, but would consider these follow-up territory:
I figured out the excerpt was missing for you because it is not registered for pages by default (only posts). Plugins (commonly Jetpack) add excerpt support to pages, but it's not stock behavior. |
|
Any thoughts on this @WordPress/gutenberg-design ? |
1928cc4 to
114d90a
Compare
|
Thanks for looking. I updated to use a narrower width token for the drawer, and fixed the author input. Screenshot in the PR description updated. |
|
Open to trying compact inputs separately 👍 One thing I noticed in your last screenshot that looks a little odd is the Template field. Presumably there's no field there because there's no template to swap to, but I wonder if we should still show the select, disabled. I'd appreciate input from @oandregal on this. |
Opening the quick edit drawer is already the choice to edit, so Status, Password, Link, Author, Template and Excerpt now render their controls inline. Fields that are edited less often keep their panels, pinned to the bottom of the drawer above the buttons. - Status and Author use the UI SelectControl, with an icon per status and an avatar per author. - Password is a field of its own. - The Link field drops its description, Learn more link and permalink preview. - The parent explanation moves below the control as help text. Applies to the site editor and the extensible site editor. See #84391 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The Link field shows the full permalink below the slug input. - The scheduled date is left out of the quick edit drawer, since the Date panel edits the same date. - The password moves into the panel group, as it is rarely set. Its panel summarises whether the post is protected, without revealing the password. - The inline fields get more space above the panel group's border. Applies to the site editor and the extensible site editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
The copy button is a minimal, neutral, compact `IconButton` labelled "Copy". It swaps its icon for a check, or an error icon if copying fails, for two seconds, and announces the result with `speak()`. It no longer shows a snackbar, since the button stays visible. See https://wordpress.github.io/gutenberg/?path=/docs/design-system-patterns-copy-to-clipboard--docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Applies to the site editor and the extensible site editor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
- Add a `quick_edit_form` to the view config (compat 7.3), with a default for post types using the default form, and read it in both drawers, which now only split fields by layout type. - Let a DataForm form field pass settings to its control through `config`. - Move the status Edit to core-fields: radios by default, a compact select when the form asks for it, and no Trash choice. - Remove the password divider from the editor sidebar and the drawers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Narrow the quick edit drawer from 400px to the 320px small surface width token, closer to the editor inspector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Show the avatar in the author control with the shared AuthorAvatar, like the author view, so the default avatar shown for an author without a Gravatar is no longer rendered at its full size. Space it from the name like the view. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stop marking the template field read-only in the quick edit drawers. Inline, a read-only field shows as plain text; the template control already disables its select on the front page and the posts page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1535e0f to
ba03d6f
Compare











What?
See #84391
The quick edit drawer now shows the fields people edit most as inline controls. The rest keep their panels and are pinned to the bottom of the drawer, just above Cancel and Done.
This targets WordPress 7.3. The post editor's document sidebar is unchanged, apart from the Author, Link and Password improvements below and the removal of the divider above Password.
Why?
Opening the quick edit drawer is already a choice to edit. With every field in a panel, each change takes a second click to reveal the control, which makes quick edit slower than it should be. The issue covers this along with other bulk edit ideas; this PR only addresses that extra click.
How?
quick_edit_formnext toform(compat 7.3), so the drawer layout is shared by both site editors and extenders can change it with the sameget_entity_view_config_*filters they use forform.regularlayout (label on top), and keeps Date, Discussion, Password, Parent, Format and Revisions as panels.Gutenberg_View_Config_Data::CONFIG_KEYSgains the new key, with an@since 7.3.0note: the class checks keys againstself::CONFIG_KEYS, so a 7.3 subclass couldn't extend it.onChange: regular fields in the scrolling area, panels in a pinned area above the buttons. There is no field-specific logic left in the drawers.config: a form field can pass settings to its field'sEditcontrol through a newconfigproperty, merged over the field's own edit config, e.g.{ id: 'status', config: { compact: true } }. It works in the regular and panel layouts.Edit. It renders radios (RadioGroupControlfrom@wordpress/ui) by default, so the sidebar keeps its radios, and aSelectControlwith a 16px icon and a description for each status when the form passescompact, as the drawer's form does. Trash is never offered as a choice.renderin core-fields summarises it as "Protected" or "None", so the panel row never shows the password. Data views that show the password column get the same summary. The divider above Password in the sidebar is removed.SelectControlfrom@wordpress/uiwith each author's avatar, shown with the sameAuthorAvataras the author view, so the default avatar of an author without a Gravatar is sized like the others. This is a newEditin core-fields, so the sidebar's Author panel uses it too.details, below the slug. The copy button follows the Copy to Clipboard pattern: a minimal, neutral, compactIconButtonlabelled "Copy" that swaps to a check (or an error icon) for two seconds and announces the result withspeak(), instead of showing a snackbar. These changes also apply to the sidebar's Link panel.--wpds-dimension-surface-width-sm, 320px) instead of 400px, so it is closer to the editor's sidebar. It keepsModal's padding.@wordpress/themetokens, with 16px of space above it so the inline fields don't sit against the border when they scroll.packages/edit-site) and the extensible site editor (routes/post-list). The latter now depends on@wordpress/ui.config; e2e specs updated for the new controls, and the view config extensibility spec now filtersquick_edit_form.For reviewers
IconButtonfrom@wordpress/uiis marked "use with caution", and@wordpress/use-recommended-componentsflags it outside experimental code. The slug field has a one-line exception because the Copy to Clipboard pattern specifies it. If that isn't acceptable in core-fields yet, the fallback is the@wordpress/componentsbutton with the same icon swap and announcement.@wordpress/notices, but the dependency is still declared. Removing it would also touchpackage-lock.json, so it is left for a follow-up.templateandparentfields are bulk editable #85947 adds Template and Parent; whichever PR lands second rebases. Letting fields declare bulk support is out of scope here.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Use of AI Tools
This PR was written with Claude Code (Claude Opus 5.5), with direction and design review from me. I have reviewed the changes and tested them in the site editor.