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

Tooltips fixes #12067

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Tooltips fixes #12067

wants to merge 8 commits into from

Conversation

vitvakatu
Copy link
Contributor

Pull Request Description

Closes #10999

Fixes three issues with tooltips:

  • Tooltips for buttons (in fact the only place where they are used) are now hidden when the button is clicked.
  • Tooltips no longer jump to random locations when the target element is unmounted.
  • Elements without tooltips no longer contribute to timeouts.
tooltips.mp4

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@vitvakatu vitvakatu added --bug Type: bug -gui labels Jan 16, 2025
@vitvakatu vitvakatu self-assigned this Jan 16, 2025
@vitvakatu vitvakatu marked this pull request as ready for review January 16, 2025 21:04
Copy link

github-actions bot commented Jan 16, 2025

🧪 Storybook is successfully deployed!

📊 Dashboard:

Copy link
Contributor

@farmaazon farmaazon left a comment

Choose a reason for hiding this comment

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

I miss some docs, otherwise is good to go.

@@ -13,14 +14,18 @@ import TooltipTrigger from '@/components/TooltipTrigger.vue'

const toggledOn = defineModel<boolean>({ default: undefined })
const props = defineProps<{ disabled?: boolean | undefined; title?: string | undefined }>()
const tooltipTrigger = ref<typeof TooltipTrigger>()
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, so you don't need ComponentInstance or ComponentExposed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, not really, tsc is happy 🤷🏻‍♂️ I added just for consistency.

Comment on lines +58 to +64
if (
previousTooltip.value != null &&
!previousTooltip.value.entry.isHidden &&
previousTooltip.value.element.isConnected
) {
return previousTooltip.value
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment explaining why we sometimes display the tooltip at the previous element - I think it's not obvious without the context of the bug you're fixing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +63 to +67
if (entriesSet) {
for (const e of entriesSet) {
if (e.key === key) entriesSet.delete(e)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We may have quite a lot of entries in this set - could it be a map?

Also, why didn't the previous approach work? In general I feel a bit more documentation would be helpful; for example I don't get why hoveredElements is map of HTMLElement -> Set - do we have many tooltips registered for single HTML element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The set is usually just one element long. But in case of nested tooltip triggers (which are extremely rare) it can be longer.

@vitvakatu vitvakatu added the CI: Ready to merge This PR is eligible for automatic merge label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--bug Type: bug -gui CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltip Issues with Viz dropdown buttons
2 participants