-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(container) run codemod on orphaned components #107039
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
base: master
Are you sure you want to change the base?
Conversation
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
static/app/components/scoreCard.tsx
Outdated
|
|
||
| export const ScoreWrapper = styled((props: FlexProps<'div'>) => { | ||
| return <Flex align="baseline" maxWidth="100%" {...props} />; | ||
| return <Flex {...props} align="baseline" maxWidth="100%" />; |
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.
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.
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.
@cursoragent swap the order
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.
| <StyledActivityBubble {...bubbleProps}> | ||
| {header && ( | ||
| <ActivityHeader> | ||
| <ActivityHeaderContent>{header}</ActivityHeaderContent> |
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.
@cursoragent use flex={1} here
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.
| > | ||
| {showLoading ? ( | ||
| <SeerContent> | ||
| <Stack flex="1"> |
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.
@cursoragent use flex={1} in the instances in this file
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.
|
|
||
| return ( | ||
| <Wrapper> | ||
| <Container flex="1" padding="2xl"> |
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.
@cursoragent use flex={1}
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.
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"> |
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.
@cursoragent use flex={1}
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.
| return ( | ||
| <SessionPanelItem> | ||
| <IpAndLocation> | ||
| <Container flex="1"> |
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.
@cursoragent use flex={1]
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.
| </Fragment> | ||
| ) : ( | ||
| <Heading>{t('Organizations')}</Heading> | ||
| <Container flex="1">{t('Organizations')}</Container> |
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.
flex={1}
|
|
||
| {body && <BodyWrapper>{body}</BodyWrapper>} | ||
| {body && ( | ||
| <Container flex="1" margin="0 0 2xl"> |
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.
@cursoragent use flex={1}
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.
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.
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> |
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.
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)
| </Fragment> | ||
| ) : ( | ||
| <Heading>{t('Organizations')}</Heading> | ||
| <Container flex="1">{t('Organizations')}</Container> |
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.
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)
| <Container as="span" key={text}> | ||
| <ProvidedFormattedQuery query={text} /> | ||
| </FormattedQueryWrapper> | ||
| </Container> |
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.
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.
| `; | ||
| export function Content(props: ContainerProps<'div'>) { | ||
| return <Container marginTop="md" {...props} />; | ||
| } |
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.
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.
Run flex and container codemod on orphaned components