Page MenuHomePhabricator

Show "Next edit" link on the latest diff if a new edit is made while user is viewing the diff
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):
When viewing diffs, there are convenient "← Previous edit" and "Next edit →" links for navigation between the edits. When viewing the latest diff, only a "← Previous edit" link is shown for obvious reasons. If a new edit is made to the page while the user is looking at the latest diff, the "Next edit →" link should appear automatically without reloading the page.

Benefits (why should this be implemented?):
User is able to know that another edit has been made without reloading, or needing to view the watchlist/history again

Originally filed at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Viewing_the_latest_diffs by User:Sod25.

Event Timeline

SD0001 renamed this task from Show a "Next diff" link for the latest revision if a new edit is made while user is viewing the diff to Show "Next edit" link on the latest diff if a new edit is made while user is viewing the diff.Nov 6 2021, 2:58 PM
SD0001 added a project: MediaWiki-Page-diffs.
SD0001 updated the task description. (Show Details)

How should that static page that you are looking at automagically get updated, technically speaking?

Using JavaScript to query the latest revid of the page, say every 5 seconds, and checking if it matches the one client is seeing. To optimize this, the polling could be done only when that particular tab/window is active. Maybe it could be done using a web worker.

That sounds like increasing data transfer and performance overhead for an extremely small gain.
Please feel free to write a JavaScript gadget / user script to reload pages (which sounds already highly disruptive in itself to me).

Can you explain it would have a significant performance overhead? The total data transfer for checking the latest revid of a page is https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=Barack%20Obama&rvprop=ids, which is tiny. There are several other tasks for real-time update features in mediawiki, notably T34284.

If you were after a small overlay message which could say something like "Page has been edited in the meantime." or so, maybe that's an option.
But showing a "Next edit" link on the latest diff if a new edit is made while user is viewing the diff does not sound realistic to me.

Is there any global task dedicated to moving MediaWiki further to the Ajax paradigm, or are there any such plans at all? This feature is one that came to my mind as well, but I thought I makes not much sense as long as history pages aren't dynamically updated as well, like the modern watchlist does. I see that MediaWiki is deemed to be just OK with static pages (given that Ajax has been around for a very long time, and only few pages have adopted it so far), but I don't quite see what would change for the worse if it moves in that direction, and I clearly see what would change for the better.

But probably some proof of concept in form of a user script that would poll the revisions API on diff/history pages would be great. The gain might be not significant (which is why a limited number of users might install it), but that's exactly what it is supposed to be – a minor convenience, not a big leap forward.

Note also that if you go back from the last revision in Revision-Slider and then go forward, you will see the "Next diff" link.

SD0001 added a subscriber: Trizek-WMF.

If you were after a small overlay message which could say something like "Page has been edited in the meantime." or so, maybe that's an option.

The original suggestion on VPT was to have the "Next edit" link displayed, but of course there can be better alternatives such as an overlay message.

Is there any global task dedicated to moving MediaWiki further to the Ajax paradigm

I'm not aware of one. But going by T294382#7474807 and T1188#7494618, it seems it would be a good idea to create one, especially if it is to be submitted to Community Wishlist as @Trizek-WMF suggested.

Note also that if you go back from the last revision in Revision-Slider and then go forward, you will see the "Next diff" link.

Interesting, this might be something that could be considered as part of Revision-Slider in that case. Adding the project tag.