-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(ui): comprehensive combobox component optimization #1041
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c25c982 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
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.
Please check the comments bellow
packages/ui-components/src/components/ComboBox/components/ComboBoxContent.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxContent.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxContent.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxFloatingMenu.tsx
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxInput.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxInput.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxInput.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/ComboBoxInput.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/context/ComboBoxContext.tsx
Outdated
Show resolved
Hide resolved
packages/ui-components/src/components/ComboBox/components/index.ts
Outdated
Show resolved
Hide resolved
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.
It would be helpful to include a test change in one of our real applications: supernova, doop, or heureka—as part of this PR. The example app doesn’t fully replicate the behavior we have across these applications. A small, visual test in a real app will allow us to properly validate the changes. The test change can be removed once it’s been verified visually. It is enough to extend the respective Readme file.
I would suggest that we could close this PR and use as tempalte for implementation on #1071 ticket |
Summary
This PR introduces a comprehensive refactoring of the combobox component to improve performance, maintainability, and code organization through extensive modularization and optimization.
Changes Made
Performance Optimizations
useState
anduseEffect
patterns that were causing performance bottlenecksCode Organization & Modularity
Custom hooks extraction: Broke down the monolithic combobox into focused, reusable custom hooks:
Sub-component extraction: Separated complex component into smaller, focused sub-components
Type definitions: Extracted reusable TypeScript types for better type safety
Developer Experience Improvements
Technical Details
The refactoring follows modern React patterns and best practices:
Testing
All existing functionality has been preserved while improving the underlying architecture. The component maintains the same public API ensuring backward compatibility.
Files Changed
This refactoring significantly improves code maintainability, performance, and developer experience while maintaining full backward compatibility.
Related Issues
Screenshots (if applicable)
Testing Instructions
pnpm i
pnpm TASK
Checklist
PR Manifesto
Review the PR Manifesto for best practises.