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

7499 refactor right drawer to have contextual actions #7954

Merged

Conversation

bosiraphael
Copy link
Contributor

@bosiraphael bosiraphael commented Oct 22, 2024

Closes #7499

  • Modifies context store states to be component states
  • Introduces the concept of mainContextStore which will dictate the available actions inside the command K
  • Adds contextual actions inside the right drawer
  • Creates a new type of modal variant

@bosiraphael bosiraphael linked an issue Oct 22, 2024 that may be closed by this pull request
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 right drawer to implement contextual actions and modifies the context store states to be component-specific. The changes introduce a new mainContextStore concept and add support for contextual actions in various components.

  • Introduced RecordIndexActionMenu and RecordShowActionMenu components to handle different action menu contexts
  • Refactored context store states to use createComponentStateV2 for component-specific state management
  • Added ActionMenuType to differentiate between 'recordIndex' and 'recordShow' action menus
  • Implemented SetMainContextStoreComponentInstanceIdEffect to manage the main context store component instance ID
  • Updated action menu components to use new context store states and support contextual actions

30 file(s) reviewed, 16 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -0,0 +1 @@
export type ActionMenuType = 'recordIndex' | 'recordShow';
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this? I think it's a bit broken from a dependency perspective action-menu is a component that should not have to know about where it's used

const contextStoreNumberOfSelectedRecords = useRecoilValue(
contextStoreNumberOfSelectedRecordsState,
export const RecordActionMenuEntriesSetter = ({
actionMenuType,
Copy link
Member

Choose a reason for hiding this comment

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

also seems a bit painful to drill down


// For now, this component is the same as RecordIndexActionMenuBarEntry but they
// will probably diverge in the future
export const RecordShowActionMenuBarEntry = ({
Copy link
Member

Choose a reason for hiding this comment

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

where is this bar displayed?

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.

LGTM!

@charlesBochet charlesBochet merged commit 6843a64 into main Oct 22, 2024
18 checks passed
@charlesBochet charlesBochet deleted the 7499-refactor-right-drawer-to-have-contextual-actions branch October 22, 2024 16:35
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.

Refactor right drawer to have contextual actions
2 participants