Repository navigation
fix(view): show the selected enum label as tooltip and keep tooltips in sync - #11114
Open
MichaelUray wants to merge 1 commit into
Open
MichaelUray wants to merge 1 commit into
MichaelUray wants to merge 1 commit into
Conversation
…in sync The editable enum presenter used in card tables built its tooltip from the raw attribute value, while the dropdown shows "Not selected" whenever that value is not one of the enum values. The tooltip action also ignored option changes when it was mounted without a tooltip, and after the tooltip was removed it kept the stale options (or failed on hover), so the cell could show the label of another value. The presenter now derives the tooltip from the selected enum item, so an empty or unknown value has no tooltip. The tooltip action always registers its handlers, ignores hovers while no label/component is set, and closes its tooltip when the options are cleared, so reactive updates in both directions take effect. Fixes hcengineering#8673 Signed-off-by: Michael Uray <michaeluray@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8673
Problem and change
The editable enum presenter used in card tables built its tooltip from the raw
attribute value, while the dropdown shows "Not selected" whenever that value is
not one of the enum values. The tooltip action also ignored option changes when it
was mounted without a tooltip, and after the tooltip was removed it kept the stale
options (or failed on hover), so the cell could show the label of another value.
The presenter now derives the tooltip from the selected enum item, so an empty or
unknown value has no tooltip. The tooltip action always registers its handlers,
ignores hovers while no label/component is set, and closes its tooltip when the
options are cleared, so reactive updates in both directions take effect.
Tests
New unit tests
packages/ui/src/__test__/tooltips.test.tsfor thetooltipaction (options set later, options cleared, no stale label); three of them fail on the previous implementation. Checked manually on a self-hosted instance: card table enum cells show their value as tooltip, "Not selected" cells show none, changing a value updates or closes the tooltip, and other tooltips in the app (navigator, status, assignee, checkbox) still work.