-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(codecov): Fix line coverage legend edge cases and coloring #102742
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
Conversation
static/app/components/events/interfaces/crashContent/exception/content.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/interfaces/crashContent/exception/lineCoverageLegend.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/interfaces/crashContent/exception/lineCoverageLegend.tsx
Outdated
Show resolved
Hide resolved
| 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}; |
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.
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}; |
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.
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}; |
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.
Same comment here. Please use theme.token.border.warning
| const Wrapper = styled('div')` | ||
| margin: ${p => p.theme.space.xl} 0 ${p => p.theme.space.xs} 0; | ||
| `; |
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.
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.
| 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.
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.
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}; |
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.
use tokens.border
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.
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}; |
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.
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}; |
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.
use tokens.border
| const RowWrapper = styled(Flex)` | ||
| margin: ${p => p.theme.space.xl} 0 ${p => p.theme.space.xs} 0; | ||
| `; |
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.
This was the better way to handle the wrapper requirement at the call site
static/app/components/events/interfaces/frame/contextLineNumber.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/interfaces/frame/contextLineNumber.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/interfaces/frame/contextLineNumber.tsx
Outdated
Show resolved
Hide resolved
static/app/components/events/interfaces/crashContent/exception/lineCoverageLegend.tsx
Show resolved
Hide resolved
JonasBa
left a comment
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.
Nice, that is much cleaner 🥇
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" />
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" />
Followup to #102450 to fix edge cases of when pills have long, individual text that doesn't wrap.

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:


Normal case: