fix(theme): ensure colorLink follows colorPrimary when not explicitly set - #38517
Conversation
|
Bito Automatic Review Failed - Technical Failure |
Code Review Agent Run #c67624Actionable 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 |
Code Review Agent Run #7415d5Actionable Suggestions - 0Additional Suggestions - 1
Review 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 updates theme creation and configuration so that when a user sets a primary color but does not set a link color, the link color is derived from the primary color before Ant Design tokens are computed, while still respecting any explicit link color overrides. sequenceDiagram
participant Caller
participant Theme
participant AntdTokens
participant UI
Caller->>Theme: Create or update theme with user and base config
Theme->>Theme: Merge base and user config
Theme->>Theme: If primary set and link missing, set link to primary
Theme->>AntdTokens: Compute Ant Design tokens from updated config
AntdTokens-->>Theme: Return design tokens including link color
Theme-->>UI: Provide theme where links follow primary color
Generated by CodeAnt AI |
Sequence DiagramThis PR updates theme configuration so that when a theme overrides the primary color without explicitly setting a link color, the link color is derived from the primary color both during initial theme creation and later configuration updates. sequenceDiagram
participant Caller
participant Theme
participant AntDesign
Caller->>Theme: fromConfig(user theme, base theme)
Theme->>Theme: Merge base and user themes
Theme->>Theme: If primary set and link missing, set link to primary
Theme-->>Caller: Return Theme instance with updated tokens
Caller->>Theme: setConfig(new theme config)
Theme->>Theme: Normalize config and default link from primary if missing
Theme->>AntDesign: Compute design tokens
AntDesign-->>Theme: Return computed tokens
Generated by CodeAnt AI |
|
🎪 Showtime deployed environment on GHA for 4dd3d73 • Environment: http://35.88.81.211:8080 (admin/admin) |
|
The testing for this ticket was completed. The application is working as expected. Ant design is working correctly when the user uses the primary color changed. Scenario Steps1)Open the Ant Design Theme Builder. Expected
Ant Design JSON - Just Primary
Ant Design JSON - Color Link
Evidence |



User description
SUMMARY
This PR fixes an issue where Superset themes generated from the Ant Design Theme Builder did not correctly apply link colors when only colorPrimary was overridden.
In Ant Design v5, colorLink is derived from colorInfo, not colorPrimary. When a user theme only defined colorPrimary, Superset rendered links using the base theme's default teal color instead of the intended palette. If colorPrimary is provided but colorLink is not, colorLink is derived from colorPrimary before computing Ant Design tokens.
After merging the base theme and user config, if the user set colorPrimary but not colorLink, the merged colorLink is updated to match the merged colorPrimary.
Explicit colorLink values provided by the user are always respected. The derivation only applies when colorLink is absent.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE:

AFTER:

TESTING INSTRUCTIONS
1)Open the Ant Design Theme Builder.
2)Set the Primary Color to a custom color (e.g., #eb2f96).
3)Export the theme config
4)Apply this configuration as a Superset theme.
5)Navigate to pages containing links (e.g., dashboards list, charts list).
Verify that:
6)Links follow the primary color palette instead of appearing teal/green.
7)Explicitly setting colorLink in the theme config still overrides the derived value.
8} If we choose to "inherit" link and info color in ant design theme builder, it should be respected.
ADDITIONAL INFORMATION
CodeAnt-AI Description
Ensure links use primary color when only primary is set in theme
What Changed
Impact
✅ Links match the chosen brand/primary color✅ Consistent theme appearance after importing/exporting Ant Design themes✅ Explicit link color overrides are preserved💡 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.