Skip to content

Add additionalKeywords to action types and command palette for enhanced search functionality#8600

Merged
mscolnick merged 5 commits intomainfrom
ms/keywords
Mar 9, 2026
Merged

Add additionalKeywords to action types and command palette for enhanced search functionality#8600
mscolnick merged 5 commits intomainfrom
ms/keywords

Conversation

@mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Mar 6, 2026

  • Introduced additionalKeywords property in various action types and panel descriptors to improve command palette search capabilities.
  • Updated useNotebookActions and CommandPalette components to utilize the new keywords for better matching.
  • Implemented smartMatch utility to facilitate keyword-based filtering in the command palette.
  • Added tests for the new smartMatch functionality to ensure accuracy and reliability.

Keyword mapping

Action Additional Keywords
Panels
Files explorer, browser, directory
Variables state, scope, inspector
Packages dependencies, pip, install
AI chat, copilot, assistant
Outline toc, structure, headings
Documentation reference, api
Dependencies graph, imports
Errors exceptions, problems, diagnostics
Scratchpad scratch, draft, playground
Tracing profiling, performance
Secrets env, environment, keys, credentials
Logs console, stdout
Terminal shell, console, bash, command
Snippets templates, examples
Cache memory, memoize
Notebook actions
Restart kernel reset, reload, restart
User settings preferences, options, configuration
Hotkeys
Run (cell) execute, submit
Format cell lint
Delete cell remove
Save file write, persist

…ed search functionality

- Introduced `additionalKeywords` property in various action types and panel descriptors to improve command palette search capabilities.
- Updated `useNotebookActions` and `CommandPalette` components to utilize the new keywords for better matching.
- Implemented `smartMatch` utility to facilitate keyword-based filtering in the command palette.
- Added tests for the new smartMatch functionality to ensure accuracy and reliability.
Copilot AI review requested due to automatic review settings March 6, 2026 18:57
@vercel
Copy link

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 6, 2026 7:27pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances search matching by adding optional additionalKeywords metadata to actions/hotkeys/panels and wiring those keywords into the cmdk-based command palette filtering.

Changes:

  • Added additionalKeywords to editor actions (ActionButton), hotkeys, and panel descriptors (PANELS).
  • Introduced smartMatch / smartMatchFilter and configured cmdk to use it for filtering with keyword support.
  • Added Vitest coverage for smartMatch and smartMatchFilter.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/utils/smartMatch.ts Adds token/prefix-based match + cmdk filter adapter.
frontend/src/utils/tests/smartMatch.test.ts Adds unit tests for the new matching behavior.
frontend/src/core/hotkeys/hotkeys.ts Extends hotkey metadata with additionalKeywords and preserves it in resolved hotkeys.
frontend/src/components/ui/command.tsx Configures cmdk Command to use the new filter function.
frontend/src/components/editor/controls/command-palette.tsx Passes additionalKeywords into cmdk keywords for palette entries.
frontend/src/components/editor/chrome/types.ts Adds additionalKeywords to panel descriptors and populates them for default panels.
frontend/src/components/editor/actions/useNotebookActions.tsx Propagates panel/action additionalKeywords into helper panel dropdown actions.
frontend/src/components/editor/actions/types.ts Adds additionalKeywords to ActionButton and carries it through flattenActions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 23 to 26
<CommandPrimitive
ref={ref}
filter={smartMatchFilter}
className={cn(
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

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

Setting filter={smartMatchFilter} on the shared Command wrapper changes matching behavior for every Command usage across the app (e.g. cell actions search, snippets search, etc.), not just the command palette. This is a fairly broad UX/behavior change (and can make previously-matching fuzzy queries stop working); consider making this filter opt-in (prop/default) or applying it only in the command palette component instead of globally here.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
name: "Format cell",
group: "Editing",
key: "Mod-b",
additionalKeywords: ["lint"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

some of these keyboard shortcuts will not work, they aren't a registered action

const renderShortcutCommandItem = (
shortcut: HotkeyAction,
props: {
disabled?: boolean;
tooltip?: React.ReactNode;
},
) => {
const action = registeredActions[shortcut];
if (!action) {
return null;
}
const hotkey = hotkeys.getHotkey(shortcut);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yea thats right. Well I guess if we ever add these to the command palette, it'll be ready to go.

@mscolnick mscolnick merged commit 0530a5c into main Mar 9, 2026
28 checks passed
@mscolnick mscolnick deleted the ms/keywords branch March 9, 2026 13:13
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.20.5-dev25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants