Skip to content

Conversation

@TkDodo
Copy link
Collaborator

@TkDodo TkDodo commented Jul 15, 2025

The ButtonBar component now:

  • takes spacing tokens as value for the gap prop
  • defaults to gap=“md”, as this were most of the usages

That means places where we had <ButtonBar gap=“1”> are now just <ButtonBar>, whereas we need to pass gap=“none” explicitly in places where we want no spacing.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 15, 2025
@TkDodo TkDodo marked this pull request as ready for review July 15, 2025 14:52
@TkDodo TkDodo requested review from a team as code owners July 15, 2025 14:52
@TkDodo TkDodo requested review from a team July 15, 2025 14:52
@TkDodo TkDodo requested review from a team as code owners July 15, 2025 14:52
cursor[bot]

This comment was marked as outdated.

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.

Usage changes all LGTM, just curious about the exact type implementation!

// eslint-disable-next-line boundaries/element-types
import {space} from 'sentry/styles/space';

type Gap = keyof Theme['space'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have our own Space type that doesn't rely on module augmentation from @emotion/react? This will be a large part of our component API surface moving forward.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this just depends where we import theme from. not sure why exactly we augment the emotion types instead of having our own useTheme hook and Theme type 🤷

But yes, we can definitely streamline this type once we have more components that have a prop that needs space

@TkDodo TkDodo merged commit 4447d81 into master Jul 15, 2025
46 checks passed
@TkDodo TkDodo deleted the tkdodo/ref/remove-space-util-from-buttonBar branch July 15, 2025 15:44
@sentry
Copy link

sentry bot commented Jul 17, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

andrewshie-sentry pushed a commit that referenced this pull request Jul 21, 2025
The `ButtonBar` component now:

- takes spacing tokens as value for the `gap` prop
- defaults to `gap=“md”`, as this were most of the usages

That means places where we had `<ButtonBar gap=“1”>` are now just
`<ButtonBar>`, whereas we need to pass `gap=“none”` explicitly in places
where we want no spacing.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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