Page MenuHomePhabricator

Create a minimal implementation for the Revise Tone Suggested Edits task type
Closed, ResolvedPublic5 Estimated Story Points

Assigned To
Authored By
Michael
Aug 5 2025, 1:32 PM
Referenced Files
F66753675: screenshot 266.png
Oct 16 2025, 3:22 AM
F66753673: screenshot 265.png
Oct 16 2025, 3:22 AM
F66753671: screenshot 264.png
Oct 16 2025, 3:22 AM
F66753669: screenshot 263.png
Oct 16 2025, 3:22 AM
F66753667: screenshot 262.png
Oct 16 2025, 3:22 AM
F66753665: screenshot 261.png
Oct 16 2025, 3:22 AM
F66753663: screenshot 260.png
Oct 16 2025, 3:22 AM
F66753661: screenshot 259.png
Oct 16 2025, 3:22 AM

Description

Feature flagged behind T401192: Create a Feature Flag for Improve Tone Suggested Edits, we want to get started with a bare-bones implementation of the new task type.

Acceptance criteria:

  • all copy should be drafts and not final (no translations yet)
  • for now, it should search for a short list of (hard-coded?) templates in that TaskTypeHandler, similar to TemplateBasedTaskTypeHandler::getSearchTerm
    • this should have a FIXME comment to change it for a weighted tag
  • it should be Easy difficulty, and enabled by default
  • After clicking on a task, VE should load directly into a full-page edit-session
  • for now: no onboarding (will be investigated in a different task)
  • once VE opened, if T400335 and T401185 are not done yet, just alert the payload, otherwise trigger the Tone Edit Check

Event Timeline

Change #1181721 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] [WIP/POC]: minimal Improve Tone task type

https://gerrit.wikimedia.org/r/1181721

KStoller-WMF set the point value for this task to 5.Aug 25 2025, 4:14 PM

There is now a patch-demo for this available: https://0f3c3297c9.catalyst.wmcloud.org

Obviously, much still needs doing, but the skeleton stands, I think. High-level feedback for my change welcome: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/GrowthExperiments/+/1181721

Change #1181721 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] feat: minimal Improve Tone task type

https://gerrit.wikimedia.org/r/1181721

Next steps:

Change #1191710 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] feat(ReviseTone): Show Tone Check

https://gerrit.wikimedia.org/r/1191710

Change #1184506 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/GrowthExperiments@master] tests: add Cypress test for ReviseTone and showing the ToneCheck

https://gerrit.wikimedia.org/r/1184506

Change #1191710 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] feat(ReviseTone): Show Tone Check

https://gerrit.wikimedia.org/r/1191710

Change #1184506 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] tests: add Cypress test for ReviseTone and showing the ToneCheck

https://gerrit.wikimedia.org/r/1184506

NOTE: This hasn't been tested yet. The details below may change and be updated during test execution.

Requirement

Implement a minimal “Improve Tone / Revise Tone” Structured Task within the Suggested Edits framework. The task should:

  • Be feature-flagged behind the “Improve Tone Suggested Edits” flag
  • Present a UI interface in Suggested Edits / VE for selecting a sentence with non-neutral tone
  • Show guidance / templates (hard-coded or minimal) for improving tone
  • Launch VE editing on the selected sentence
  • Allow the user to apply the edited version, and reflect updates in UI
  • Support the “Movement Communications / Improve Tone” variant (T399982) under the same flow

Note: This QA includes testing for T399982 (Movement Communications: Improve Tone Structured Task).

BDD

Feature: Revise Tone / Improve Tone Structured Task  

Scenario: Basic flow of Improve Tone suggestion  
  Given the Improve Tone feature flag is enabled  
  And a user opens a Suggested Edits task with a non-neutral sentence  
  When the user clicks the “Improve Tone” task  
  Then they should see highlighting / guidance on non-neutral wording  
  And clicking “Edit” opens VE with that sentence in focus  
  And after editing, the revised text is applied and UI updates  

Scenario: Guidance templates display  
  Given the user is on the Improve Tone UI  
  When suggestions are shown  
  Then the user should see a small list of hard-coded templates / guidance  

Scenario: Movement Communications variant  
  Given the task is triggered under the “Movement Communications / Improve Tone” context  
  When the user runs the flow  
  Then the behavior should mirror the general Improve Tone flow

Test Result

