-
Notifications
You must be signed in to change notification settings - Fork 127
3900 client - Remove useImperativeHandle usage #3945
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
Conversation
ivicac
commented
Jan 21, 2026
- 3900 client - Remove useImperativeHandle usage
- 3900 client - Refactor dialog store handlers to use more descriptive and consistent function names across components and tests.
- 0 client - Update dependencies
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.
Pull request overview
This PR removes the usage of useImperativeHandle from dialog components in the Users settings page and replaces it with Zustand stores for state management. The refactoring eliminates the need for refs and makes dialog state management more explicit and testable.
Changes:
- Removed
useImperativeHandleandforwardReffrom dialog components (InviteUserDialog, EditUserDialog, DeleteUserAlertDialog, UsersTable) - Introduced three new Zustand stores for managing dialog state (useInviteUserDialogStore, useEditUserDialogStore, useDeleteUserDialogStore)
- Refactored custom hooks to use the new stores and provide more descriptive handler names
- Updated all component and hook tests to reflect the new architecture
- Updated multiple npm dependencies to their latest versions
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
useInviteUserDialogStore.ts |
New Zustand store for invite dialog state management |
useEditUserDialogStore.ts |
New Zustand store for edit dialog state management |
useDeleteUserDialogStore.ts |
New Zustand store for delete dialog state management |
useInviteUserDialog.ts |
Refactored to use Zustand store, added descriptive handlers |
useEditUserDialog.ts |
Refactored to use Zustand store, added descriptive handlers |
useDeleteUserAlertDialog.ts |
Refactored to use Zustand store, added descriptive handlers |
InviteUserDialog.tsx |
Removed forwardRef/useImperativeHandle, now a regular function component |
EditUserDialog.tsx |
Removed forwardRef/useImperativeHandle, now a regular function component |
DeleteUserAlertDialog.tsx |
Removed forwardRef/useImperativeHandle, now a regular function component |
UsersTable.tsx |
Removed forwardRef/useImperativeHandle and ref interface, uses hooks directly |
UsersPage.tsx |
Removed all refs, calls dialog handlers directly from hooks |
| Test files | Updated to mock hooks instead of mocking component refs |
package.json |
Updated multiple dependencies including @lingui, @tanstack/react-query, prettier, etc. |
package-lock.json |
Lockfile updates reflecting dependency changes |
Files not reviewed (1)
- client/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
client/src/pages/settings/platform/users/components/hooks/useInviteUserDialog.ts
Outdated
Show resolved
Hide resolved
client/src/pages/settings/platform/users/components/hooks/useEditUserDialog.ts
Outdated
Show resolved
Hide resolved
…and consistent function names across components and tests.
|

