fix(Label): use correct color for label component#38707
fix(Label): use correct color for label component#38707innovark37 wants to merge 2 commits intoapache:masterfrom
Conversation
Code Review Agent Run #c30fc6Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Sequence DiagramThis PR fixes the Label component to use the theme semantic text color instead of the active color when rendering label text. The core flow remains the same, but the final text color source is now correct for custom themes. sequenceDiagram
participant Page
participant Label
participant Theme
participant ColorVariants
Page->>Label: Render label with variant
Label->>Theme: Read current theme
Label->>ColorVariants: Resolve variant colors
ColorVariants-->>Label: Return text border and background colors
Label-->>Page: Render label text with text color
Generated by CodeAnt AI |
There was a problem hiding this comment.
Pull request overview
This PR corrects the Label component’s text color to use the theme’s semantic *Text token instead of *Active, ensuring custom themes render label text with the intended color across the app.
Changes:
- Update
Labeltext color to usebaseColor.textrather thanbaseColor.active.
You can also share your feedback on Copilot code review. Take the survey.
| const baseColor = getColorVariants(theme, type); | ||
| const color = baseColor.active; | ||
| const color = baseColor.text; | ||
| const borderColor = baseColor.border; |
|
The suggestion to add a focused unit test is solid—it directly addresses the regression risk by asserting the superset-frontend/packages/superset-ui-core/src/components/Label/tests/index.test.tsx |
|
@msyavuz here the screenshots from storybook with applied superset default and dark themes. |




User description
SUMMARY
Labels were using
baseColor.activefor text color instead ofbaseColor.text, causing incorrect text color to be applied across all label types.TESTING INSTRUCTIONS
activeandtextcolors differ for semantic variants (e.g. setcolorSuccessTextto green andcolorSuccessActiveto a darker shade).Labelcomponents (e.g. Explore, SQL Lab).textcolor and NOT theactivecolor.ADDITIONAL INFORMATION
CodeAnt-AI Description
Fix label text color to use the theme's semantic text color
What Changed
Impact
✅ Clearer label text✅ Accurate theme colors for labels with custom themes✅ Fewer visual inconsistencies in UI💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.