Status: ✅ PASS / ❓ Need More Info / ❌ FAIL
Environment: beta/testwiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary / Safari / Firefox (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Basic Improve Tone flow

  1. Enable the Improve Tone feature flag
  2. Create or open content with non-neutral wording
  3. Trigger the Improve Tone task
  4. Verify the UI highlights non-neutral wording and shows guidance
  5. Click “Edit” → confirm VE loads the sentence
  6. Apply a revision → submit
  7. Confirm the change is reflected
  8. ✅ ⬜ ❌ ❓ AC1: Edit flow works

Test Case 2: Guidance / template display

  1. In the Improve Tone UI, view guidance section
  2. Confirm templates / suggestions are shown
  3. ✅ ⬜ ❌ ❓ AC2: Guidance templates appear

Test Case 3: Movement Communications variant

  1. Trigger the variant under the Movement Communications context
  2. Walk through the same flow (highlight, edit, submit)
  3. Confirm behavior matches general case
  4. ✅ ⬜ ❌ ❓ AC3: Movement Communications variant is supported

Thanks for the draft of a test plan! I slightly adapted the first BDD

Scenario: Basic flow of Revise Tone suggestion  
  Given the Revise Tone feature flag is enabled  
  And a user opens a Suggested Edits task with a non-neutral sentence  
  When the user clicks the “Revise Tone” task  
  Then VE opens with a sentence with non-neutral wording in focus  
  And they should see a dialog / guidance on non-neutral wording  
  And after editing, the revised text is applied and UI updates

I created a patch-demo wiki based on the master branch where that works correctly: https://d7773a52b4.catalyst.wmcloud.org/wiki/Main_Page
(unfortunately, a plain new patch-demo still needs some tweaks before this task can actually be tried.)

Michael renamed this task from Create a minimal implementation for the Improve Tone Suggested Edits task type to Create a minimal implementation for the Revise Tone Suggested Edits task type.Oct 10 2025, 7:13 PM

Requirement

  • All copy for the Revise Tone task may remain as drafts / non-translated.
  • Use the “medium” task variant’s copy temporarily (from the documented drafts) for now.
  • The TaskTypeHandler should use a short, hard-coded list of tone templates (no weighting yet).
  • The task’s difficulty should be “Easy” and the feature should be enabled by default.
  • Clicking a Revise Tone task should open VE directly (full page / in focus) at the sentence needing tone revision.
  • Once VE is open, guidance or dialog should show highlighting or annotations on non-neutral wording.
  • After editing and saving, the revised text should be applied and the UI must update to reflect the change.

BDD

Feature: Revise Tone / Improve Tone Structured Task  

Scenario: Basic flow of Revise Tone suggestion  
  Given the Revise Tone feature flag is enabled  
  And a user opens a Suggested Edits task with a non-neutral sentence  
  When the user clicks the “Revise Tone” task  
  Then VE opens with a sentence with non-neutral wording in focus  
  And they should see a dialog / guidance on non-neutral wording  
  And after editing, the revised text is applied and UI updates

Test Result

Status: ✅ PASS
Environment: patchdemo
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Basic flow of Revise Tone suggestion

  1. Enable the Revise Tone feature flag
  2. Identify or create a Suggested Edits task containing a non-neutral sentence
  3. Click “Revise Tone”
  4. Confirm that VE opens, with the non-neutral sentence in focus / highlighted
  5. In the UI/dialog, check that guidance or annotation is shown around the non-neutral wording
  6. Edit that sentence → save / apply
  7. Return to article / preview and confirm the revised text appears
  8. AC1: The revised text is applied and UI updates

Test Case 2: Guidance templates visible

  1. When on Revise Tone UI (after opening via a suggestion)
  2. Look for the guidance / templates panel or area
  3. Confirm that a small set of hard-coded tone templates is visible
  4. ✅ ⬜ AC2: Guidance templates are displayed as expected

Desktop

screenshot 251.png (1,757×1,520 px, 272 KB)
screenshot 252.png (1,757×1,520 px, 297 KB)
screenshot 253.png (1,757×1,520 px, 298 KB)
screenshot 254.png (1,757×1,520 px, 299 KB)
screenshot 255.png (1,757×1,520 px, 296 KB)
screenshot 256.png (1,757×1,520 px, 289 KB)
screenshot 257.png (1,757×1,520 px, 334 KB)

Mobile

screenshot 258.png (438×941 px, 66 KB)
screenshot 259.png (438×941 px, 40 KB)
screenshot 260.png (438×941 px, 140 KB)
screenshot 261.png (438×941 px, 134 KB)
screenshot 262.png (438×941 px, 140 KB)
screenshot 263.png (438×941 px, 141 KB)
screenshot 264.png (438×941 px, 62 KB)
screenshot 265.png (438×941 px, 83 KB)
screenshot 266.png (438×941 px, 94 KB)

Based on this passing QA, I think this can be closed.