WorldBrain / Memex

Browser extension to curate, annotate, and discuss the most valuable content and ideas on the web. As individuals, teams and communities.
https://worldbrain.io
4.41k stars 336 forks source link

tooltip doesn't show on metafilter.com #613

Open ghost opened 5 years ago

ghost commented 5 years ago

The problem can be reproduced by navigating to any discussion thread on metafilter (e.g. https://ask.metafilter.com/219758/Do-deaf-people-experience-semantic-satiaton, which is the page on which I first became aware of this issue) and selecting some portion of text. The tooltip that would normally display after a short display would not display here.

blackforestboi commented 5 years ago

This is really weird :-O I can reproduce it but can't find any clue why this is happening. No error messages, and the regular sidebar is appearing just fine. So injecting of iframes does work and is not blocked by the site. Maybe @poltak can spend a couple of minutes on it.

But it appear to be an edge case so right now does not have a super high priority to be honest :( We are a bit limited in resources and need to focus on some other things that push the ball.

Sorry about that :(

Thanks for the time to report this issue.

ghost commented 5 years ago

No worries! I imagine not many users are annotating forum threads anyways. I've been using it mostly on Gutenberg books and memex has been fantastic.

Just in case this may be of help in the future in solving this problem. I fooled around in chrome developer tools a bit and noticed that when I select different texts on that page the style attribute of #memex-tooltip div does get updated with different 'top' and 'left' values roughly corresponding to the position of selected text. This made me think perhaps the tooltip is not seen because it's positioned way off screen (perhaps due to some kind of issue having to do with 'position:absolute/relative' of parent div? My css is rusty). So I tried manually editing the style attribute and found that, indeed, when you set 'top' to some really huge negative number (but not too huge - in my case the -2800 to -3500px range works) the tooltip is shown again. Here's a screenshot to illustrate what I'm talking about.

20181106201123 do_deaf_people_experience_semantic_satiaton_-_sem

poltak commented 5 years ago

Great find there @and-thus-are-no-longer-available-to-eat ! It definitely seems to be something to do with how that positioning is calculated on those pages specifically. The tooltip always renders when text is highlighted, it's just rendering way too far away from the highlighted text.

Though I have no idea why this would happen here yet. I will have to look into and understand the part of the code that decides where the tooltip gets positioned on the page and think of a way around it (without breaking it for all other pages, which seem to work well).

For reference, this looks like the part of the code that does it: https://github.com/WorldBrain/Memex/blob/develop/src/content-tooltip/interactions.js#L52-L63