-
Notifications
You must be signed in to change notification settings - Fork 15.3k
refactor(Select): Migrate Select component to Ant Design 5 #32514
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(Select): Migrate Select component to Ant Design 5 #32514
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
|
/korbit-review |
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 |
---|---|---|
Typo in property access causing undefined value ▹ view | ✅ | |
Unsafe non-null assertion in mutator call ▹ view | ✅ | |
Ineffective text truncation ▹ view | ✅ | |
Incorrect class name for tag close icon ▹ view |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/components/Select/constants.ts | ✅ |
superset-frontend/src/filters/components/TimeGrain/types.ts | ✅ |
superset-frontend/src/filters/components/TimeColumn/types.ts | ✅ |
superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx | ✅ |
superset-frontend/plugins/plugin-chart-cartodiagram/src/util/controlPanelUtil.tsx | ✅ |
superset-frontend/src/components/Select/CustomTag.tsx | ✅ |
superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx | ✅ |
superset-frontend/src/components/Select/styles.tsx | ✅ |
superset-frontend/src/components/Select/types.ts | ✅ |
superset-frontend/src/components/Select/utils.tsx | ✅ |
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx | ✅ |
superset-frontend/src/components/TableSelector/index.tsx | ✅ |
superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx | ✅ |
superset-frontend/src/explore/components/PropertiesModal/index.tsx | ✅ |
superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx | ✅ |
superset-frontend/src/components/Select/AsyncSelect.tsx | ✅ |
superset-frontend/src/components/Select/Select.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.- 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
superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
Outdated
Show resolved
Hide resolved
@@ -69,7 +55,7 @@ export const customTagRender = (props: CustomTagProps) => { | |||
target.tagName === 'svg' || | |||
target.tagName === 'path' || | |||
(target.tagName === 'span' && | |||
target.className.includes('ant-tag-close-icon')) | |||
target.className.includes('antd5-tag-close-icon')) |
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.
Incorrect class name for tag close icon 
Tell me more
What is the issue?
The class name check for the close icon is incorrect. Ant Design v5 uses 'ant-tag-close-icon' class, not 'antd5-tag-close-icon'.
Why this matters
This will cause the click propagation prevention to fail when clicking the close icon, leading to unexpected behavior where the dropdown opens when attempting to remove a tag.
Suggested change ∙ Feature Preview
Update the class name check to use the correct Ant Design v5 class:
target.className.includes('ant-tag-close-icon')
💬 Chat with Korbit by mentioning @korbit-ai.
@michael-s-molina and @geido put a lot of work into consolidating numerous Select modules into one Super-Duper-Select. I would check with either/both of them regarding any simplification efforts, just in case there are use cases around the intricacies. Of course if AntD now includes the functionality we built around it previously, or there are unnecessary style layers, then yes, let's go as "vanilla" as we can! |
101a0d2
to
3996d69
Compare
1713b6e
to
353e36c
Compare
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 | Status |
---|---|---|
Arbitrary Virtual Scrolling Threshold ▹ view | ✅ Fix detected | |
Inefficient Deep Clone of Entire Metadata ▹ view | 🧠 Not in scope | |
Unreliable Fixed Wait Time ▹ view | 🧠 Incorrect | |
Complex DOM manipulation needs inline explanation ▹ view | 🧠 Not in scope | |
Unexplained magic numbers in padding ▹ view | 🧠 Not in standard | |
Avoid wildcard exports for better API clarity ▹ view | 🧠 Not in scope |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/components/Select/index.tsx | ✅ |
superset-frontend/src/types/TagType.ts | ✅ |
superset-frontend/src/components/Spin/index.tsx | ✅ |
superset-frontend/src/components/index.ts | ✅ |
superset-frontend/src/components/Select/constants.ts | ✅ |
superset-frontend/src/filters/components/TimeGrain/types.ts | ✅ |
superset-frontend/src/filters/components/TimeColumn/types.ts | ✅ |
superset-frontend/src/components/IndeterminateCheckbox/index.tsx | ✅ |
superset-frontend/src/features/reports/ReportModal/styles.tsx | ✅ |
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DatasetSelect.tsx | ✅ |
superset-frontend/src/components/Select/CustomTag.tsx | ✅ |
superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx | ✅ |
superset-frontend/src/GlobalStyles.tsx | ✅ |
superset-frontend/src/components/Icons/AntdEnhanced.tsx | ✅ |
superset-frontend/cypress-base/cypress/e2e/explore/utils.ts | ✅ |
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FilterTitleContainer.tsx | ✅ |
superset-frontend/src/components/CronPicker/CronPicker.tsx | ✅ |
superset-frontend/cypress-base/cypress/utils/index.ts | ✅ |
superset-frontend/src/components/Select/styles.tsx | ✅ |
superset-frontend/src/dashboard/actions/nativeFilters.ts | ✅ |
superset-frontend/src/features/databases/DatabaseModal/DatabaseConnectionForm/EncryptedField.tsx | ✅ |
superset-frontend/src/explore/components/controls/SelectControl.jsx | ✅ |
superset-frontend/src/components/Select/types.ts | ✅ |
superset-frontend/src/components/Select/Select.stories.tsx | ✅ |
superset-frontend/src/features/tags/TagModal.tsx | ✅ |
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx | ✅ |
superset-frontend/src/components/TableSelector/index.tsx | ✅ |
superset-frontend/src/components/Select/utils.tsx | ✅ |
superset-frontend/src/explore/components/PropertiesModal/index.tsx | ✅ |
superset-frontend/src/components/DatabaseSelector/index.tsx | ✅ |
superset-frontend/src/pages/ChartCreation/index.tsx | ✅ |
superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx | ✅ |
superset-frontend/src/features/databases/DatabaseModal/styles.ts | ✅ |
superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx | ✅ |
superset-frontend/src/explore/components/controls/DndColumnSelectControl/ColumnSelectPopover.tsx | ✅ |
superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.jsx | ✅ |
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx | ✅ |
superset-frontend/src/components/Select/AsyncSelect.tsx | ✅ |
superset-frontend/cypress-base/cypress/e2e/dashboard/utils.ts | ✅ |
superset-frontend/src/components/Select/Select.tsx | ✅ |
superset-frontend/cypress-base/cypress/support/directories.ts | ✅ |
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.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.- 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
export * from './types'; | ||
export * from './styles'; | ||
export * from './CustomTag'; | ||
export * from './constants'; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
@@ -122,7 +122,7 @@ export const setInScopeStatusOfFilters = | |||
// need to update native_filter_configuration in the dashboard metadata | |||
const metadata = cloneDeep(getState().dashboardInfo.metadata); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
& .btn-group > .btn { | ||
padding: 5px 10px 6px; | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
const nativeInputValueSetter = Object.getOwnPropertyDescriptor( | ||
window.HTMLInputElement.prototype, | ||
'value', | ||
)?.set; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
tokenSeparators={tokenSeparators} | ||
virtual={fullSelectOptions.length > 20} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
I had to do a ugly workaround for a bug in rc-table which sets removeButton role to "tab". I opened up the issue and the pr for fixing it here: |
isEqual as utilsIsEqual, | ||
getSuffixIcon, | ||
sortComparatorWithSearchHelper, | ||
VIRTUAL_THRESHOLD, |
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 this part of constants? And maybe SELECT_ALL_VALUE
too?
@@ -121,9 +124,11 @@ const Select = forwardRef( | |||
getPopupContainer, | |||
oneLine, | |||
maxTagCount: propsMaxTagCount, | |||
virtual = undefined, | |||
virtualThreshold = VIRTUAL_THRESHOLD, |
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.
Any reasons to pass this as a prop? I think if someone wanted to enable the virtual
mode they can just do it through the virtual
prop.
* the options will be virtualized. | ||
* If the virtual prop is set this will be ignored. | ||
*/ | ||
virtualThreshold?: number; |
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.
As I wrote above I don't think we need a prop for this
? mutator(response.json, value) | ||
: response.json.result; | ||
setOptions(data); | ||
if (value) { |
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.
@msyavuz not sure if this got missed but it seems we might still ignoring null
values with this check which should be valid.
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.
A few nits but looking good overall!
SUMMARY
Migrate Select component to Ant Design 5. Simplifying the Select component in the process is a secondary objective.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:


After:
Before:


After:
Before:


After:
TESTING INSTRUCTIONS
Run the testing suite and do visual testing.
ADDITIONAL INFORMATION