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

Add tooltips for bookmark and edit path buttons #647

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

jelly
Copy link
Member

@jelly jelly commented Jul 11, 2024

Explain the bookmark and edit path button with a tooltip.

Related: #581

@jelly jelly requested a review from garrett July 11, 2024 14:39
martinpitt
martinpitt previously approved these changes Jul 11, 2024
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Tech review ok, waiting for @garrett for design review. Although we don't really have many knobs here, it's just standard PF Tooltip usage.

Copy link
Member

@garrett garrett left a comment

Choose a reason for hiding this comment

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

This doesn't work right. Try going from bookmarks to edit. You can't.

You never want tooltips or popovers covering up related parts of the UI that follow (to the right especially or under, generally. But as there's no room above and no related items below, having the tooltips at the bottom would be the best solution here.)

In other words: Move the tooltips under the icons, not to the side. Thanks!

@garrett
Copy link
Member

garrett commented Jul 15, 2024

Screencast of what I mean:

Kooha-2024-07-15-13-44-30.webm

Explain the bookmark and edit path button with a tooltip.

Related: cockpit-project#581
@jelly
Copy link
Member Author

jelly commented Jul 15, 2024

Fixed: image

@jelly jelly requested a review from garrett July 15, 2024 13:38
@garrett
Copy link
Member

garrett commented Jul 15, 2024

Much better, thanks!

However, now we have another problem: When you have a tooltip and activate the button, you can't easily see and click on the Home entry at the top.

Would there be a way to not show the tooltip when the dropdown of the widget is visible? At that point you already know what the button does and it only gets in the way.

Here's a silly little screencast to show the problem:

Kooha-2024-07-15-16-48-14.webm

Copy link
Member

@garrett garrett left a comment

Choose a reason for hiding this comment

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

(reviewed in the previous comment; GitHub is lousy about this, as not all reviews involve code reviews)

@garrett
Copy link
Member

garrett commented Jul 16, 2024

I pushed a working fix @ 9306b35; it's not ideal, but it adds a class to the element when the menu is open. I tried isVisible, but that would override the hover and focus, which isn't what we want... we don't want to replace the behavior, but add on to it.

I also tried pf-v5-u-hidden from https://www.patternfly.org/utility-classes/accessibility#hidden — but we'd need to import that. And even then, display: none (which this uses) causes the tooltip to be in an odd place when it came back from toggling the menu back off.

Therefore, I hide it visibly and pass through all mouse (so it's not intractable) and clicks pass through the invisible version of it.

Anyway, feel free to augment it or even revert it, as long as we have some kind of fix that isn't too gross of a hack.

(I had some other ideas, such as changing the appendTo and applying CSS off of the state, either from within the element or a sibling element... but this method felt less intrusive.)

Copy link
Member

@garrett garrett left a comment

Choose a reason for hiding this comment

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

I'll approve now, but the last commit was mine, so I'm biased. I'd like someone else to verify this works for them and review again. Thanks!

(I think whatever approach we use to fix this will be some degree of "hacky". I think this is probably the least hackiest.)

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Cheers!

@martinpitt martinpitt merged commit 94d07c0 into cockpit-project:main Jul 17, 2024
20 checks passed
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