Skip to content
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

Merged
merged 11 commits into from
Oct 11, 2024
Merged

Refactor action menu #7586

merged 11 commits into from
Oct 11, 2024

Conversation

bosiraphael
Copy link
Contributor

Introduces effects to set the actionMenuEntries

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

actionMenuEntriesComponentState,
);

const addActionMenuEntry = (entry: ActionMenuEntry) => {
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@charlesBochet charlesBochet merged commit 3761fbf into main Oct 11, 2024
13 checks passed
@charlesBochet charlesBochet deleted the refactor-action-menu branch October 11, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants