Skip to content

Conversation

@ivicac
Copy link
Contributor

@ivicac 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

@ivicac ivicac changed the title 3900 1 3900 Remove useImperativeHandle usage Jan 21, 2026
@ivicac ivicac requested a review from Copilot January 21, 2026 03:53
Copy link
Contributor

Copilot AI left a 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 useImperativeHandle and forwardRef from 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.

@ivicac ivicac changed the title 3900 Remove useImperativeHandle usage 3900 client - Remove useImperativeHandle usage Jan 21, 2026
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed for 'client'

Failed conditions
3 Security Hotspots
36.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@ivicac ivicac merged commit 63defed into master Jan 22, 2026
2 checks passed
@ivicac ivicac deleted the 3900_1 branch January 22, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants