Hide selection-type args from command palette while in an edit flow (#5763)

* Allow `hidden` config to be a callback

* Hide selection type args if `nodeToEdit` is present

in workflows that have an edit flow set up

* Remove Selection from headerArguments in edit flow tests
This commit is contained in:
Frank Noirot
2025-03-11 16:29:03 -04:00
committed by GitHub
parent b5028f7aa8
commit 724e65ac97
5 changed files with 31 additions and 8 deletions

View File

@ -120,7 +120,12 @@ export type CommandArgumentConfig<
) => boolean)
warningMessage?: string
/** If `true`, arg is used as passed-through data, never for user input */
hidden?: boolean
hidden?:
| boolean
| ((
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
machineContext?: C
) => boolean)
skip?: boolean
/** For showing a summary display of the current value, such as in
* the command bar's header
@ -236,7 +241,12 @@ export type CommandArgument<
machineContext?: ContextFrom<T>
) => boolean)
/** If `true`, arg is used as passed-through data, never for user input */
hidden?: boolean
hidden?:
| boolean
| ((
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
machineContext?: ContextFrom<T>
) => boolean)
skip?: boolean
machineActor?: Actor<T>
warningMessage?: string