Page MenuHomePhabricator

Implement badge count for Suggestion Mode toggle
Closed, ResolvedPublic5 Estimated Story Points

Description

T420245 and T420268 will introduce early iterations of a toggle that will enable people to toggle Suggestion Mode ON/OFF from within VE (desktop + mobile).

This task involves the work of updating the toggle to include an as-close-to-real-time-as-possible count of the number of suggestions available within the article someone is editing.

Story

As a someone who is open to discovering ways to improve an article, I want to see how many suggestions are available – regardless of if I have Suggestion Mode enabled or not – so that I can gauge whether there are opportunities to contribute I might not have already considered and decide whether to pursue any of them.

Requirements

Suggestion Count

  • Introduce a count of the total number of suggestions that are available within the article you are currently editing
  • This count ought to remain visible whether you have Suggestion Mode Toggled ON or OFF

OFF State

  • When Suggestion Mode is OFF, the count serves as an indicator that suggestions exist and may encourage users to toggle Suggestion Mode ON.
  • This count ought to update in real-time w/o any kind refresh/reload
    • Said another way, the count ought to update as a suggestion is addressed, dismissed/declined, or no longer relevant
  • When 0 Suggestions remain/are available, do NOT show show badge count

ON State

  • When Suggestion Mode is ON, the count provides awareness of how many suggestions remain to be addressed.
  • This count ought to update in real-time w/o any kind refresh/reload
    • Said another way, the count ought to update as a suggestion is addressed, dismissed/declined, or no longer relevant
  • When 0 Suggestions remain, show badge count at 0 so people are clear that there are no more suggestions for them to address at this time.

Instrumentation

  • When people engage with the Suggestion toggle, log the state of the badge count so that we can understand how the badge's visibility (or lack thereof) impacts engagement

Mockups

Related Objects

Event Timeline

VPuffetMichel set the point value for this task to 5.Mar 25 2026, 5:18 PM
bmartinezcalvo removed the point value 5 for this task.

5 is linked to the fact that we believe that performance might not be an issue

bmartinezcalvo added a project: Design.
bmartinezcalvo moved this task from Incoming to Done on the Design board.
ppelberg set the point value for this task to 5.Mar 30 2026, 5:37 PM

English will us "9+" instead of "+9" (Echo and Discussions tool have similar counters which use "99+"), but this be in the localised string so can change if necessary in other languages.

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

[mediawiki/extensions/VisualEditor@master] Suggestion mode tool: Add support for data-count badge

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

As we have given ourselves enough room for 2 characters ("9+") we could show counts 2 digit counts if we wanted. In cases of having to show "99+" the badge wouldn't look great, but that would be a rare edge case...

English will us "9+" instead of "+9" (Echo and Discussions tool have similar counters which use "99+"), but this be in the localised string so can change if necessary in other languages.

Sounds good.

As we have given ourselves enough room for 2 characters ("9+") we could show counts 2 digit counts if we wanted. In cases of having to show "99+" the badge wouldn't look great, but that would be a rare edge case...

I would recommend capping the badge at 9+ since showing higher numbers (e.g. 32) could feel overwhelming.

Change #1266214 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Suggestion mode tool: Add data-count badge

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

Test wiki created on Patch demo by BMartinezCalvo (WMF) using patch(es) linked to this task:
https://b4b8869df5.catalyst.wmcloud.org/w/

Heads up that the badge should act as a countdown when completing/declining suggestions, showing a slight pulse animation like the one proposed in the design prototype.

Grabación de pantalla 2026-04-06 a las 16.18.53.gif (1×2 px, 3 MB)

Regarding the +9 approach, after reviewing the implementation I’m not sure it’s the most appropriate solution since it makes it harder to understand the countdown when completing or declining suggestions above that threshold. I’m not sure how many suggestions can appear in an article, but if the expected range is relatively low (e.g. ~20–30), using the 99+ would preserve the actual count without introducing confusion.

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

[mediawiki/extensions/VisualEditor@master] EditCheckController: debounce setting the suggestion toggle count

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

but if the expected range is relatively low (e.g. ~20–30), using the 99+ would preserve the actual count without introducing confusion.

I think in the vast majoriry of cases that will be true.

Change #1270370 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] EditCheckController: debounce setting the suggestion toggle count

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

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

[mediawiki/extensions/VisualEditor@master] Suggesiton counter: Show up to 99 instead of 9

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

Change #1270453 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Suggesiton counter: Show up to 99 instead of 9

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