Skip to content

Conversation

@kraenhansen
Copy link
Contributor

@kraenhansen kraenhansen commented Jul 1, 2025

Description

I have a use-case for a component which should be able to add multiple groups of menu items.

Merging this PR will:

  • Refactor the registerItems to take a variable length of arrays of items as arguments.
  • Implement a useContextMenuGroups hook, similar to useContextMenuItems calling into registerItems.

@kraenhansen kraenhansen self-assigned this Jul 1, 2025
@kraenhansen kraenhansen requested a review from a team as a code owner July 1, 2025 07:20
@kraenhansen kraenhansen added the no release notes Fix or feature not for release notes label Jul 1, 2025
@kraenhansen kraenhansen requested review from gagik and removed request for a team July 1, 2025 07:20
Copy link
Contributor

@gagik gagik left a comment

Choose a reason for hiding this comment

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

Nice

return contextMenu.registerItems(memoizedItems);
}

export function useContextMenuGroups(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You can add useContextMenuGroups to our linter's react-hooks/exhaustive-deps additionalHooks config to track dependencies. If you search for useContextMenuItems you will probably find it

@kraenhansen kraenhansen added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jul 1, 2025
@kraenhansen kraenhansen force-pushed the kh/use-context-menu-groups-hook branch from cd22a91 to 129f840 Compare July 1, 2025 07:45
@kraenhansen kraenhansen merged commit bcd1cd6 into gagik/context-menu-compass-ui Jul 1, 2025
2 checks passed
@kraenhansen kraenhansen deleted the kh/use-context-menu-groups-hook branch July 1, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no release notes Fix or feature not for release notes no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants