Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Dec 31, 2025

Summary

Consolidates button/styles.chonk.tsx into button/styles.tsx and removes chonk naming prefixes.

Changes

  • Moved all content from styles.chonk.tsx to styles.tsx
  • Renamed functions and types:
    • ChonkButtonTypeButtonType
    • chonkPriorityToTypepriorityToType
    • chonkElevationelevation
    • chonkHoverElevationhoverElevation
    • getChonkButtonThemegetButtonTheme
    • getChonkButtonSizeThemegetButtonSizeTheme
  • Updated imports in:
    • button.tsx
    • linkButton.tsx
    • segmentedControl.chonk.tsx
  • Deleted styles.chonk.tsx

Test plan

  • ✅ Linting passes
  • ✅ Knip passes (no unused exports)
  • ✅ No remaining chonk references (except external dependencies and intentional DO_NOT_USE naming)

@JonasBa JonasBa requested a review from a team as a code owner December 31, 2025 18:13
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 31, 2025
Copy link
Member

@natemoo-re natemoo-re left a 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!

@JonasBa JonasBa enabled auto-merge (squash) January 5, 2026 21:12
Comment on lines +78 to 81
...DO_NOT_USE_getButtonStyles({
...p,
disabled: p.isDisabled,
priority: p.isSelected && p.priority === 'primary' ? 'primary' : 'default',
Copy link

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

@JonasBa JonasBa merged commit b69f2f7 into master Jan 5, 2026
52 checks passed
@JonasBa JonasBa deleted the jb/chonk/button-styles-cleanup branch January 5, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants