Repository navigation
Excerpt Generation: Move the generate button into its own document sidebar panel - #1129
ntsekouras wants to merge 2 commits into
Conversation
|
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. |
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| .fill( '' ); | ||
| // Ensure the generated excerpt was written to the post. Checked through | ||
| // the store so the test does not depend on either inspector's excerpt UI. | ||
| expect( |
There was a problem hiding this comment.
E2E checks go through the editor store rather than either inspector's excerpt UI.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1129 +/- ##
==========================================
Coverage 81.62% 81.62%
Complexity 3088 3088
==========================================
Files 129 129
Lines 12300 12300
==========================================
Hits 10040 10040
Misses 2260 2260
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@ntsekouras I haven't looked at the code yet but in reading the PR description and looking at the screen shares, just want to make sure I understand correctly. The new DataForm-based inspector will no longer fire the Are these new DataForm changes coming in WordPress 7.2? Just wanting to understand the priority of making this change, if this is just to support those that may be testing out this new experience in Gutenberg or if we know for sure this will ship in 7.2 and needs addressed prior to that release. Thanks! |
Yes, that's the idea, and For 7.2 we also aim to land the fields API, so an alternative would be to unregister the excerpt field and ai plugin to register it's own. Even with the fields API though in 7.2, the plugin should still support older WP versions for a bit (depends on the number of WP supported versions) and the suggestion in this PR works for both.
They will be part of 7.2. Of course if face issues during beta, there is always the possibility to revert. |
|
@ntsekouras Thanks for the details. @jeffpaul Curious for your thoughts here? This PR changes how excerpt generation is triggered, moving it into it's own sidebar panel. Sounds like we don't have many options here to support WordPress 7.2 but still want to get your eyes on this change. @ntsekouras In testing, one thing I'd suggest is right now the excerpt is generated in the new panel, it's applied in the excerpt section and also shown in the custom panel but there's no way to edit the excerpt in this new panel. I'd suggest one of two approaches here:
|
We could do that, but my rationale was to avoid having two textareas for the same field. IMO this could create more noise and even confusion, especially if users/plugins have removed some fields from the Inspector and the two textareas are visible together. It feels like the functionality here is about generating and not simply editing.
The difference with Meta Description is that there is no core field/panel for that and my above rationale for two controls for the same field isn't possible. The modal approach though you suggest might be a middle-of-the-road one and I can try this one out. |
|
@dkotter I opened an alternative PR with your suggestion to match Meta Description. I think it looks way better than this approach. |
|
Going to close this out in favor of #1139 but we can re-open if that decision changes |
What?
See WordPress/gutenberg#76076
Replaces the two buttons the Excerpt Generation experiment injected into core's excerpt UI with a single "Excerpt generation" panel in the document sidebar, registered via
PluginDocumentSettingPanel.Why?
Gutenberg's DataForm-based inspector (see the linked issue) replaces the post summary and never renders the
__experimentalPluginPostExcerptslot, so the popover button would stop appearing there.Independently of that, relying on a deprecated slot and injecting markup next to core's excerpt field by targeting class names was never a sound integration.
PluginDocumentSettingPanelis the supported extension point and renders below the summary in both inspectors.How?
PluginDocumentSettingPanelreplaces the inline button and the popover fill. It follows core's Excerpt panel preference, so it hides when that panel is disabled or removed.Notes
The new design (showing the notices (warning/success) through
uipackage etc.. is a personal suggestion. This PR could use some design feedback.Testing Instructions
Screenshots or screencast
Before and after, same flow:
excerpt-generation-before-after.mp4
Same flow with the DataForm inspector experiment:
excerpt-generation-dataform-inspector.mp4
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Fable 5.1
Used for: Implementation, e2e tests, docs and changelog drafts; reviewed, directed and edited by me.