Skip to content

fix(view): show the selected enum label as tooltip and keep tooltips in sync - #11114

Open
MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/card-enum-not-selected-tooltip
Open

MichaelUray wants to merge 1 commit into
hcengineering:developfrom
MichaelUray:fix/card-enum-not-selected-tooltip

Conversation

@MichaelUray

Copy link
Copy Markdown
Contributor

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.ts for the tooltip action (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.

…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

No deployments
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.

Bug(Cards): wrong tooltip for Not selected

1 participant