Skip to content

chore: Add variant and icon usage to Token telemetry - #5067

Merged
NathanZlion merged 3 commits into
mainfrom
chore/token-telemetry-variant
Oct 20, 2026
Merged

NathanZlion merged 3 commits into
mainfrom
chore/token-telemetry-variant

Conversation

@NathanZlion

Copy link
Copy Markdown
Member

Description

Token reports no props to component telemetry, so we can't tell how many consumers use variant="inline" or pass an icon. We need that to decide whether inline tokens should render icons at x-small across all themes (today only OneTheme overrides it).

This passes variant, readOnly and disabled as telemetry props, and hasIcon as metadata, following the same useBaseComponent pattern as TokenGroup and Button. variant now defaults to 'normal' in the public wrapper so unset variants report as normal rather than undefined. Rendering is unchanged, since the internal component already defaulted to 'normal'.

Related links, issue #, if available: n/a

How has this been tested?

  • gulp quick-build passes locally.
  • Existing Token unit tests pass (jest -c jest.unit.config.js src/token).
  • No visual change.
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Add focused tests covering the reported telemetry values.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds Token telemetry for variant, state, and icon usage without changing rendering.

Changes:

  • Defaults variant to normal.
  • Reports variant, read-only, disabled, and icon presence.
File Description
src/​token/​index.tsx Adds Token telemetry configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/token/index.tsx
Comment on lines +20 to +21
props: { variant, readOnly: props.readOnly, disabled: props.disabled },
metadata: { hasIcon: Boolean(props.icon) },
srungta08
srungta08 previously approved these changes Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (c38721c) to head (0229c91).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5067   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files         996      996           
  Lines       32152    32152           
  Branches    11859    11860    +1     
=======================================
  Hits        31422    31422           
  Misses        723      723           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NathanZlion
NathanZlion requested a review from srungta08 October 20, 2026 12:11
@NathanZlion
NathanZlion added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 347d271 Oct 20, 2026
68 checks passed
@NathanZlion
NathanZlion deleted the chore/token-telemetry-variant branch October 20, 2026 13:49

This branch was successfully deployed

3 active deployments
dev-pages-react16 — 0229c918 Deployed Oct 20, 2026 by NathanZlion via deploy (React 16) / deploy #2867
dev-pages-react18 — 0229c918 Deployed Oct 20, 2026 by NathanZlion via deploy (React 18) / deploy #2867
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.

3 participants