Skip to content

Refactor badge props to use BaseBadgeProps - #5419

Closed
MaddipatlaChetan24 wants to merge 1 commit into
uber:mainfrom
MaddipatlaChetan24:patch-7
Closed

MaddipatlaChetan24 wants to merge 1 commit into
uber:mainfrom
MaddipatlaChetan24:patch-7

Conversation

@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor

Fixes #1, Fixes #2

Description

Extracts the fields shared by BadgeProps, NotificationCircleProps,
and HintDotProps (color, hidden, horizontalOffset,
verticalOffset, overrides, children) into a new internal
BaseBadgeProps type, and builds each of the three exported types on
top of it via intersection instead of repeating the six fields
independently in each. content and placement, which are shared by
only two of the three types, stay declared individually on
BadgeProps/NotificationCircleProps rather than being pulled into
the base, since HintDotProps doesn't have them.

BaseBadgeProps is not exported — it's purely an internal
organizational detail, not a new public API surface.

Verified structural equivalence with the TypeScript compiler: wrote a
mutual-assignability check (A extends B ? (B extends A ? ... ))
between the original and refactored versions of all three types and
confirmed it compiles cleanly under tsc --strict, meaning each
refactored type is identical, field-for-field, to what it was before.
No consumer of these types is affected.

Scope

Patch: Cleanup

Refactor BadgeProps, NotificationCircleProps, and HintDotProps to share common fields through BaseBadgeProps.
@MaddipatlaChetan24

Copy link
Copy Markdown
Contributor Author

please check this !!!

@dyesin

dyesin commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR. Before we review it, please note that "check this" isn't a submission we can accept. It hands the verification work to maintainers, and our review time is limited.

We welcome AI-assisted contributions, but you are the author and must stand behind every line. Before requesting review, please:

Run it. Set up the dev environment, run the full test suite, and confirm the change works as intended.
Understand it. Be ready to explain why each change was made and what could break. "The model suggested it" isn't an answer.
Justify it. Describe the actual problem this solves and how you confirmed it's fixed. For performance changes, include evidence.
Test it. Add or update tests following the patterns already used in the repo.
Keep it focused. One concern per PR, with no unrelated edits.

Once you can confirm all of the above in the PR description, we're happy to take a look. Until then, we'll mark this as a draft.

@dyesin dyesin closed this Sep 25, 2026
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.

2 participants