Page MenuHomePhabricator

Timeline: Page title and timestamp columns flipped if page title is RTL
Open, LowPublic2 Estimated Story PointsBUG REPORT

Assigned To
Authored By
dom_walden
Jun 4 2020, 10:02 AM
Referenced Files
F35335278: title_direction_after_rtl.png
Mon, Jul 25, 9:29 AM
F35335275: title_direction_after.png
Mon, Jul 25, 9:29 AM
F35309511: article_rtl_1.png
Jul 6 2022, 9:22 AM
F35309508: article_ltr_1.png
Jul 6 2022, 9:22 AM
F35309506: article_rtl.png
Jul 6 2022, 9:22 AM
F35309504: article_ltr.png
Jul 6 2022, 9:22 AM
F35309496: rc_rtl.png
Jul 6 2022, 9:22 AM
F35309494: rc_ltr.png
Jul 6 2022, 9:22 AM

Description

What is the problem?

If a user creates a new page or edits an existing page with an RTL title, when viewing that edit in the Timeline tab the timestamp appears before the page title.

For LTR titles, the timestamp comes after the title.

I have not seen a similar thing occur for RTL usernames or edit summaries, but might be worth investigating further.

Steps to reproduce problem
  1. Login as a regular user
  2. Create/edit a page with an RTL title
  3. Login as a Check User
  4. Investigate user from step 1
  5. Look at Timeline tab

Expected behavior: Edit from step 2 appears in the form (diff) (hist) . . $title . . $timestamp . . $username (talk | contribs | block) . . $ip . . $user_agent
Observed behavior: $timestamp appears before $title

Environment

Wiki(s): testwiki CheckUser 2.5 (54961e6) 15:21, 2 June 2020; local vagrant CheckUser 2.5 (86912b1) 06:23, 4 June 2020

Screenshots (if applicable):

flipped.png (52ร—399 px, 6 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJun 4 2020, 10:02 AM

Interestingly, this bug also affects the current CheckUser.

Niharika moved this task from Untriaged to Triage/To be Estimated on the Anti-Harassment board.
Restricted Application added a project: I18n. ยท View Herald TranscriptJun 4 2020, 11:04 PM
STran set the point value for this task to 2.Feb 14 2022, 6:57 PM

Could this be solved by adding <bdi> tags around the title?

Change 811299 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/CheckUser@master] Wrap titles in <bdi> tags in Special:Investigate timeline

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

Change 811299 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Wrap titles in <bdi> tags in Special:Investigate timeline

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

@Tchanders Just to check my understanding of the <bdi> tag. It means that the page title should appear the same regardless of the direction of the user's interface language.

For example, here is how two titles appear in Special:Investigate in LTR (uselang=en) and RTL (uselang=he). This is in contrast to Recent Changes which does not use <bdi>. I also include the titles of the two pages as they appear at the top of the article on wiki in English and Hebrew interface languages:

LTRRTL
Special:Investigate
si_ltr.png (56ร—223 px, 4 KB)
si_rtl.png (51ร—216 px, 3 KB)
Recent Changes
rc_ltr.png (59ร—293 px, 5 KB)
rc_rtl.png (54ร—329 px, 6 KB)
Title as it appears in the article
article_ltr.png (50ร—179 px, 1 KB)
article_rtl.png (51ร—192 px, 1 KB)
Titles as it appears in the article
article_ltr_1.png (50ร—157 px, 1 KB)
article_rtl_1.png (52ร—197 px, 1 KB)

(Special:Investigate treats the "Foo" article as ltr regardless of interface language.)

Change 812012 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/CheckUser@master] Remove <bdi> tags from titles in Special:Investigate timeline

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

@dom_walden Thanks for providing these examples - I think we should keep the titles consistent with how they appear on the article page. I had a look into how Special:RecentChanges does this, and the new patch does it that way instead.

Change 812012 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Remove <bdi> tags from titles in Special:Investigate timeline

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

LTRRTL
Special:Investigate
si_ltr.png (56ร—223 px, 4 KB)
si_rtl.png (51ร—216 px, 3 KB)
Recent Changes
rc_ltr.png (59ร—293 px, 5 KB)
rc_rtl.png (54ร—329 px, 6 KB)
Title as it appears in the article
article_ltr.png (50ร—179 px, 1 KB)
article_rtl.png (51ร—192 px, 1 KB)
Titles as it appears in the article
article_ltr_1.png (50ร—157 px, 1 KB)
article_rtl_1.png (52ร—197 px, 1 KB)

How it looks now:

LTRRTL
Special:Investigate
title_direction_after.png (51ร—220 px, 4 KB)
title_direction_after_rtl.png (49ร—219 px, 3 KB)

Which I believe is consistent with how it looks in RecentChanges and in the article.

I tested page titles in several different languages (including RTL languages) and did not notice any instance of the timestamp and titles columns being flipped when viewing in either an LTR or RTL interface language.

Of the ones I checked, the title as it appeared in Special:Investigate was consistent with how it appeared in the actual article.

I think there is a similar bug with the edit summary field, which I will probably raise a separate bug.

Test environment: local docker CheckUser 2.5 (686cf4b) 06:14, 18 July 2022.