-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
refactor(Popover): Upgrade Popover to Antd5 #31973
base: master
Are you sure you want to change the base?
refactor(Popover): Upgrade Popover to Antd5 #31973
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.
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 |
---|---|---|
Filter popover z-index issue in full-size mode ▹ view | ✅ | |
Redundant Z-Index Configuration ▹ view | ✅ | |
Unreliable Header Access ▹ view |
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.
Feedback and Support
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/cypress-base/cypress/e2e/dashboard/horizontalFilterBar.test.ts
Outdated
Show resolved
Hide resolved
// for now we're just redirecting | ||
export { Popover as default } from './Popover'; | ||
export interface PopoverProps extends AntdPopoverProps { | ||
forceRender?: boolean; |
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.
What is this for? I don't see forceRender
exposed in the Popover props of Ant Design. Will this have any effect?
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 being used before, I just combined the Popover.tsx
file with the index.tsx
file -> https://github.com/apache/superset/pull/31973/files/18ef69e7e88cc0389c4dd991050e176988acb9e8#diff-575bb0af856e1f113959bcf0ec737a412cb23b3b5ed154012d993d5be95da187
And the forceRender
prop is being used in some places, here's 1 for example: superset/superset-frontend/src/components/DropdownContainer/index.tsx
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.
I am not sure this answers my question. If forceRender
is not an option that Popover
accepts in Ant Design, what is the use of it? Is this actually doing anything? Can you confirm that, please?
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.
The forceRender
option ensures that the Popover’s content is rendered in the DOM even when the Popover is not opened. I verified that it behaves as expected, which confirms that it works even though it isn’t an official prop in Ant Design.
superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/dashboard/components/FiltersBadge/DetailsPanel/index.tsx
Show resolved
Hide resolved
superset-frontend/src/explore/components/DataTableControl/index.tsx
Outdated
Show resolved
Hide resolved
@alexandrusoare regarding Popover.stories.tsx, could you add the default values for TRIGGERS i think 'click, 'top' for PLACEMENTS, and include a state that changes based on the selected triggers? For example, when you click the button, the popover should open, or it should change when the selected trigger is changed, for make it interactive. Recording.2025-01-27.234116.mp4 |
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.
Looks good, minor gripe for me is default exports but i've seen it used in other places so i think it's fine
@@ -181,11 +181,13 @@ const DropdownContainer = forwardRef( | |||
); | |||
|
|||
useLayoutEffect(() => { | |||
if (popoverVisible) { |
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.
should we add it to the dependency array?
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.
No, I don't think so, I added this statement because of a visual bug that was happening in certain cases. And I think that we don't need to recalculate the size when popover is closed .
superset-frontend/src/dashboard/components/nativeFilters/FilterCard/index.tsx
Outdated
Show resolved
Hide resolved
superset-frontend/src/explore/components/controls/MapViewControl/MapViewPopoverContent.tsx
Show resolved
Hide resolved
overlayStyle={{ | ||
width: '240px', | ||
padding: 0, | ||
borderRadius: theme.borderRadius, |
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.
Can we rely on the default borders of Ant Design here? Same with paddings?
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.
SUMMARY
Upgrading Popover component to Antd5.
Fixes #31953
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE
AFTER
BEFORE
AFTER
BEFORE
AFTER
BEFORE
AFTER
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION