Skip to content

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Jan 27, 2026

Run flex and container codemod on orphaned components

@JonasBa JonasBa requested a review from a team January 27, 2026 04:11
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 27, 2026
Fixes three issues introduced by the Container codemod:

1. keyValueData/index.tsx: Renamed imported Container to LayoutContainer
   to avoid naming conflict with local Container component

2. timeline/index.tsx: Renamed imported Container to LayoutContainer
   to avoid naming conflict with local styled Container component

3. scoreCard.tsx: Converted ScoreWrapper back to a styled component
   to allow styled-component interpolation in other files (projectCard.tsx)
Addresses issues from Cursor Bugbot review where the Container codemod
lost important styling properties:

- ScoreWrapper: Use Flex with align="baseline" and maxWidth="100%"
- SectionSeparator: Add display="none" for proper CSS override behavior
- SearchWrapper: Add container query to hide at 500px width
- IconContainer: Use Grid component for proper layout
- PlaceholderLink: Add display="inline-block" for minHeight to work
- Details span: Add display="inline-block" for width to work

export const ScoreWrapper = styled((props: FlexProps<'div'>) => {
return <Flex align="baseline" maxWidth="100%" {...props} />;
return <Flex {...props} align="baseline" maxWidth="100%" />;
Copy link
Contributor

Choose a reason for hiding this comment

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

Props ordering change breaks consumer overrides

Medium Severity

The prop ordering in ScoreWrapper was reversed, changing from <Flex align="baseline" maxWidth="100%" {...props} /> to <Flex {...props} align="baseline" maxWidth="100%" />. This prevents consumers from overriding align or maxWidth via props, whereas previously they could. This is also inconsistent with other similar changes in this PR (e.g., sidebarSection.tsx, layouts/thirds.tsx) where spread props come last to allow overrides.

Fix in Cursor Fix in Web

Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent swap the order

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

<StyledActivityBubble {...bubbleProps}>
{header && (
<ActivityHeader>
<ActivityHeaderContent>{header}</ActivityHeaderContent>
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1} here

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

>
{showLoading ? (
<SeerContent>
<Stack flex="1">
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1} in the instances in this file

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web


return (
<Wrapper>
<Container flex="1" padding="2xl">
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1}

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

Co-authored-by: jonas.badalic <jonas.badalic@sentry.io>
<Flex align="center" gap="md">
<Heading as="h2">{t('Builds (%s)', buildDetails.length)}</Heading>
<SelectContainer>
<Container flex="1" maxWidth="300px">
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1}

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

return (
<SessionPanelItem>
<IpAndLocation>
<Container flex="1">
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1]

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

</Fragment>
) : (
<Heading>{t('Organizations')}</Heading>
<Container flex="1">{t('Organizations')}</Container>
Copy link
Member Author

Choose a reason for hiding this comment

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

flex={1}


{body && <BodyWrapper>{body}</BodyWrapper>}
{body && (
<Container flex="1" margin="0 0 2xl">
Copy link
Member Author

Choose a reason for hiding this comment

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

@cursoragent use flex={1}

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking a look!

Open in Cursor Open in Web

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

{header && (
<ActivityHeader>
<ActivityHeaderContent>{header}</ActivityHeaderContent>
<Container flex="1">{header}</Container>
Copy link
Contributor

Choose a reason for hiding this comment

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

String "1" used instead of number for flex prop

Medium Severity

The codemod converted flex: 1 CSS to flex="1" (string) instead of flex={1} (number) in multiple locations. This affects Container and Stack components where the flex prop expects a number. The string value may cause incorrect flex behavior depending on how the component processes the prop. This occurs in index.tsx, askSeerPollingComboBox.tsx (5 instances), redirectDeprecatedProjectRoute.tsx, pullRequestDetailsSizeContent.tsx, and feedbackModal.tsx.

Additional Locations (2)

Fix in Cursor Fix in Web

</Fragment>
) : (
<Heading>{t('Organizations')}</Heading>
<Container flex="1">{t('Organizations')}</Container>
Copy link
Contributor

Choose a reason for hiding this comment

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

Additional flex="1" instances missed in settings files

Medium Severity

Additional instances of flex="1" (string) instead of flex={1} (number) were introduced in settings-related files. In accountNotificationFineTuning.tsx, sessionRow.tsx, and settingsPageHeader.tsx (two instances at lines 54 and 67), the codemod incorrectly converted the CSS flex: 1 to a string prop instead of a numeric prop. These follow the same pattern as previously reported but were in different files.

Additional Locations (2)

Fix in Cursor Fix in Web

<Container as="span" key={text}>
<ProvidedFormattedQuery query={text} />
</FormattedQueryWrapper>
</Container>
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing display inline-block style in queryTokens conversion

Low Severity

The FormattedQueryWrapper styled component originally had display: inline-block, but the replacement Container as="span" doesn't preserve this styling. A span defaults to display: inline, which behaves differently from inline-block for box model properties like width, height, and vertical margin/padding. This could cause visual regression in how the formatted query tokens are rendered.

Fix in Cursor Fix in Web

`;
export function Content(props: ContainerProps<'div'>) {
return <Container marginTop="md" {...props} />;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Styled extensions of converted components now create nested structure

Medium Severity

Converting SidebarSection.Wrap and SidebarSection.Content from styled components to function components breaks existing styled() extensions in groupSidebar.tsx and releaseStats.tsx. Previously, styled(SidebarSection.Wrap) would extend and override the base styles in a single element. Now it creates a nested structure where the outer styled wrapper has the override styles but the inner Container still applies its own marginBottom="3xl" or marginTop="md", causing both margins to be present instead of one overriding the other.

Additional Locations (1)

Fix in Cursor Fix in Web

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

3 participants