Skip to content

Commit 988a0a8

Browse files
authored
fix: Remove command palette from clusters list (#3744)
1 parent 6a7057e commit 988a0a8

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

src/command-pallette/CommandPaletteProvider.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ export const CommandPaletteProvider = ({
3535
?.startsWith('mac');
3636
const modifierKeyPressed = (isMac && metaKey) || (!isMac && ctrlKey);
3737

38-
if ((key === 'k' || key === 'K') && modifierKeyPressed) {
38+
if (
39+
(key === 'k' || key === 'K') &&
40+
modifierKeyPressed &&
41+
window.location.pathname !== '/clusters'
42+
) {
3943
setShowDialog(!showDialog);
4044
// [on Firefox] prevent opening the browser search bar via CMD/CTRL+K
4145
e.preventDefault();

src/header/Header.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,14 @@ export function Header() {
134134
}
135135
onProfileClick={() => setIsMenuOpen(true)}
136136
searchField={
137-
<CommandPaletteSearchBar
138-
shouldFocus={isSearchOpen}
139-
slot="searchField"
140-
setShouldFocus={setIsSearchOpen}
141-
shellbarRef={shellbarRef}
142-
/>
137+
window.location.pathname !== '/clusters' && (
138+
<CommandPaletteSearchBar
139+
shouldFocus={isSearchOpen}
140+
slot="searchField"
141+
setShouldFocus={setIsSearchOpen}
142+
shellbarRef={shellbarRef}
143+
/>
144+
)
143145
}
144146
showSearchField
145147
onSearchButtonClick={e => {

0 commit comments

Comments
 (0)