Page MenuHomePhabricator

Suggestions: Text replacement suggestions should show what replacement they are suggesting
Open, Needs TriagePublic

Assigned To
Authored By
Esanders
Feb 26 2026, 12:39 PM
Referenced Files
F74666540: image.png
Tue, Mar 31, 10:23 AM
F74461526: image.png
Mon, Mar 30, 10:18 AM
F73863044: image.png
Fri, Mar 27, 9:23 PM
F72853104: image.png
Mar 14 2026, 9:12 AM
F72853088: image.png
Mar 14 2026, 9:10 AM
F72437075: image.png
Feb 26 2026, 12:39 PM
F72437066: image.png
Feb 26 2026, 12:39 PM
F72437047: image.png
Feb 26 2026, 12:39 PM

Description

Background goal

Current the suggestion just contains generic text:

image.png (247×335 px, 19 KB)

When suggest a specific replacement, we should preview what that change is going to be, so users know what action they are about to take.

Decided solution

Use the question above the buttons to show the suggested word and ask to replace it and use Replace for the action

image.png (504×714 px, 121 KB)

Event Timeline

I guess that the risk is that we'd need the design to cope with potentially quite large amounts of text, particularly if we roll out the regex replacements feature.

I guess that the risk is that we'd need the design to cope with potentially quite large amounts of text, particularly if we roll out the regex replacements feature.

We can ignore matches/replacements above N characters for now - so this will still work for 99% of cases.

Change #1251014 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] TextMatchEditCheck: Show specific replacement about to take place

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

bmartinezcalvo renamed this task from EditCheck: Text replacement checks should show what replacement they are suggesting to Suggestions: Text replacement suggestions should show what replacement they are suggesting.Mar 14 2026, 9:02 AM

We could use the question above the buttons (the one we use in Paste Check) to show the suggested word and ask the user to replace it.

image.png (504×714 px, 122 KB)

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://e26e154d4b.catalyst.wmcloud.org/w/

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://5761f14346.catalyst.wmcloud.org/w/

ppelberg subscribed.

We could use the question above the buttons (the one we use in Paste Check) to show the suggested word and ask the user to replace it.

image.png (504×714 px, 122 KB)

@bmartinezcalvo: what you proposed here looks like a nice incremental improvement. And @Esanders, it looks like the PatchDemo you created implements it. [1]

Next steps
All of the above leads me to think the next step here is code review. If you're seeing this differently, please let me know. In the meantime, I'm moving it there on the upcoming sprint board.


  1. image.png (680×992 px, 142 KB)

Test wiki on Patch demo by ESanders (WMF) using patch(es) linked to this task was deleted:

https://8e905181a5.catalyst.wmcloud.org/w/

We could use the question above the buttons (the one we use in Paste Check) to show the suggested word and ask the user to replace it.

image.png (504×714 px, 122 KB)

Good point - this is done and ready for review:

image.png (256×316 px, 22 KB)

@Esanders it looks good!

Do you know why the "OK" button is not up to dated to the "Change word" proposed in T414987?

Well, (a) it doesn't seem to be listed in the table of copy proposals on that ticket, and (b) it shouldn't be "change word", because a textmatch replacement isn't necessarily going to be a single word.

What about just Replace to match the question above?

Change #1251014 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] TextMatchEditCheck: Show specific replacement about to take place

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

Change #1264740 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] TextMatchEditCheck: action label "replace" instead of "ok"

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

bmartinezcalvo updated the task description. (Show Details)
bmartinezcalvo updated the task description. (Show Details)

What about just Replace to match the question above?

Seems reasonable, let's file a separate task.

Went ahead and made T422059 per Ed's comment.