refactor(tui): remove hidden command metadata
This commit is contained in:
@@ -135,8 +135,6 @@ export interface KeymapCommand {
|
|||||||
readonly name: string
|
readonly name: string
|
||||||
readonly aliases?: string[]
|
readonly aliases?: string[]
|
||||||
}
|
}
|
||||||
/** Hides the command from discovery UI. */
|
|
||||||
readonly hidden?: boolean
|
|
||||||
/** Promotes the command in discovery UI. */
|
/** Promotes the command in discovery UI. */
|
||||||
readonly suggested?: boolean | (() => boolean)
|
readonly suggested?: boolean | (() => boolean)
|
||||||
/** Executes the command. Return false to let keymap dispatch continue. */
|
/** Executes the command. Return false to let keymap dispatch continue. */
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export function CommandPaletteDialog() {
|
|||||||
const shortcuts = Keymap.useShortcuts()
|
const shortcuts = Keymap.useShortcuts()
|
||||||
const options = createMemo(() =>
|
const options = createMemo(() =>
|
||||||
commands().flatMap((command) => {
|
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 {
|
return {
|
||||||
title: command.title ?? command.id,
|
title: command.title ?? command.id,
|
||||||
description: command.description,
|
description: command.description,
|
||||||
|
|||||||
@@ -255,7 +255,6 @@ function useCommands(): Accessor<readonly KeymapCommand[]> {
|
|||||||
: undefined,
|
: undefined,
|
||||||
palette: entry.command.namespace === "palette" ? true : undefined,
|
palette: entry.command.namespace === "palette" ? true : undefined,
|
||||||
slash: entry.command.slash,
|
slash: entry.command.slash,
|
||||||
hidden: typeof entry.command.hidden === "boolean" ? entry.command.hidden : undefined,
|
|
||||||
suggested:
|
suggested:
|
||||||
typeof entry.command.suggested === "boolean" || typeof entry.command.suggested === "function"
|
typeof entry.command.suggested === "boolean" || typeof entry.command.suggested === "function"
|
||||||
? (entry.command.suggested as boolean | (() => boolean))
|
? (entry.command.suggested as boolean | (() => boolean))
|
||||||
|
|||||||
Reference in New Issue
Block a user