Skip to content

Conversation

malwilley
Copy link
Member

Let's improve the command palette! This is a pared down and cleaned up version of the hackweek project. Sorry for the large diff - I tried to get it as small as I could without making too much work for mystelf.

Summary of changes:

  • The old command palette has been deprecated, but will still be used when the feature flag cmd-k-supercharged is disabled
  • Adds new command palette context and components in /components/commandPalette/*
  • Registers some global actions (future work will add localized actions, focused areas, etc)

This is how the action registration works:

  • At the root of the app, we render a CommandPaletteProvider which keeps track of all registered actions
  • Child components can call useCommandPaletteActions() to register actions. These will be unregistered when the component unmounts.
  • Sub-menus are implemented by passing a list of children actions which are displayed when you select a parent action (such as "change color theme")

You can test this on the sentry-test or sentry-sdks orgs, where the flag is already enabled.

CleanShot.2025-10-15.at.12.18.15.mp4

@malwilley malwilley requested review from a team as code owners October 15, 2025 19:46
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 15, 2025
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Oct 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #101551   +/-   ##
========================================
  Coverage   80.97%    80.97%           
========================================
  Files        8706      8706           
  Lines      386878    386876    -2     
  Branches    24519     24519           
========================================
- Hits       313281    313280    -1     
+ Misses      73246     73245    -1     
  Partials      351       351           

cursor[bot]

This comment was marked as outdated.

z-index: 2;
`;

const SearchInputContainer = styled('div')`
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Could this just be our <Flex> component? <Flex position="relative" align="center" padding="0" width="100%">

);
}

const IconWrap = styled('div')`
Copy link
Member

@rbro112 rbro112 Oct 15, 2025

Choose a reason for hiding this comment

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

Similar nit to earlier: <Flex> likely should work here

Copy link
Member

Choose a reason for hiding this comment

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

I've added this at /static/images/missing.png - I can remove ours and replace usage of this SVG if that's the best practice

Copy link
Member

Choose a reason for hiding this comment

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

Similar comment, think this is a general 404 / missing illustration and probably doesn't need to be a specific command-palette-* image.

Also would love this to be run through svgomg to optimize!

Copy link
Member

@rbro112 rbro112 left a comment

Choose a reason for hiding this comment

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

🎉 🎉

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Nothing blocking but a few things to consider! Super excited for this 🙌

const GlobalActionSection = {
HELP: t('Help'),
ADD: t('Add'),
NAVIGATE: t('Go to…'),
Copy link
Member

Choose a reason for hiding this comment

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

&hellip; appreciation 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Similar comment, think this is a general 404 / missing illustration and probably doesn't need to be a specific command-palette-* image.

Also would love this to be run through svgomg to optimize!


useCommandPaletteActions([
...navigateActions,
// Add (create new entitty)
Copy link
Member

Choose a reason for hiding this comment

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

typo but this comment doesn't really add anything

Suggested change
// Add (create new entitty)

OTHER: t('Actions'),
};

function useNavigationActions() {
Copy link
Member

Choose a reason for hiding this comment

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

Any chance these can be pulled from the nav context? I imagine these could get out of sync pretty quickly.

];
}

function useNavigationToggleCollapsed() {
Copy link
Member

Choose a reason for hiding this comment

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

This hook should maybe live next to useNavContext?

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.

3 participants