feat(app): add ctrl/cmd+number keybinds to switch projects (#26280)
This commit is contained in:
parent
ea6eabe1d9
commit
3992e2a76b
5 changed files with 36 additions and 8 deletions
|
|
@ -81,6 +81,7 @@ export interface CommandOption {
|
|||
slash?: string
|
||||
suggested?: boolean
|
||||
disabled?: boolean
|
||||
hidden?: boolean
|
||||
onSelect?: (source?: "palette" | "keybind" | "slash") => void
|
||||
onHighlight?: () => (() => void) | void
|
||||
}
|
||||
|
|
@ -93,6 +94,7 @@ export type CommandCatalogItem = {
|
|||
category?: string
|
||||
keybind?: KeybindConfig
|
||||
slash?: string
|
||||
hidden?: boolean
|
||||
}
|
||||
|
||||
export type CommandRegistration = {
|
||||
|
|
@ -279,13 +281,14 @@ export const { use: useCommand, provider: CommandProvider } = createSimpleContex
|
|||
setCatalog(
|
||||
registered().reduce((acc, opt) => {
|
||||
const id = actionId(opt.id)
|
||||
acc[id] = {
|
||||
title: opt.title,
|
||||
description: opt.description,
|
||||
category: opt.category,
|
||||
keybind: opt.keybind,
|
||||
slash: opt.slash,
|
||||
}
|
||||
if (opt.title)
|
||||
acc[id] = {
|
||||
title: opt.title,
|
||||
description: opt.description,
|
||||
category: opt.category,
|
||||
keybind: opt.keybind,
|
||||
slash: opt.slash,
|
||||
}
|
||||
return acc
|
||||
}, {} as CommandCatalog),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue