Skip to content

Memex.Link tooltip refactor.#547

Merged
blackforestboi merged 8 commits intoWorldBrain:masterfrom
digi0ps:hotfix/prevent-unnecessary-tooltips
Sep 5, 2018
Merged

Memex.Link tooltip refactor.#547
blackforestboi merged 8 commits intoWorldBrain:masterfrom
digi0ps:hotfix/prevent-unnecessary-tooltips

Conversation

@digi0ps
Copy link
Copy Markdown
Contributor

@digi0ps digi0ps commented Aug 28, 2018

  • Prevents tooltip if selected text is empty or is inside a content-editable element.
    This prevents the tooltip from popping up if clicked on empty spaces or inside docs cells.
  • Prevents tooltip if selected text inside a link.
  • Position tooltip dynamically below the selected text instead of below the mouse pointer.

@digi0ps digi0ps requested a review from ShishKabab August 28, 2018 18:33
@ShishKabab
Copy link
Copy Markdown
Member

Whoohoo! Very, very cool :) Does this also prevent the tooltip popping up when clicking links? (Only happens on some pages, probably mostly SPAs.) Would be cool to get this in as soon as possible, would remove a lot of frustration.

@digi0ps
Copy link
Copy Markdown
Contributor Author

digi0ps commented Aug 29, 2018

No I haven't prevented it popping up in links ( I haven't experienced it personally, maybe I will check in SPAs ).
But if we don't want Memex.Links popping up in links, I can disable it if one of the parent element is an anchor element.

Loops over all the parent elements to check if it's an anchor element.
Previously, it was positioned on the mouse pointer's coords.
Now uses the range's bounding rectangle to find the position.
@digi0ps digi0ps changed the title Prevent tooltip in unnecessary places. Memex.Link tooltip refactor. Aug 31, 2018
@digi0ps
Copy link
Copy Markdown
Contributor Author

digi0ps commented Aug 31, 2018

I have made the tooltip align right below the selected text ( like how Medium does ). Works nicely in most of the scenarios. But in some (rare) scenarios, when we select large ranges of text, it goes below the viewport or off position. But do give it a try when you are free!

@blackforestboi
Copy link
Copy Markdown
Member

Can you show me an example of which page, maybe a screencast? Thanks!

@blackforestboi
Copy link
Copy Markdown
Member

Position tooltip dynamically below the selected text instead of below the mouse pointer.

Actually i like that it is under the mouse pointer much more, as i have a short distance to create an annotation/direct link.
What about you folks? How often is it in the way?

@digi0ps
Copy link
Copy Markdown
Contributor Author

digi0ps commented Sep 1, 2018

@oliversauter It fails to align itself properly in some comments in GH like here.
Yeah, right below the mouse pointer is faster to access. Just thought would give this a try. I will remove the commit if it's not needed!

@blackforestboi
Copy link
Copy Markdown
Member

ah so it does not show up at all when it would be out of the field.

Mhh. would it be easy to add a setting to the settings?
screen shot 2018-09-01 at 15 41 11

Change title to "Annotation Tooltip"
Add drop down select:
Title: Position of tooltip
Options:
a) at mouse pointer (default)
b) below text

@blackforestboi
Copy link
Copy Markdown
Member

also please make the text below the title like the one in "indexing preferences"
screen shot 2018-09-01 at 15 44 37

@digi0ps
Copy link
Copy Markdown
Contributor Author

digi0ps commented Sep 1, 2018

Cool, that must be easy. I will do it. 👍

@blackforestboi blackforestboi merged commit cf425e9 into WorldBrain:master Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants