Skip to content

Experiment: Add Suggest Reply experiment#724

Draft
Infinite-Null wants to merge 23 commits into
WordPress:developfrom
Infinite-Null:feat/add-reply-suggestion
Draft

Experiment: Add Suggest Reply experiment#724
Infinite-Null wants to merge 23 commits into
WordPress:developfrom
Infinite-Null:feat/add-reply-suggestion

Conversation

@Infinite-Null

@Infinite-Null Infinite-Null commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Closes: #508

Suggest Reply Experiment

Description

This PR implements the Suggest Reply experiment, which adds an AI-powered "Suggest reply" action to both the Comments admin screen and the Activity dashboard widget.

This feature allows moderators to generate contextual reply suggestions based on the comment's content, the parent post's context, and optional editorial guidelines.

Key Features

  • WP Ability Integration: Registers the ai/reply-suggestion WP Ability which handles the context building and communication with the AI client.
  • Interactive Modal UI:
    • Allows selecting a reply tone (Friendly, Professional, or Casual).
    • Includes a textarea for optional free-text editorial guidelines (e.g. "always mention our support email").
    • Generates and displays the AI suggestion.
  • Quick Actions:
    • Use this reply: Automatically opens the WordPress inline comment reply form, populates it with the generated suggestion, and focuses the textarea.
    • Copy: Includes a transient "Copied!" button to easily grab the text for manual usage.

Testing Instructions

  1. Ensure you have an AI provider connected and enabled in Settings → AI and also Suggest Reply experiment is enabled under Admin Experiments in /wp-admin/options-general.php?page=ai-wp-admin .
  2. Go to the Comments screen in the WordPress admin.
  3. Hover over a comment and click Suggest reply.
  4. Test changing the tone and adding custom guidelines, then click Generate.
  5. Click Use this reply to verify the inline reply form opens and populates correctly.
  6. Click Copy to verify clipboard functionality.
  7. Go to the Dashboard and repeat the tests from the Activity (Recent Comments) widget.

Screenshot/Screencast

Usage

WhatsApp.Video.2026-06-16.at.7.30.39.PM.mp4
Screen.Recording.2026-06-16.at.7.16.22.PM.mov

Error Examples

Screenshot 2026-06-16 at 7 40 05 PM Screenshot 2026-06-16 at 7 41 11 PM Screenshot 2026-06-18 at 5 04 34 PM Open WordPress Playground Preview

@Infinite-Null Infinite-Null marked this pull request as ready for review June 16, 2026 10:50
@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: Infinite-Null <ankitkumarshah@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

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

@Infinite-Null

Copy link
Copy Markdown
Contributor Author

Hi @jeffpaul and @dkotter,

I've completed the implementation for this experiment and updated the flow based on the feedback shared in the issue discussion.

The PR is ready for review. Thank you!

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.54545% with 147 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.01%. Comparing base (77f116e) to head (02e6d3a).
⚠️ Report is 60 commits behind head on develop.

Files with missing lines Patch % Lines
...ludes/Abilities/Suggest_Reply/Reply_Suggestion.php 0.00% 106 Missing ⚠️
...cludes/Experiments/Suggest_Reply/Suggest_Reply.php 15.90% 37 Missing ⚠️
...des/Abilities/Suggest_Reply/system-instruction.php 0.00% 4 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #724      +/-   ##
=============================================
+ Coverage      74.45%   75.01%   +0.56%     
- Complexity      1740     1858     +118     
=============================================
  Files             85       90       +5     
  Lines           7521     7918     +397     
=============================================
+ Hits            5600     5940     +340     
- Misses          1921     1978      +57     
Flag Coverage Δ
unit 75.01% <4.54%> (+0.56%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@Infinite-Null Infinite-Null marked this pull request as draft June 23, 2026 09:07
@Infinite-Null

Infinite-Null commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

I’m marking this PR as draft temporarily to complete the test coverage. The implementation itself is complete; I just need to add the tests and will mark it ready for review again once they’re done.

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.

New Experiment: “Suggest Reply” for Comments and Activity widget

1 participant