Page MenuHomePhabricator

Auto-scroll should keep the selected sentence in the viewport
Closed, ResolvedPublic

Description

Auto-scroll is not working when I press “Apply”, the UI should scroll down to show the sentences being translated

autoScrollMissing.gif (656×382 px, 3 MB)

Similarly, after editing the sentence saving the changes, it is possible for the highlight to move to the next sentence out of the viewport.

The expected behaviour would be for scrolling to adjust so that the highlighted content remains inside the viewport (as a result of previous, apply, next or saving changes).
Note that it is preferred to keep scrolling movements minimal. Thus it is not desirable for the highlighted part to automatically move to the very top of the viewport. Instead, it is preferred to move just enough to be visible at the bottom of the viewport. In this way, the text recently added to the translation (on top) may also be visible (useful as feedback that it was added).

Event Timeline

Pginer-WMF renamed this task from auto-scroll is not working when I press “Apply” to Auto-scroll should keep the selected sentence in the viewport.Feb 16 2021, 9:50 AM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF updated the task description. (Show Details)

Edited the description to make the ticket more general since the same issue occurs when returning from saving changes to a sentence. Also added some details on the expected scrolling behaviour.

Pginer-WMF raised the priority of this task from Medium to High.Nov 5 2021, 12:37 PM

Change 738196 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] SX sentence selector: Scroll the selected sentence in to view

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

Change 738196 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] SX sentence selector: Scroll the selected sentence in to view

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

Change 738604 had a related patch set uploaded (by Santhosh; author: Santhosh):

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20211115

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

Change 738604 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CX3 Build 0.1.0+20211115

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

Etonkovidova subscribed.

Checked on testwiki wmf.9 (on Samsung Galaxy S8 phone 360x740) - the fix is in place and in the majority of cases the highlighted content is displayed fully in the viewport. The ticket was also checked for RTL lang.

I'm moving the task to Pending input for QA, but the scope of this ticket is done. If there will be no follow-ups - that ticket can be closed as Resolved.

Below are two cases (tested on translating https://en.wikipedia.org/wiki/Let_It_Be_(Beatles_album) from en to es when the highlighted content won't be displayed fully in the viewport.
(1) When going backwards - either after Skip or after Apply - the highlighted content is not displayed in the viewport. The animated gif below shows an example when the entire highlighted sentence is not visible when the back button is pressed. In most cases only the part of highlighted text is not visible.

android_highlight_hide2.gif (906×445 px, 835 KB)

(2) In tables and references sections

Reference section - only part of highlighted content is displayedDesired behavior - whole highlighted sentence is displayed
Screenshot_20211130-122420_Chrome.jpg (2×1 px, 665 KB)
Screenshot_20211130-122429_Chrome.jpg (2×1 px, 569 KB)

The section translation screenshots below were done on the following table:

Screen Shot 2021-11-30 at 12.37.52 PM.png (1×1 px, 266 KB)

A table - the highlight is partially visibleA table - the highlighted content is not in the viewport
Screenshot_20211130-123245_Chrome.jpg (2×1 px, 352 KB)
Screenshot_20211130-123313_Chrome.jpg (2×1 px, 387 KB)

Thanks for checking, @Etonkovidova.
I think we can resolve this ticket. We'll observe how this works in practice to consider further tweaking if needed.