Skip to content

Conversation

@calvin-codecov
Copy link
Contributor

Followup to #102450 to fix edge cases of when pills have long, individual text that doesn't wrap.
image

Solution: drop the legend on to its own line below and shrink a little bit to prevent taking away too much attention away from the pills.

Small screen width with wrapping:
Screenshot 2025-11-04 at 3 55 08 PM
Normal case:
Screenshot 2025-11-04 at 3 55 21 PM

@calvin-codecov calvin-codecov requested a review from a team as a code owner November 5, 2025 00:02
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 5, 2025
const CoveredLine = styled(Text)`
padding-right: ${p => p.theme.space.md};
border-right: 3px solid ${p => p.theme.tokens.content.success};
border-right: 3px solid ${p => p.theme.green400};
Copy link
Member

Choose a reason for hiding this comment

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

We have tokens.border.success for these values and you should use those. theme.greenxxx colors and the rest were never used for borders and will be removed in the near future

const UncoveredLine = styled(Text)`
padding-right: ${p => p.theme.space.md};
border-right: 3px solid ${p => p.theme.tokens.content.danger};
border-right: 3px solid ${p => p.theme.red300};
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here. Use theme.tokens.border

const PartiallyCoveredLine = styled(Text)`
padding-right: ${p => p.theme.space.md};
border-right: 3px dashed ${p => p.theme.tokens.content.warning};
border-right: 3px dashed ${p => p.theme.yellow300};
Copy link
Member

Choose a reason for hiding this comment

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

Same comment here. Please use theme.token.border.warning

Comment on lines 108 to 110
const Wrapper = styled('div')`
margin: ${p => p.theme.space.xl} 0 ${p => p.theme.space.xs} 0;
`;
Copy link
Member

Choose a reason for hiding this comment

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

This is a harmful pattern because you are essentially building margin into a component, which can be done at the instance where the component is used. Building it into a component like this is going to make it very hard to use in different layouts.

Suggested change
const Wrapper = styled('div')`
margin: ${p => p.theme.space.xl} 0 ${p => p.theme.space.xs} 0;
`;

use <Container margin="xl 0"> if you have to at the appropriate call sites.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You make a good point. I was just reverting it back to what it was before I made any changes but we should modify this.

&.covered .line-number {
background: ${p => p.theme.green100};
border-right: 3px solid ${p => p.theme.tokens.content.success};
border-right: 3px solid ${p => p.theme.green400};
Copy link
Member

Choose a reason for hiding this comment

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

use tokens.border

Copy link
Contributor Author

@calvin-codecov calvin-codecov Nov 6, 2025

Choose a reason for hiding this comment

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

Since the "background" rule right above aims for a more faded, lower numbered value version of the same color, would it be acceptable to use tokens.content.success for the border here and tokens.border.success for the background color? How should we be handling a scenario like this where we have two similar but distinct sets of colors that should work with each other.

&.uncovered .line-number {
background: ${p => p.theme.red100};
border-right: 3px solid ${p => p.theme.tokens.content.danger};
border-right: 3px solid ${p => p.theme.red300};
Copy link
Member

Choose a reason for hiding this comment

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

use tokens.border

&.partial .line-number {
background: ${p => p.theme.yellow100};
border-right: 3px dashed ${p => p.theme.tokens.content.warning};
border-right: 3px dashed ${p => p.theme.yellow300};
Copy link
Member

Choose a reason for hiding this comment

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

use tokens.border

Comment on lines -415 to -417
const RowWrapper = styled(Flex)`
margin: ${p => p.theme.space.xl} 0 ${p => p.theme.space.xs} 0;
`;
Copy link
Member

Choose a reason for hiding this comment

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

This was the better way to handle the wrapper requirement at the call site

Copy link
Member

@JonasBa JonasBa left a comment

Choose a reason for hiding this comment

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

Nice, that is much cleaner 🥇

@calvin-codecov calvin-codecov merged commit 47dd7cf into master Nov 7, 2025
48 checks passed
@calvin-codecov calvin-codecov deleted the cy/move_coverage_legend branch November 7, 2025 23:24
Jesse-Box pushed a commit that referenced this pull request Nov 12, 2025
Followup to #102450 to fix edge
cases of when pills have long, individual text that doesn't wrap.
<img width="2264" height="792" alt="image"
src="https://github.com/user-attachments/assets/5a2151ec-c752-4e88-9611-9b2a6698535d"
/>


Solution: drop the legend on to its own line below and shrink a little
bit to prevent taking away too much attention away from the pills.

Small screen width with wrapping:
<img width="512" height="385" alt="Screenshot 2025-11-04 at 3 55 08 PM"
src="https://github.com/user-attachments/assets/ca46f2af-9dac-4313-a70e-cbb6280778e1"
/>
Normal case:
<img width="917" height="410" alt="Screenshot 2025-11-04 at 3 55 21 PM"
src="https://github.com/user-attachments/assets/8dd9f47f-33a3-4508-8153-62278d1f883e"
/>
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
Followup to #102450 to fix edge
cases of when pills have long, individual text that doesn't wrap.
<img width="2264" height="792" alt="image"
src="https://github.com/user-attachments/assets/5a2151ec-c752-4e88-9611-9b2a6698535d"
/>


Solution: drop the legend on to its own line below and shrink a little
bit to prevent taking away too much attention away from the pills.

Small screen width with wrapping:
<img width="512" height="385" alt="Screenshot 2025-11-04 at 3 55 08 PM"
src="https://github.com/user-attachments/assets/ca46f2af-9dac-4313-a70e-cbb6280778e1"
/>
Normal case:
<img width="917" height="410" alt="Screenshot 2025-11-04 at 3 55 21 PM"
src="https://github.com/user-attachments/assets/8dd9f47f-33a3-4508-8153-62278d1f883e"
/>
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.

4 participants