Skip to content

Group Editorial Notes and Updates controls in editor sidebar#605

Merged
dkotter merged 11 commits into
WordPress:developfrom
macayu17:fix/601-group-editorial-buttons
May 29, 2026
Merged

Group Editorial Notes and Updates controls in editor sidebar#605
dkotter merged 11 commits into
WordPress:developfrom
macayu17:fix/601-group-editorial-buttons

Conversation

@macayu17

@macayu17 macayu17 commented May 22, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #601

Moves the Content Summarization sidebar control so the Editorial Notes and Editorial Updates controls stay
grouped together in the post editor sidebar.

Why?

The summary action currently appears between Generate Editorial Notes and Apply Editorial Updates. That splits
two related editorial actions and makes the notes/updates flow feel disconnected.

How?

  • Registers the Summarization editor assets on enqueue_block_editor_assets with priority 5 so the Summary control loads before the Editorial Notes and Editorial Updates controls.
  • Keeps the post-editor screen guard so the summary control does not load in unrelated block editor contexts.
  • Adds regression coverage for the Summarization asset hook registration.

Use of AI Tools

AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5.5
Used for: Test updates, and local verification. I reviewed the changes and take responsibility for the final submission.

Testing Instructions

Automated checks run locally:

git diff --check
php -l includes/Experiments/Summarization/Summarization.php
php -l tests/Integration/Includes/Experiments/Summarization/SummarizationTest.php
php vendor/bin/phpcs --standard=phpcs.xml.dist includes/Experiments/Summarization/Summarization.php tests/
Integration/Includes/Experiments/Summarization/SummarizationTest.php
php vendor/bin/phpstan analyse includes/Experiments/Summarization/Summarization.php tests/Integration/Includes/
Experiments/Summarization/SummarizationTest.php --memory-limit=1G --no-progress
php vendor/bin/phpcs --standard=phpcs.xml.dist

Manual verification:

  1. Enable Content Summarization, Editorial Notes, and Editorial Updates.
  2. Open a post in the editor with enough content for summarization.
  3. Generate Editorial Notes so pending notes exist and Apply Editorial Updates is visible.
  4. Confirm Generate Editorial Notes and Apply Editorial Updates are adjacent in the sidebar.
  5. Confirm Generate/Regenerate Summary appears before those controls and still generates or regenerates the summary block.
Open WordPress Playground Preview

Copilot AI review requested due to automatic review settings May 22, 2026 06:19
@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

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 props-bot label.

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: macayu17 <ayushhoff@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

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

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates the Summarization experiment to enqueue its editor assets via the block editor-specific hook instead of the general admin hook, and adds an integration test to prevent regressions.

Changes:

  • Switch asset enqueuing from admin_enqueue_scripts to enqueue_block_editor_assets.
  • Update enqueue_assets() to no longer accept $hook_suffix and to use get_current_screen() for gating.
  • Add an integration test asserting the correct hook usage and ensuring cleanup of registered actions.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
includes/Experiments/Summarization/Summarization.php Moves editor asset loading to the block editor hook and updates the enqueue gate accordingly.
tests/Integration/Includes/Experiments/Summarization/SummarizationTest.php Adds coverage to ensure editor assets are registered on the correct hook (and not on the generic admin hook).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread includes/Experiments/Summarization/Summarization.php Outdated
Comment thread includes/Experiments/Summarization/Summarization.php
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.50%. Comparing base (0a84f42) to head (b13b7fe).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #605      +/-   ##
=============================================
+ Coverage      74.45%   74.50%   +0.04%     
  Complexity      1740     1740              
=============================================
  Files             85       85              
  Lines           7521     7522       +1     
=============================================
+ Hits            5600     5604       +4     
+ Misses          1921     1918       -3     
Flag Coverage Δ
unit 74.50% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffpaul jeffpaul added this to the 1.1.0 milestone May 26, 2026
@jeffpaul

Copy link
Copy Markdown
Member

Testing on Playground and seems the buttons are still separated with the content summarization in between them:

Screenshot 2026-05-26 at 9 51 56 AM

@dkotter dkotter modified the milestones: 1.0.1, 1.1.0 May 26, 2026
@macayu17 macayu17 force-pushed the fix/601-group-editorial-buttons branch from c0b2ed2 to de05781 Compare May 26, 2026 20:24
@macayu17

Copy link
Copy Markdown
Contributor Author

@jeffpaul I have made the changes. Please review them

jeffpaul
jeffpaul previously approved these changes May 28, 2026

@jeffpaul jeffpaul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested well on Playground, thanks!

@jeffpaul jeffpaul requested a review from dkotter May 28, 2026 14:02

@dkotter dkotter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left a few minor comments.

But I'm wondering if this is overcomplicating things? Can we not just change the priority order of the enqueue hooks to ensure the Summarization script is always loaded either first or last? In doing a quick test, seems if I set the priority to 5 on the enqueue_assets hook for Summarization, it always loads before Editorial Notes

Comment thread tests/Integration/Includes/Experiments/Summarization/SummarizationTest.php Outdated
Comment thread tests/Integration/Includes/Experiments/Summarization/SummarizationTest.php Outdated
Comment thread includes/Experiments/Summarization/Summarization.php Outdated
@dkotter dkotter merged commit f435d19 into WordPress:develop May 29, 2026
22 of 23 checks passed
jorgefilipecosta pushed a commit that referenced this pull request Jun 15, 2026
Changed - Ensure the Editorial Notes and Editorial Updates controls stay grouped together in the post editor sidebar

Co-authored-by: macayu17 <ayushhoff@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group the Editorial Notes and Updates buttons

4 participants