Page MenuHomePhabricator

UI issue: the page moves from bottom to top when new messages are loaded in List tab
Closed, ResolvedPublicBUG REPORT


List of steps to reproduce:

  • Open Special:Translate for a page which has more than 100 translation units, tab “List”
  • Scroll down to the bottom of the page
  • (There is a message saying the other translation units are loading.)
  • At the end of the loading message, the page moves up to the top and the first translation unit (generally the title of the page) is opened, even if it is already translated.

(If there are less than 100 translation units, the first translation unit is opened when the page loads, I guess it is fine but that’s my opinion only.)

This was remarked by @DDPAT, who created the video F34746286.

What happens?

The page moves up and the first translation unit is loaded, even if the user previously opened another translation unit…

What should have happened instead?

…but the page should stay at the bottom and the next 100 translation units should be displayed, and if the user had previously opened a translation unit, it should remain open. This would be consistent with the other tabs (“Page” and “Review”).

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:

  • MediaWiki: current Wikimedia’s version (1.38.0-wmf.7; rMW272431399e67) and reproductible with master
  • Translate: current Wikimedia’s version (2021-10-25; 7d97638) and reproductible with master
  • Browser: DDPAT has Google Chrome on a Windows 10 Pro computer; I have Firefox 94 on a Debian computer (we can both reproduce the issue)

Event Timeline

I identified the faulty instruction: resources/js/ext.translate.messagetable.js:539:

// Helpfully open the first message in show mode
// TODO: Refactor to avoid direct DOM access
$( '.tux-message-item' ).first().trigger( 'click' );

which is trigerred for the last batch of messages, which could be the the first one if there less than 100 translation units, but the behaviour discussed in this task is more strange when there are more than 100 translation units.

Nikerabbit added a subscriber: Nikerabbit.

Should be easy to fix by moving that line of code.

I want to note that this tool, as far as I know, is used both on (it is mentioned), as well as on, and there is this problem on these projects.

Change 738587 had a related patch set uploaded (by Seb35; author: Seb35):

[mediawiki/extensions/Translate@master] On List tab, open the first unit only on page load

In the patch, in addition of a condition to fix this issue, I moved a bit the code to always open the first unit on page load so that it is consistent whether there is a total of less or more than 100 translation units.

Change 738587 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] Special:Translate: On List tab open the first unit only on page load