refactor(theming): Fixes to previously migrated components#32845
Conversation
|
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
|
There was a problem hiding this comment.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Inefficient CSS Transition ▹ view | ✅ Fix detected |
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx | ✅ |
| superset-frontend/src/components/PageHeaderWithActions/index.tsx | ✅ |
| superset-frontend/src/components/Menu/index.tsx | ✅ |
| superset-frontend/src/components/Modal/Modal.tsx | ✅ |
| superset-frontend/src/components/DropdownContainer/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-reviewon 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-reviewcommand in a comment at the root of your PR.- You can ask Korbit to generate a new PR description using the
/korbit-generate-pr-descriptioncommand in any comment on your PR.- Too many Korbit comments? I can resolve all my comment threads if you use the
/korbit-resolvecommand in any comment on your PR.- On any given comment that Korbit raises on your pull request, you can have a discussion with Korbit by replying to the comment.
- 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.
Feedback and Support
| bottom: ${theme.sizeUnit / 4}px; | ||
| left: 0; | ||
| transform: scale(0); | ||
| transition: 0.2s all ease-out; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
What are these extra styles for?
There was a problem hiding this comment.
I provided some screenshots. These styles are here to simplify the hover effects of MainNav.
| maxHeight: `${MAX_HEIGHT}px`, | ||
| overflow: showOverflow ? 'auto' : 'visible', | ||
| }, | ||
| }} |
There was a problem hiding this comment.
overlayInnerStyle is deprecated right?
| overlayClassName="column-config-popover" | ||
| styles={{ body: { width, height } }} | ||
| rootClassName="column-config-popover" | ||
| > |
There was a problem hiding this comment.
Yes, thought might as well change these
| opacity: 0; | ||
| transform: translateX(-50%); | ||
| transition: all ${({ theme }) => theme.motionDurationMid}s; | ||
| transition: translate ${({ theme }) => theme.motionDurationMid}s; |
There was a problem hiding this comment.
let's use something like that:
const SomeStyledThing=styled.div`
${({ theme }) => css`
padding: ${theme.sizeUnit * 2}px;
border-radius: ${theme.borderRadius}px;
border: 1px solid ${theme.colorPrimary};
`}
`;
There was a problem hiding this comment.
Yeah we can move the theme top level if we use it in multiple instances
| opacity: 0; | ||
| transform: translateX(-50%); | ||
| transition: all ${({ theme }) => theme.motionDurationMid}s; | ||
| transition: translate ${({ theme }) => theme.motionDurationMid}s; |
There was a problem hiding this comment.
Yeah we can move the theme top level if we use it in multiple instances
| position: absolute; | ||
| width: 100%; | ||
| height: 2px; | ||
| background-color: ${theme.colors.primary.base}; |
There was a problem hiding this comment.
I believe this is what we don't want right? With this approach there is no control over this style via the theme configuration. Isn't this supposed to be a vanilla feature? https://ant.design/components/menu#menu-demo-horizontal
There was a problem hiding this comment.
let's get in the habit of using native antd tokens, in this case maybe colorPrimaryBg since it's a background-color (?)
There was a problem hiding this comment.
Fixed! I think this colorPrimaryBorderHover is a better fit because this is used as a border color of MainNav on hover
| transform: translateX(-50%); | ||
| transition: all ${({ theme }) => theme.motionDurationMid}s; | ||
| transition: translate ${({ theme }) => theme.motionDurationMid}s; | ||
| background-color: ${({ theme }) => theme.colorPrimary}; |
There was a problem hiding this comment.
Do we need this background color here? Can't we use vanilla?
There was a problem hiding this comment.
You are right! I can't see the change without this
|
I think I broke (and fixed) something on the base branch, you may need to remerge/rebase |
mistercrunch
left a comment
There was a problem hiding this comment.
LGTM! merging so we can iterate on template_less
SUMMARY
There are some components that were migrated before #31590 that needs checking and small fixes after Ant Design tokens are decoupled from them. This PR aims to provide those fixes.
These components are:
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Changes
MainNav Before:

MainNav After:

PageHeaderWithActions Before:

PageHeaderWithActions After:

TESTING INSTRUCTIONS
Visual testing.
ADDITIONAL INFORMATION