Feature: Disable Review notes until minimum content threshold is reached#545
Feature: Disable Review notes until minimum content threshold is reached#545coderGtm wants to merge 9 commits into
Conversation
# Conflicts: # src/experiments/review-notes/hooks/useReviewNotes.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #545 +/- ##
==========================================
Coverage 73.06% 73.07%
Complexity 1731 1731
==========================================
Files 85 85
Lines 7466 7468 +2
==========================================
+ Hits 5455 5457 +2
Misses 2011 2011
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
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. |
# Conflicts: # includes/Experiments/Editorial_Notes/Editorial_Notes.php # src/experiments/editorial-notes/components/EditorialNotesPlugin.tsx
dkotter
left a comment
There was a problem hiding this comment.
Overall this is looking good to me but see my comment here. We are inconsistent right now across this plugin on how we handle minimum content lengths (if at all). I'd prefer we solve this all at once rather than a handful of smaller PRs. So putting this on hold until we figure out the right direction there.
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:
wpai_review_notes_min_content_length, with a default value of100minContentLengthGenerate Review Notesbutton when post content is below the thresholdGenerate Review Notemenu action when the post content is below the thresholdUse 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
Review Notesexperiment.Generate Review Notesbutton is visible but disabled.Generate Review Notesbutton becomes enabled.Generate Review Noteis disabled when the post is below the threshold.Generate Review Notebecomes available once the post content meets the threshold.wpai_review_notes_min_content_lengthand verify the threshold changes accordingly.Screenshots or screencast
Changelog Entry