-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 action menu #7586
Refactor action menu #7586
Conversation
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.
PR Summary
This pull request refactors the action menu system, introducing new components and modifying existing ones to improve modularity and efficiency. Here's a concise summary of the major changes:
- Introduced new action effect components for managing record actions (DeleteRecordsActionEffect, ExportRecordsActionEffect, ManageFavoritesActionEffect)
- Replaced ActionMenuEntriesProvider with RecordActionMenuEntriesSetter for better management of action menu entries
- Refactored action menu entries storage from an array to a Map for improved efficiency
- Added new hooks and selectors for managing action menu entries (useActionMenuEntries, actionMenuEntriesComponentSelector)
- Modified useObjectMetadataItemById to handle null objectId inputs and return null for not found items
Key points to consider:
- Ensure consistent usage of the new Map structure for action menu entries across the codebase
- Verify that the new action effect components are properly integrated and tested
- Review the changes in useDeleteTableData for potential performance impacts with large datasets
- Consider adding more comprehensive error handling in useRecoilComponentValueV2
25 file(s) reviewed, 30 comment(s)
Edit PR Review Bot Settings | Greptile
...ront/src/modules/action-menu/actions/record-actions/components/DeleteRecordsActionEffect.tsx
Show resolved
Hide resolved
...ront/src/modules/action-menu/actions/record-actions/components/DeleteRecordsActionEffect.tsx
Outdated
Show resolved
Hide resolved
...ront/src/modules/action-menu/actions/record-actions/components/ExportRecordsActionEffect.tsx
Show resolved
Hide resolved
...ront/src/modules/action-menu/actions/record-actions/components/ExportRecordsActionEffect.tsx
Show resolved
Hide resolved
...ront/src/modules/action-menu/actions/record-actions/components/ExportRecordsActionEffect.tsx
Show resolved
Hide resolved
...s/twenty-front/src/modules/object-metadata/hooks/__tests__/useObjectMetadataItemById.test.ts
Show resolved
Hide resolved
...enty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2.ts
Show resolved
Hide resolved
...enty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2.ts
Show resolved
Hide resolved
...enty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2.ts
Show resolved
Hide resolved
...enty-front/src/modules/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2.ts
Show resolved
Hide resolved
actionMenuEntriesComponentState, | ||
); | ||
|
||
const addActionMenuEntry = (entry: ActionMenuEntry) => { |
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.
I think we should make more explicit the role of the key in the map
registerActionManuEntries(key, entries[])
|
||
export const SingleRecordActionMenuEntriesSetter = () => { | ||
const actionEffects = [ | ||
ExportRecordsActionEffect, |
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.
nice!
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.
Nice one!
Introduces effects to set the actionMenuEntries