Skip to content

refactor(sandbox-preview): extract param label badge styling to constant - #5071

Open
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/param-label-badge-extract-w2
Open

refactor(sandbox-preview): extract param label badge styling to constant#5071
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/param-label-badge-extract-w2

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extract the repeated rounded-sm bg-violet-500/15 px-1 py-0.5 text-[12px] text-violet-600 dark:text-violet-400 class string into a PARAM_LABEL_BADGE constant in path-param-picker-chip.tsx. Both the button chip (line 270) and the modal header badge (line 297) use identical base styling—consolidating reduces duplication and ensures visual consistency across both usages.

Verification

  • Behavior-preserving: visual rendering and interaction unchanged; styles applied identically via cn() utility
  • -4 / +7 net change (8 lines changed total, -11 bytes overall); extracts one unified source of truth
  • bun run fmt passes; bunx tsc --noEmit passes in apps/mesh; related path-param-picker tests pass (40 tests)

Technical details

The constant consolidation:

  • Eliminates copy-pasted styling strings across two JSX nodes
  • Uses cn(PARAM_LABEL_BADGE, ...) to compose base badge with variant classes (e.g., hover:bg-violet-500/25, font-mono)
  • No functional changes; same CSS classes rendered in the same order

Summary by cubic

Extracted the param label badge styles into a PARAM_LABEL_BADGE constant in path-param-picker-chip.tsx to remove duplication and keep the chip and modal badge consistent. No behavior or visual changes.

Written for commit d81a2b5. Summary will update on new commits.

Review in cubic

Extract the repeated 'rounded-sm bg-violet-500/15 px-1 py-0.5 text-[12px] text-violet-600 dark:text-violet-400' class string into a PARAM_LABEL_BADGE constant. Both the button chip and the modal header badge use identical base styling; consolidating it reduces duplication and ensures visual consistency.

-4 / +7 (net -11 bytes, one unified source of truth for the badge style)
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.

1 participant