Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: resolve <Badge /> incorrect sizes - #22539

Merged
jakehwll merged 9 commits into
mainfrom
jakehwll/badge-refactor
Apr 9, 2026
Merged

fix: resolve <Badge /> incorrect sizes#22539
jakehwll merged 9 commits into
mainfrom
jakehwll/badge-refactor

Conversation

@jakehwll

@jakehwll jakehwll commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

This pull-request makes a few changes to our <Badge /> component to bring it inline with Figma.

  • Added all variants to the stories of Figma (they can vary per badge-type, so its better we track everything).
  • Removed the border variant of the component, border variants should be on all sm and md.
  • Added a hover effect to the default variant (per-design).
  • Resolved issue with sizings of xs and sm plus resolved iconography.
  • Resolved issue with icons not showing at all on xs variants.

@jakehwll
jakehwll marked this pull request as ready for review March 3, 2026 05:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95e695cfb6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread site/src/components/Badge/Badge.tsx Outdated
@github-actions github-actions Bot added the stale This issue is like stale bread. label Mar 11, 2026
@github-actions github-actions Bot closed this Mar 14, 2026
@jakehwll jakehwll reopened this Apr 6, 2026
@jakehwll jakehwll removed the stale This issue is like stale bread. label Apr 6, 2026

@jaaydenh jaaydenh 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.

Code Review

🤖 Generated with Coder Agents

Overall this is a good cleanup — removing the border variant, normalizing icon sizes, and bringing stories in line with Figma. A few things to address:

Issues

1. Unconditional hover on default creates a redundant compound variant

The default variant now bakes in hover:bg-surface-tertiary:

default: "... hover:bg-surface-tertiary",

But there is still a compoundVariant that applies the same class only when hover: true:

{ hover: true, variant: "default", class: "hover:bg-surface-tertiary" },

This means every default badge now changes background on hover, regardless of the hover prop. If that is the design intent, the compound variant is dead code and should be removed. If the intent was to only add the hover effect when hover={true}, the class should stay only in the compound variant.

2. xs size border-0 vs variant border border-solid — fragile override

xs applies border-0, but every variant (including default) now applies border border-solid. In Tailwind v3, which class wins depends on their order in the generated stylesheet, not in the class attribute. This works today but is fragile. Consider either:

  • Removing the explicit border border-solid from variants (the base already has border), or
  • Using a compound variant for xs to explicitly remove borders for each applicable variant.

3. Icon size downgrade for md

md changed from [&_svg]:size-icon-sm (1.125rem/18px) to [&_svg]:size-icon-xs (0.875rem/14px). This is a ~22% reduction. All three sizes now use the same icon size (icon-xs), which seems intentional per Figma. Just flagging in case md badges with icons (e.g. TagInput) look noticeably smaller — worth a quick visual check.

Nits

  • Warning/Destructive xs story has icon after text, while sm/md have icon before text. Intentional per-design, or a typo in the stories?
  • Missing purple and magenta stories — the PR says it tracks all variants from Figma but these two are not covered.
  • font-normal on md will override the fontWeight: "500" baked into the custom text-xs fontSize definition in tailwind.config.js. Just making sure that's the intent since the old md used font-medium (500).

@jakehwll
jakehwll requested a review from jaaydenh April 6, 2026 18:18
Comment thread site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx
Comment thread site/src/components/Badges/Badges.tsx

@jaaydenh jaaydenh 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.

Did something change regarding the designs of badges and their borders? When I look in Figma, atleast for licenses and dynamic paramters I wasn't aware of any changes.

@jakehwll

jakehwll commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

Did something change regarding the designs of badges and their borders? When I look in Figma, atleast for licenses and dynamic paramters I wasn't aware of any changes.

Good old, border-solid being required. That was incorrectly removed, should be good to go now. xs and sm look so similar I thought that these were just incorrect in the first place.

@jakehwll
jakehwll requested a review from jaaydenh April 8, 2026 17:40
@jakehwll
jakehwll merged commit 2e6fdf2 into main Apr 9, 2026
27 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 9, 2026
@jakehwll
jakehwll deleted the jakehwll/badge-refactor branch April 9, 2026 09:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants