Skip to content

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f521acf
refactor(ui): remove redundant useState and useEffect cases (perf. op…
mark-karnaukh-extern-sap Jun 24, 2025
8e2cbae
refactor(ui): combobox options initialization logic
mark-karnaukh-extern-sap Jun 24, 2025
c006ebd
refactor(ui): memoize context value
mark-karnaukh-extern-sap Jun 24, 2025
3f3372a
refactor(ui): extract combobox options init. logic into custom hook
mark-karnaukh-extern-sap Jun 24, 2025
c3b445a
refactor(ui): extract combobox floating logic into custom hook
mark-karnaukh-extern-sap Jun 24, 2025
3cecaf7
refactor(ui): add description comments and minor fixes
mark-karnaukh-extern-sap Jun 25, 2025
d4e44ef
refactor(ui): optimize options filtering and event handlers (callbacks)
mark-karnaukh-extern-sap Jun 26, 2025
98150e1
Merge branch 'main' into mark-combobox-refactoring
mark-karnaukh-extern-sap Jun 26, 2025
5ac9ef8
refactor(ui): provide debounce delay as a configurable parameter
mark-karnaukh-extern-sap Jun 26, 2025
4eef91f
refactor(ui): extract combobox filtering logic into custom hook
mark-karnaukh-extern-sap Jun 26, 2025
9f096e9
refactor(ui): extract combobox state management logic into custom hook
mark-karnaukh-extern-sap Jun 26, 2025
a8a4135
refactor(ui): extract combobox context management logic
mark-karnaukh-extern-sap Jun 26, 2025
5b2db7b
refactor(ui): add utility to handle multiple tw css classes merge
mark-karnaukh-extern-sap Jun 27, 2025
34648bb
refactor(ui): add explanation comments
mark-karnaukh-extern-sap Jun 27, 2025
925ef6b
refactor(ui): move utils to src root
mark-karnaukh-extern-sap Jun 30, 2025
095e349
refactor(ui): extract combobox validation logic into custom hook
mark-karnaukh-extern-sap Jun 30, 2025
ae7ce8f
refactor(ui): implement style managment approach
mark-karnaukh-extern-sap Jun 30, 2025
9616930
refactor(ui): extract re-usable types
mark-karnaukh-extern-sap Jun 30, 2025
51a06de
refactor(ui): extract sub-components
mark-karnaukh-extern-sap Jul 1, 2025
377fd50
Merge branch 'main' into mark-combobox-refactoring
mark-karnaukh-extern-sap Jul 1, 2025
748cc93
refactor(ui): add license headers
mark-karnaukh-extern-sap Jul 1, 2025
b0ee89d
refactor(ui): final changes
mark-karnaukh-extern-sap Jul 2, 2025
3382820
Merge branch 'main' into mark-combobox-refactoring
mark-karnaukh-extern-sap Jul 2, 2025
72d4a9a
chore(core): create changeset
mark-karnaukh-extern-sap Jul 2, 2025
b429655
refactor(ui): fix review comments
mark-karnaukh-extern-sap Jul 2, 2025
c25c982
refactor(ui): fix typescript error
mark-karnaukh-extern-sap Jul 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .changeset/angry-windows-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
"@cloudoperators/juno-ui-components": patch
---

- **Removed redundant state management:** Eliminated unnecessary `useState` and `useEffect` patterns that were causing performance bottlenecks
- **Memoized context values:** Implemented proper memoization to prevent unnecessary re-renders
- **Optimized filtering and event handlers:** Enhanced callback performance and filtering logic efficiency
- **Added configurable debounce delay:** Made debounce timing configurable as a parameter for better flexibility

- **Custom hooks extraction:** Broke down the monolithic combobox into focused, reusable custom hooks:

- Combobox options initialization logic
- Floating UI logic
- Filtering logic
- State management logic
- Context management logic
- Validation logic

- **Sub-component extraction:** Separated complex component into smaller, focused sub-components
- **Type definitions:** Extracted reusable TypeScript types for better type safety

- **Added comprehensive documentation:** Included description comments and explanation comments throughout the codebase
- **Utility functions:** Added CSS class merging utility for better Tailwind CSS handling
- **Style management:** Implemented consistent style management approach
- **License headers:** Added proper license headers to all files
- **Code organization:** Moved utilities to appropriate locations in the source structure
2 changes: 2 additions & 0 deletions packages/ui-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"add": "2.0.6",
"autoprefixer": "10.4.21",
"css-loader": "6.11.0",
"clsx": "^2.1.1",
"eslint-plugin-storybook": "^9.0.10",
"flatpickr": "4.6.13",
"focus-trap-react": "11.0.3",
Expand All @@ -62,6 +63,7 @@
"storybook": "^9.0.10",
"style-loader": "3.3.4",
"tailwindcss": "^4.1.7",
"tailwind-merge": "^3.2.0",
"ts-loader": "9.5.2",
"typescript": "^5.8.3",
"vite": "6.3.5",
Expand Down
Loading
Loading