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

Display tooltips for buttons, especially those without text #4185

Merged
merged 2 commits into from May 15, 2020

Conversation

infinite-persistence
Copy link
Contributor

@infinite-persistence infinite-persistence commented May 12, 2020

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Issue Number: Fixes #3465

What is the current behavior?

Some buttons (especially those without text) is lacking tooltips.

What is the new behavior?

Display tooltips for those elements.

Other information

The strings are already in place, so code was added to route the data to title for it to appear as tooltip.
Refer to commit message for full details.

The best candidate is `aria-label`, followed by `description`.

Most of the existing elements already have these defined, so try to route it as the tooltip instead of having to explicitly define tooltips everywhere through a redundant `title` or <Tooltip> tag.

Minor side-effect:
This will cancel off any effect from a parent <Tooltip>, i.e. might confuse future developers who are trying to do "<Tooltip><Button></Button></Tooltip>".
<MenuButton> is not from us, so the automatic tooltip from the previous commit does not apply here.
Copy link
Contributor

@harshkhandeparkar harshkhandeparkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -164,6 +164,7 @@ const Header = (props: Props) => {
<Menu>
<MenuButton
aria-label={__('Publish a file, or create a channel')}
title={__('Publish a file, or create a channel')}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the tooltip needs to be shorter.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that sentence is fine

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a possibility that it hides other text or gets cut?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would look better if it is made "Publish Your Content!" or "Publish Freedom" or something like that. Or just "Publish Content".

This is still my personal opinion. I don't like long tooltips, they look a bit messy to me.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, they sit on top of all the other text, so it won't get hidden.

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b May 12, 2020
@harshkhandeparkar
Copy link
Contributor

Do you have a picture/gif of the tooltipw btw?

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b May 13, 2020
@harshkhandeparkar
Copy link
Contributor

harshkhandeparkar commented May 13, 2020 via email

@neb-b neb-b merged commit 4643eb9 into lbryio:master May 15, 2020
@infinite-persistence infinite-persistence deleted the f/add-tooltips branch May 15, 2020 13:57
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.

More tooltips throughout app
3 participants