-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(core): consolidate button styles files and remove chonk naming #105576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
natemoo-re
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the DO_NOT_USE_getChonkButtonStyles function!
| ...DO_NOT_USE_getButtonStyles({ | ||
| ...p, | ||
| disabled: p.isDisabled, | ||
| priority: p.isSelected && p.priority === 'primary' ? 'primary' : 'default', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The call to DO_NOT_USE_getButtonStyles is missing the required busy and borderless properties, which will cause a TypeScript compilation error.
Severity: HIGH | Confidence: High
🔍 Detailed Analysis
The call to the function DO_NOT_USE_getButtonStyles within segmentedControl.chonk.tsx does not match its expected signature. The function's parameter type requires busy and borderless properties, but the current implementation fails to provide them. The object passed to the function is constructed by spreading props p, which do not contain these required keys. This discrepancy will result in a TypeScript compilation error, preventing the code from being built successfully.
💡 Suggested Fix
Update the object passed to DO_NOT_USE_getButtonStyles to include the missing required properties. You should add default values for busy and borderless to the object literal to satisfy the function's type signature.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: static/app/components/core/segmentedControl/segmentedControl.chonk.tsx#L78-L81
Potential issue: The call to the function `DO_NOT_USE_getButtonStyles` within
`segmentedControl.chonk.tsx` does not match its expected signature. The function's
parameter type requires `busy` and `borderless` properties, but the current
implementation fails to provide them. The object passed to the function is constructed
by spreading props `p`, which do not contain these required keys. This discrepancy will
result in a TypeScript compilation error, preventing the code from being built
successfully.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8191511
Summary
Consolidates
button/styles.chonk.tsxintobutton/styles.tsxand removes chonk naming prefixes.Changes
styles.chonk.tsxtostyles.tsxChonkButtonType→ButtonTypechonkPriorityToType→priorityToTypechonkElevation→elevationchonkHoverElevation→hoverElevationgetChonkButtonTheme→getButtonThemegetChonkButtonSizeTheme→getButtonSizeThemebutton.tsxlinkButton.tsxsegmentedControl.chonk.tsxstyles.chonk.tsxTest plan