Page MenuHomePhabricator

VE doesn't refresh "pending changes" toolbar button after save
Open, Needs TriagePublicBUG REPORT

Description

As part of T365334 the following issue was reported to us.

Steps to replicate the issue

  • Go to a wiki with FlaggedRevs enabled, e.g. dewiki. Make sure your account has active reviewer rights.
  • Go to an article with unreviewed changes. Notice how there is a "Pending changes" button in the toolbar.
  • Edit the article using VisualEditor.
  • When you save the article check "Accept this version (includes 1 pending change)".

Screenshot 2024-05-19 at 21.44.10.png (1×1 px, 577 KB)

What happens?
The button "Pending changes" should disappear because there are no pending changes any more, but it doesn't.

While the extra button is the responsibility of FlaggedRevs, it's VE who is responsible for refreshing all relevant parts of the UI after an edit happened. This doesn't happen in this particular situation. (But does in others, e.g. when editing an old revision.) Note that this limitation is not strictly about FlaggedRevs. The same can happen to any other extension or feature that modifies anything in one of the toolbars depending on the status of the page.

Event Timeline

While the extra button is the responsibility of FlaggedRevs, it's VE who is responsible for refreshing all relevant parts of the UI after an edit happened.

VE fires the wikipage.content hook and updates global state variables. Any logic for updating the UI should live in the relevant extension and be agnostic of what caused the page to 'refresh'.