refactor(tui): remove hidden command metadata
This commit is contained in:
parent
00093c70c1
commit
e8964ce672
3 changed files with 1 additions and 4 deletions
|
|
@ -135,8 +135,6 @@ export interface KeymapCommand {
|
|||
readonly name: string
|
||||
readonly aliases?: string[]
|
||||
}
|
||||
/** Hides the command from discovery UI. */
|
||||
readonly hidden?: boolean
|
||||
/** Promotes the command in discovery UI. */
|
||||
readonly suggested?: boolean | (() => boolean)
|
||||
/** Executes the command. Return false to let keymap dispatch continue. */
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export function CommandPaletteDialog() {
|
|||
const shortcuts = Keymap.useShortcuts()
|
||||
const options = createMemo(() =>
|
||||
commands().flatMap((command) => {
|
||||
if (!command.id || !command.palette || command.hidden || command.id === COMMAND_PALETTE_COMMAND) return []
|
||||
if (!command.id || !command.palette || command.id === COMMAND_PALETTE_COMMAND) return []
|
||||
return {
|
||||
title: command.title ?? command.id,
|
||||
description: command.description,
|
||||
|
|
|
|||
|
|
@ -255,7 +255,6 @@ function useCommands(): Accessor<readonly KeymapCommand[]> {
|
|||
: undefined,
|
||||
palette: entry.command.namespace === "palette" ? true : undefined,
|
||||
slash: entry.command.slash,
|
||||
hidden: typeof entry.command.hidden === "boolean" ? entry.command.hidden : undefined,
|
||||
suggested:
|
||||
typeof entry.command.suggested === "boolean" || typeof entry.command.suggested === "function"
|
||||
? (entry.command.suggested as boolean | (() => boolean))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue