Repository navigation
Add extensibility points to Visual Revisions for 3rd party devs - pave the way for experimentation with Future and Public revisions - #81710
Conversation
Plugins can render next to the selected revision without unlocking private editor selectors. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
|
Screenshot from @sethrubenstein's Slack post:
|
|
Thanks for the initiative; I think this is interesting. A couple of surface thoughts. I think we should avoid the I think the scheduled revision (based on the screenshot) can have controls in the document sidebar summary card, and the "Restore" label can change to "Schedule" or something similar, based on the revision type.
A related read - https://make.wordpress.org/core/2024/09/12/gutenberg-development-practices-and-common-pitfalls/. |
Fair enough; I can pull that out of this PR and rethink how that would work in the interface.
Will do!
🤔 let me think on this one and see if there's a way around a filter for this. Is there a way to hook into the DataViews Timeline view? |
|
FWIW, I’m not suggesting slot fills just for the sake of it. I’m also working on porting our prc-revisions plugin to a feature plugin: https://github.com/pewresearch/wp-feature-future-revisions. I’m hoping to iterate on it to address the needs outlined in these issues: |
I know, but there are some areas where adding SlotFills can make UX worse, which is unfortunate.
@ntsekouras, might have more details for this. |
Keep PluginPostRevisionInfo for sidebar extensibility. Restore the revisions header and timeline autosave badge to their previous implementations. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
|
I’m making a few more tweaks today. I’ve already removed the filter and the other slot fill. On second thought, those additions aren’t necessary for developing this feature as a plugin for future public revisions. All I really need is something in the postcard, with the one slot fill I added remaining. Will update here when ready for another review. |
|
Thanks, @sethrubenstein! As the saying goes, "less is more" 😄 |
|
Hey 👋 I wanted to give you a heads-up since this pull request adds new files containing JSX. #80123 enables an ESLint rule that requires that files containing JSX must use the What you'll need to do: You'll need to rename any new files containing JSX to use the This comment is automated, based on pull requests with recent activity that contain affected |
|
Thanks for the PR @sethrubenstein! The pain point is real, since the plugin slots unmount in revisions mode, but I'm hesitant about adding public slots there in general, while this UI is still iterating. There are also these related issues 1, 2. I think what's missing for me here is a separate issue with the limitations and requests and not a PR directly. Maybe we could gather them in #76785 or a dedicated one. That way we could plan better and address some things separately, because we need to be careful what we make a public API, especially since we want to consolidate the global style revisions too. Also, some of the requests might make sense to be in core directly if they are useful for everyone. For example making some selectors public (like
This is actually being discussed here and while I had a comment more against it, it's for different reasons (filters). Fields addition should be fine. |

What?
Adds public extension point so plugins can render in visual revisions without unlocking private editor selectors.
PluginPostRevisionInfounder the revision post card in the document sidebarThe classic revisions link now consumes
PluginPostRevisionInfoas the first in-tree Fill. Autosave remains the default timeline badge (core/autosave).Why?
Visual revisions swaps the editor chrome and unmounts the usual plugin slots (
PluginDocumentSettingPanel,PluginPostStatusInfo, pinned items, More menu). Plugins that need the selected revision, such as public-version or future-revision UIs, have no supported place to render and no public way to read the active revision id.How?
The slot receives the same
fillProps.contextobject:revisionId: selected revisionrevision: core-data record, ornullwhile loadingrevisionKey:idorwp_idpostId/postType: parent postusePluginPostRevisionInfoContext()builds that object once for the sidebar. Fills may be a node or a function of{ context }.Testing Instructions
revision.phpfor the selected revision.PluginPostRevisionInfowith{ context }function children.context.revisionIdand update when you change revisions.Testing Instructions for Keyboard
Use of AI Tools
This PR was authored with Cursor (Grok 4.6). I reviewed the SlotFill contract, the in-tree classic-link consumer, unit tests, and docs before opening the PR. Additionally I tested the extensibility with our own prc-revisions plugin which adds a ToggleField to the PluginPostRevisionInfo slot to allow editors to mark a revision "public".