-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
ui: (fix) Tooltip component styling and props #46854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @koorosh!
Can you update the release notes as the tooltip visibility problem is a bug:
This fixes a bug for statement diagnostics that led to tooltips always showing instead of only on hover"
I don't think we need to call out the tooltip width since that doesn't affect content.
Reviewable status:
complete! 1 of 0 LGTMs obtained
This fix is rework of previous changes related to PR: cockroachdb#46557 Prior, to customize tooltip width for two particular cases, changes were made in shared component and affected all tooltips across project (tooltip width was set to 500px). Instead of this, current changes keep component styles without local changes and extend them with specific classes (via `overlayClassName` prop). It allows to apply changes in specific places (Statements and Jobs tables). Next fix: the order of destructing props in `components/tooltip/tooltip.tsx`. `{...props}` supplied as a last prop to `<AntTooltip />` component and it overrides all previous props which have to be preserved. To fix this, ...props was moved as first prop. And last fix: Tooltips for Diagnostics Status Badge was set to be visible always and with some random conditions tooltips appeared and were displayed instantly. To fix this, `visible` prop was removed to trigger tooltip visibility only on mouse hover. And to position Diagnostics Status Badge tooltip more elegantly - it is positioned to `bottomLeft` side, because this badge is displayed in the last columns and there is not enough place on the right side for tooltip. Release note (bug fix): Tooltips for statement diagnostics were shown always instead of only on hover Release justification: bug fixes and low-risk updates to new functionality
bedd398
to
a2dde8d
Compare
Done! |
bors r+ |
Build succeeded |
This fix is rework of previous changes related to PR: #46557
Prior, to customize tooltip width for two particular cases,
changes were made in shared component and affected all tooltips
across project (tooltip width was set to 500px).
For example, tooltips for Diagnostics badges were 500px wide:
Instead of this, current changes keep component styles without
local changes and extend them with specific classes (via
overlayClassName
prop). It allows to apply changes in specific places (Statements and Jobs
tables).
Next fix: the order of destructing props in
components/tooltip/tooltip.tsx
.{...props}
supplied as a last prop to<AntTooltip />
component and itoverrides all previous props which have to be preserved. To fix this, ...props
was moved as first prop.
And last fix: Tooltips for Diagnostics Status Badge was set to be visible always
and with some random conditions tooltips appeared and were displayed instantly.
To fix this,
visible
prop was removed to trigger tooltip visibility only onmouse hover.
And to position Diagnostics Status Badge tooltip more elegantly - it is positioned
to
bottomLeft
side, because this badge is displayed in the last columns and thereis not enough place on the right side for tooltip.
Release note (bug fix): Tooltips for statement diagnostics were shown always
instead of only on hover
Release justification: bug fixes and low-risk updates to new functionality