Skip to content

Feature: Disable Review notes until minimum content threshold is reached#545

Open
coderGtm wants to merge 5 commits into
WordPress:developfrom
coderGtm:feature/review-notes-min-content
Open

Feature: Disable Review notes until minimum content threshold is reached#545
coderGtm wants to merge 5 commits into
WordPress:developfrom
coderGtm:feature/review-notes-min-content

Conversation

@coderGtm
Copy link
Copy Markdown

@coderGtm coderGtm commented May 13, 2026

What?

Closes #390

Adds the same minimum-content gating used by Content Summarization to Review Notes, requiring at least 100 characters before Review Notes can run, making that threshold filterable, and showing descriptive disabled-state text in the editor UI.

Why?

Review Notes could previously be triggered on very short or empty post content, which does not provide enough content for meaningful AI review suggestions.

Content Summarization already avoids this by requiring a minimum amount of content before enabling the feature. This change aligns Review Notes with that existing behavior so users get a more consistent UX across AI editor features, and so Review Notes only becomes available when there is enough content to review.

How?

This PR updates the Review Notes experiment to follow the same enablement pattern as Content Summarization.

Implementation details:

  • Adds a new filter, wpai_review_notes_min_content_length, with a default value of 100
  • Localizes the minimum content length to the editor script as minContentLength
  • Adds shared Review Notes availability logic in the editor based on character count
  • Disables the main Generate Review Notes button when post content is below the threshold
  • Shows descriptive helper text explaining when Review Notes becomes available
  • Disables the single-block Generate Review Note menu action when the post content is below the threshold
  • Prevents short-content posts from triggering Review Notes requests
  • Adds integration test coverage for the default and filtered minimum content length
  • Adds e2e coverage for the disabled/enabled Review Notes states and the single-block disabled state
  • Updates the empty-post e2e scenario to reflect the new minimum-length gating behavior

Use of AI Tools

AI assistance: Yes
Tool(s): GitHub Copilot
Model(s): GPT-5-class model via Copilot
Used for: Implementation guidance, test updates, and PR drafting; final code and description were reviewed and edited by me.

Testing Instructions

  1. Enable Experiments globally in the AI plugin settings.
  2. Enable the Review Notes experiment.
  3. Open a new post in the editor with content shorter than 100 characters.
  4. Open the post settings sidebar.
  5. Confirm the Generate Review Notes button is visible but disabled.
  6. Confirm the helper text says Review Notes will be available at 100 characters.
  7. Add enough content so the post reaches at least 100 characters.
  8. Confirm the Generate Review Notes button becomes enabled.
  9. Select a reviewable block and open the block options menu.
  10. Confirm Generate Review Note is disabled when the post is below the threshold.
  11. Confirm Generate Review Note becomes available once the post content meets the threshold.
  12. Optionally add a filter for wpai_review_notes_min_content_length and verify the threshold changes accordingly.

Screenshots or screencast

Before After
image image
Review Notes could be triggered on empty or very short content. Review Notes is disabled until the post reaches the minimum content length, with descriptive helper text shown.

Changelog Entry

Changed - Require a minimum content length before enabling Review Notes, with a filterable threshold and descriptive editor messaging.

Open WordPress Playground Preview

@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.35%. Comparing base (94f5d40) to head (35adacb).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #545      +/-   ##
=============================================
+ Coverage      71.20%   71.35%   +0.15%     
  Complexity      1150     1150              
=============================================
  Files             67       67              
  Lines           5563     5565       +2     
=============================================
+ Hits            3961     3971      +10     
+ Misses          1602     1594       -8     
Flag Coverage Δ
unit 71.35% <100.00%> (+0.15%) ⬆️

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.

@coderGtm coderGtm marked this pull request as ready for review May 14, 2026 12:44
@github-actions
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: coderGtm <gautam23@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: vishnupprajapat <vishnuprajapat@git.wordpress.org>
Co-authored-by: pcprajapatcms <phoolchandcms@git.wordpress.org>

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

@coderGtm coderGtm changed the title Feature/review notes min content Feature: Disable Review notes until minimum content threshold is reached May 14, 2026
@jeffpaul
Copy link
Copy Markdown
Member

@coderGtm you'll likely want to either branch off #528 or wait for that to get merged in as that changes naming for the feature a good bit and will cause conflicts here

@jeffpaul jeffpaul added this to the 1.0.0 milestone May 14, 2026
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.

Generate Review Notes and Generate Summary options present even with no post content

2 participants