"subscribe" button is on the wrong side when heading and content are marked up in reverse directionality
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

image.png (176×1 px, 38 KB)

I haven't tested this on a wiki with new discussion looks but it's probably going to suffer similarly:

image.png (124×1 px, 20 KB)

What should have happened instead?:

Open question(s)

  • 1. Should Topic Container metadata actions follow directionality of interface or content language? See T305286 and T311663.

Testing

Expected:

  • The subscribe button is aligned opposite to the heading text (i.e. on the right, as the topic is LTR)
  • Topic container metadata follows the interface directionality (RTL) so is also right aligned

Event Timeline

Restricted Application added subscribers: Huji, Aklapper. · View Herald Transcript

You can test the new heading with dtenable=1: https://fa.wikipedia.org/w/index.php?oldid=35343366&dtenable=1#A_report:_IP_Editing_Restriction_Study_on_Farsi_Wikipedia

Note that the authors have wrapped the heading and the content in an LTR wrapper:

<div lang="en" dir="ltr" class="mw-content-ltr">
== A report: IP Editing Restriction Study on Farsi Wikipedia ==
...
</div>

This means we can't rely on CSSJanus for any directional flipping and would have to do everything based on the closest mw-content-dir class. We do this with some of the rules already.

You already don’t rely on CSSJanus, as ResourceLoader is unable to apply CSSJanus based on the page language’s directionality instead of the user language’s (T89561): rEDTO modules/dt.init.less:175-183 (at 95fb33fb5735)

.mw-content-ltr .ext-discussiontools-init-section-subscribe {
	/* @noflip */
	float: right;
}
.mw-content-rtl .ext-discussiontools-init-section-subscribe {
	/* @noflip */
	float: left;
}

which mostly, but not entirely, follows the pattern for content styles in T89561’s description. The difference is that the selectors with two mw-content-* classes are missing. This makes both rules match with have the same specificity, so the last one wins. If you add the double-class selectors, most bidirectional cases will work as intended (LTR-in-RTL-in-LTR would still break, but hopefully that’s extremely uncommon).

  • 1. Should Topic Container metadata actions follow directionality of interface or content language?

This bug report is about the subscribe button, not about the metadata. It’s an open question what we should happen with metadata, but not this one: it was designed to be on the opposite side of the page compared to the topic title, and so should it be. (You could ask how the topic title should be aligned, but the topic title’s been there always, aligned in a certain—sometimes a bit arbitrary—way, and I see no reason to make any changes to it.)

Esanders renamed this task from subscribe button is on the way of differenrtly aligned content to "subscribe" button is on the wrong side when heading and content are marked up in reverse directionality.Aug 26 2022, 10:35 AM

Change 826819 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/DiscussionTools@master] Support nested-directionality content

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

Test wiki created on Patch demo by Matma Rex using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/44711d1801/w

Test wiki created on Patch demo by Matma Rex using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/0b364968a2/w

There are 4 cases to test, for every combination of content language and interface language directions. (And for each of those, both topic language directions.)

https://patchdemo.wmflabs.org/wikis/44711d1801/wiki/Talk:Wiki_LTR
https://patchdemo.wmflabs.org/wikis/44711d1801/wiki/Talk:Wiki_LTR?uselang=ar
https://patchdemo.wmflabs.org/wikis/0b364968a2/wiki/نقاش:Wiki_RTL
https://patchdemo.wmflabs.org/wikis/0b364968a2/wiki/نقاش:Wiki_RTL?uselang=en

They all seem to work as expected. (Although I have doubts on whether people will find this intuitive, but I think it's the best we can do.)

Change 826819 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Support nested-directionality content

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

ppelberg claimed this task.

Test wiki on Patch demo by Matma Rex using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/0b364968a2/w/

Test wiki on Patch demo by Matma Rex using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/44711d1801/w/