Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#info not producing tooltips in RTL MW UIs #3514

Closed
agharbeia opened this issue Oct 7, 2018 · 12 comments
Closed

#info not producing tooltips in RTL MW UIs #3514

agharbeia opened this issue Oct 7, 2018 · 12 comments
Assignees
Labels
enhancement Alters an existing functionality or behaviour

Comments

@agharbeia
Copy link
Contributor

Setup and configuration

  • SMW version: 2.5.5
  • MW version: 1.30.0
  • PHP version: 5.6.38-0+deb8u1 (apache2handler)
  • DB system (MySQL, Blazegraph, etc.) and version: 10.0.36-MariaDB-0+deb8u1

Issue

The parser function #info produces an icon, but no tool-tip appears, neither when hovering nor when clicking on the info icon.

The produced HTML as per Special:ExpandTemplates:

<span class="smw-highlighter" data-type="5" data-state="persistent" data-title="معلومات" title="This is tooltip text. It should be in Arabic but I&#39;m reproducing an issue for a bug report."><span class="smwtticon info"></span><div class="smwttcontent">This is tooltip text. It should be in Arabic but I'm reproducing an issue for a bug report.</div></span>

However, what is actually in the page, as per Firefox inspector:

<span class="smw-highlighter smwttpersist" data-type="5" data-state="persistent" data-title="معلومات" data-hasqtip="0" aria-describedby="qtip-0"><span class="smwtticon info"></span></span>

The text gets sanitized somewhere!

@agharbeia
Copy link
Contributor Author

The example is from page at: https://genderation.xyz/wiki/جوديث_بتلر , however I'm not sure the underlying template will stay the same, since it is a live production wiki.

@kghbln
Copy link
Member

kghbln commented Oct 7, 2018

Thanks for reporting the issue. Any chance to get this on https://sandbox.semantic-mediawiki.org/ since I admittedly do not handle Arabic interfaces well? Moreover for 3.0.0 some work was done on this parser function.

@agharbeia
Copy link
Contributor Author

agharbeia commented Oct 8, 2018

Thanks, Karsten, for your reply.

I did some more testing and found out that either in sandbox or my wiki, when the wiki UI language is one written in non-Latin script, such as Arabic, Farsi, or Hebrew, the tooltip doesn't appear. But when the language is written in another script, it behaves as expected.

Note that the issue may in fact be related to RTL scripts, since Syriac didn't work while Amharic worked. But I haven't tested that extensively.

Another note which I think is relevant, is that while the page is still loading but haven't finished loading yet, the tip layer appears when the mouse hovers on the icon. However at that time the layer appears in black, i.e. unstyled in the style that is applied later on after the page has finished loading. (Merits of a slower internet connection, you get to say page genesis)
I hope this helps.

@kghbln
Copy link
Member

kghbln commented Oct 8, 2018

Thanks a lot of recreating the issue on sandbox and elaborating on your findings. I had hoped that it might work on SMW 3.0.0 but not absolutely unexpected this version has issues with RTL, too. I do not think that it ever worked in earlier versions of SMW either.

@kghbln kghbln added the bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error label Oct 8, 2018
@kghbln kghbln added this to the SMW 3.1.0 milestone Oct 8, 2018
@Nikerabbit
Copy link
Contributor

Another thing that caught my eye is that you have a div inside a span. This will get mangled in some way by Tidy or Remex (depending on MediaWiki configuration and version).

@kghbln
Copy link
Member

kghbln commented Oct 9, 2018

Another thing that caught my eye is that you have a div inside a span.

I guess this is a decisive hint. I just created examples on sandbox and found that they are indeed producing pop ups. So I think you are doing something which is not possible within the current scope of the parser function if at all like e.g. a div inside a span. This latter is specific to your template I guess.

@agharbeia
Copy link
Contributor Author

agharbeia commented Oct 9, 2018 via email

@agharbeia
Copy link
Contributor Author

agharbeia commented Oct 9, 2018 via email

@kghbln
Copy link
Member

kghbln commented Oct 9, 2018

The issue still manifests in the example you created, Karsten, when I switch the Sandbox wiki UI language to one that is RTL.

Affirmative, there is an issue. Admittedly I do not deal with RTL languages at all in my personal life. Using respective wikis is hardly to not possible too and I am not even talking about trying to edit. I guess this explains my ignorance here. Anyhow I added a comment to the page making it clear over there what needs to be done to recreate the issue. We standardly test against Japanese but this is obviously not an RTL. :|

@kghbln kghbln changed the title #info: not producing tooltip #info not producing tooltip for RTL language users Oct 9, 2018
@kghbln kghbln changed the title #info not producing tooltip for RTL language users #info not producing tooltips for RTL language users Oct 9, 2018
@agharbeia
Copy link
Contributor Author

You might want to take a look at this some time, @maysara

@agharbeia agharbeia changed the title #info not producing tooltips for RTL language users #info not producing tooltips in RTL MW UIs Oct 23, 2018
@mwjames
Copy link
Contributor

mwjames commented Jan 12, 2019

I had a quick look at it and it is clear that the tooltip (we use qTip2 [0]) is initialized before the content is displayed and gets in trouble when repositioning (calculating the pos of a RTL view) the particular tooltip instance.

The only real alternative (after [0] is abandonware == hasn't seen any updates in the last 2 years) is to switch to a new lib preferable powered by Popper.js to use a real positioning engine.

This isn't bug in or by SMW and can ultimately only be resolved by relying on a more modern tooltip facilitator such as tippyjs [1] which would require some effort and makes it an enhancement.

[0] https://github.com/qTip2/qTip2
[1] https://github.com/atomiks/tippyjs

@kghbln kghbln added code quality and removed bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error labels Jan 12, 2019
@kghbln kghbln removed this from the SMW 3.1.0 milestone Jan 12, 2019
@kghbln kghbln added enhancement Alters an existing functionality or behaviour and removed code quality labels Jan 12, 2019
@kghbln
Copy link
Member

kghbln commented Jan 12, 2019

This isn't bug in or by SMW and can ultimately only be resolved by relying on a more modern tooltip facilitator such as tippyjs [1] which would require some effort which makes it an enhancement.

I had hoped that there will be an easier way to get this going for RTL users but reality is often even more complex than expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour
Projects
None yet
Development

No branches or pull requests

4 participants