-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
feat: redesign labels #31575
base: master
Are you sure you want to change the base?
feat: redesign labels #31575
Conversation
Realign labels to look and feel closer to native AntD while integrating the theme colors. As part of this PR: - modify <Label> to look and feel like native AntD - adjust theme colors for primary/secondary/grayscale to align brightness-wise, mostly so that `.light2` lines up across the board - Created a reusable label for DatasetTypeLabel and use it it CRUD list view - Creating a PublishedLabel to use for dashboard in header + CRUD - Improvements to storybooks: theme color to line up side by side - Improvement to Label storybook, more interactive
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment
|
/testenv up |
@mistercrunch Processing your ephemeral environment request here. |
@mistercrunch Ephemeral environment spinning up at http://54.244.170.62:8080. Credentials are |
@kasiazjc you might be interested in this |
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.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Fix Detected |
---|---|---|
Non-functional hover state ▹ view | ||
Invalid Color Format in Text Label Styling ▹ view | ||
Brittle icon fix using CSS hack ▹ view |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/components/Timer/index.tsx | ✅ |
superset-frontend/src/components/CachedLabel/index.tsx | ✅ |
superset-frontend/src/components/Icons/Icon.tsx | ✅ |
superset-frontend/src/components/Label/reusable/PublishedLabel.tsx | ✅ |
superset-frontend/src/components/Label/reusable/DatasetTypeLabel.tsx | ✅ |
superset-frontend/packages/superset-ui-core/src/style/index.tsx | ✅ |
superset-frontend/src/dashboard/components/PublishedStatus/index.tsx | ✅ |
superset-frontend/src/components/Label/Label.stories.tsx | ✅ |
superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx | ✅ |
superset-frontend/src/components/Label/index.tsx | ✅ |
superset-frontend/src/components/AlteredSliceTag/index.tsx | ✅ |
superset-frontend/src/pages/DashboardList/index.tsx | ✅ |
superset-frontend/src/pages/DatasetList/index.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Need a new review? Comment
/korbit-review
on this PR and I'll review your latest changes.Korbit Guide: Usage and Customization
Interacting with Korbit
- You can manually ask Korbit to review your PR using the
/korbit-review
command in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-description
command in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolve
command in any comment on your PR.- Chat with Korbit on issues we post by tagging @korbit-ai in your reply.
- Help train Korbit to improve your reviews by giving a 👍 or 👎 on the comments Korbit posts.
Customizing Korbit
- Check out our docs on how you can make Korbit work best for you and your team.
- Customize Korbit for your organization through the Korbit Console.
Current Korbit Configuration
General Settings
Setting Value Review Schedule Automatic excluding drafts Max Issue Count 10 Automatic PR Descriptions ❌ Issue Categories
Category Enabled Naming ✅ Database Operations ✅ Documentation ✅ Logging ✅ Error Handling ✅ Systems and Environment ✅ Objects and Data Structures ✅ Readability and Maintainability ✅ Asynchronous Processing ✅ Design Patterns ✅ Third-Party Libraries ✅ Performance ✅ Security ✅ Functionality ✅ Feedback and Support
Note
Korbit Pro is free for open source projects 🎉
Looking to add Korbit to your team? Get started with a free 2 week trial here
const [hovered] = useState(false); | ||
|
||
const labelType = hovered ? 'primary' : 'default'; |
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.
Non-functional hover state
Tell me more
What is the issue?
The hovered state is maintained but the mouse events (onMouseOver and onMouseOut) that would update it have been removed, making the hover effect non-functional.
Why this matters
The label will always remain in the 'default' state since the hovered state can never change to true, breaking the intended hover interaction functionality.
Suggested change
Either remove the unused hover state logic completely:
const labelType = 'default';
Or restore the mouse event handlers:
const [hovered, setHovered] = useState(false);
// ... in Label component:
onMouseOver={() => setHovered(true)}
onMouseOut={() => setHovered(false)}
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
<h3> | ||
text.label: <code>{colors.text.label}</code> | ||
</h3> | ||
<div style={{ color: `#${colors.text.label}` }}> |
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.
Invalid Color Format in Text Label Styling
Tell me more
What is the issue?
The code incorrectly prepends '#' to the color value from colors.text.label, which likely already includes the '#' prefix, resulting in an invalid color format.
Why this matters
This will cause the text to be rendered with an invalid color value, making it invisible or using the browser's default color instead of the intended theme color.
Suggested change
Remove the '#' prefix: style={{ color: colors.text.label }}
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
@@ -36,6 +36,10 @@ const AntdIconComponent = ({ | |||
|
|||
export const StyledIcon = styled(AntdIconComponent)<IconType>` | |||
${({ iconColor }) => iconColor && `color: ${iconColor};`}; | |||
span { | |||
// Hack to fix issues with some icons | |||
line-height: 0px !important; |
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.
Brittle icon fix using CSS hack
Tell me more
What is the issue?
Using !important and a hack to fix icon issues could lead to unintended side effects with different icon sets or future updates.
Why this matters
This brittle solution might break when new icons are added or when the underlying icon library is updated, potentially causing visual inconsistencies.
Suggested change
Investigate the root cause of the icon alignment issues and implement a more robust solution, possibly by properly configuring the icon component's baseline alignment or using proper spacing properties.
Realign labels to look and feel closer to native AntD while integrating the theme colors.
As part of this PR:
.light2
lines up across the boardlabel storybook
dashboard header
crud view datasets
crud view dashboards
explore