Skip to content

ref(cmdk): Remove onAction prop in favor of internal action execution#112648

Open
JonasBa wants to merge 2 commits intojb/cmdk/item-linksfrom
jb/cmdk/onaction-internal
Open

ref(cmdk): Remove onAction prop in favor of internal action execution#112648
JonasBa wants to merge 2 commits intojb/cmdk/item-linksfrom
jb/cmdk/onaction-internal

Conversation

@JonasBa
Copy link
Copy Markdown
Member

@JonasBa JonasBa commented Apr 10, 2026

Removes the onAction prop from commandPalette which was requiring us to redefine the test and prod logic and diminishing the value of our tests. With this change, the action.onAction or action.to are invoked internally by the command palette.

CommandPalette now handles all action execution internally — navigating
for 'to' actions (with shift-key new-tab support) and invoking the
action-defined onAction callback for callback actions. Callers no longer
need to implement action dispatch logic; the only integration point is
the optional closeModal prop.

This removes the indirection of consumers inspecting CollectionTreeNode
shapes at call sites and centralises the execution model inside the
component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JonasBa JonasBa requested a review from a team as a code owner April 10, 2026 04:33
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 10, 2026
@JonasBa JonasBa requested a review from rbro112 April 10, 2026 04:35
…Palette

Both helpers were only used in commandPalette.tsx after the onAction
removal. The separate module added indirection without reuse benefit,
so inline the two functions and delete locationUtils.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant