Skip to content

Token Tooltip Fails to Display Resolved Value When Value is "0" #3776

@keeganedwin

Description

@keeganedwin

Describe the bug
When a token's resolved value is exactly ⁠0 (zero), the plugin's tooltip fails to display the numeric value next to the alias. Instead of showing "0", the space remains blank/empty. This is misleading as it can suggest that the token has no value or is broken, whereas the value is valid and correctly stored (as confirmed by checking the "Edit Token" modal where "0" is visible).
This issue occurs for:

  1. Direct references to other tokens with a value of ⁠0.
  2. Math operations that resolve to ⁠0.

To Reproduce
Steps to reproduce the behavior:

  1. Create a numeric token (e.g., dimension or spacing) with a value of ⁠0.
  2. Create a second token that references the first (e.g., ⁠{spacing.none}).
  3. Hover over the second token in the plugin UI to trigger the tooltip.
  4. See error: The tooltip shows the alias reference but displays nothing for the resolved value.

Expected behavior
The tooltip should explicitly display the number ⁠0 as the resolved value. It should not treat zero as a null or empty string for display purposes.

Screenshots or Screencasts
Image

Metadata

Metadata

Assignees

Type

No type

Projects

Status

📥 Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions