-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(cmdk): Add new command palette component #101551
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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 |
z-index: 2; | ||
`; | ||
|
||
const SearchInputContainer = styled('div')` |
There was a problem hiding this comment.
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')` |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 🎉
There was a problem hiding this 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…'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…
appreciation 🙏
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
// Add (create new entitty) |
OTHER: t('Actions'), | ||
}; | ||
|
||
function useNavigationActions() { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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
?
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:
cmd-k-supercharged
is disabled/components/commandPalette/*
This is how the action registration works:
CommandPaletteProvider
which keeps track of all registered actionsuseCommandPaletteActions()
to register actions. These will be unregistered when the component unmounts.children
actions which are displayed when you select a parent action (such as "change color theme")You can test this on the
sentry-test
orsentry-sdks
orgs, where the flag is already enabled.CleanShot.2025-10-15.at.12.18.15.mp4