refactor(sandbox-preview): extract param label badge styling to constant - #5071
Open
pedrofrxncx wants to merge 1 commit into
Open
refactor(sandbox-preview): extract param label badge styling to constant#5071pedrofrxncx wants to merge 1 commit into
pedrofrxncx wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extract the repeated
rounded-sm bg-violet-500/15 px-1 py-0.5 text-[12px] text-violet-600 dark:text-violet-400class string into aPARAM_LABEL_BADGEconstant inpath-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
cn()utility-4 / +7net change (8 lines changed total, -11 bytes overall); extracts one unified source of truthbun run fmtpasses;bunx tsc --noEmitpasses in apps/mesh; related path-param-picker tests pass (40 tests)Technical details
The constant consolidation:
cn(PARAM_LABEL_BADGE, ...)to compose base badge with variant classes (e.g.,hover:bg-violet-500/25,font-mono)Summary by cubic
Extracted the param label badge styles into a
PARAM_LABEL_BADGEconstant inpath-param-picker-chip.tsxto 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.