Add Warning Message for Fillet Engine Limitations in CommandBar (#4076)
This commit is contained in:
@ -91,7 +91,7 @@ function CommandBarSelectionInput({
|
|||||||
<form id="arg-form" onSubmit={handleSubmit}>
|
<form id="arg-form" onSubmit={handleSubmit}>
|
||||||
<label
|
<label
|
||||||
className={
|
className={
|
||||||
'relative flex items-center mx-4 my-4 ' +
|
'relative flex flex-col mx-4 my-4 ' +
|
||||||
(!hasSubmitted || canSubmitSelection || 'text-destroy-50')
|
(!hasSubmitted || canSubmitSelection || 'text-destroy-50')
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -100,13 +100,18 @@ function CommandBarSelectionInput({
|
|||||||
: `Please select ${
|
: `Please select ${
|
||||||
arg.multiple ? 'one or more ' : 'one '
|
arg.multiple ? 'one or more ' : 'one '
|
||||||
}${getSemanticSelectionType(arg.selectionTypes).join(' or ')}`}
|
}${getSemanticSelectionType(arg.selectionTypes).join(' or ')}`}
|
||||||
|
{arg.warningMessage && (
|
||||||
|
<p className="text-warn-80 bg-warn-10 px-2 py-1 rounded-sm mt-3 mr-2 -mb-2 w-full text-sm cursor-default">
|
||||||
|
{arg.warningMessage}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
<input
|
<input
|
||||||
id="selection"
|
id="selection"
|
||||||
name="selection"
|
name="selection"
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
required
|
required
|
||||||
placeholder="Select an entity with your mouse"
|
placeholder="Select an entity with your mouse"
|
||||||
className="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
className="absolute inset-0 w-full h-full opacity-0 cursor-default"
|
||||||
onKeyDown={(event) => {
|
onKeyDown={(event) => {
|
||||||
if (event.key === 'Backspace') {
|
if (event.key === 'Backspace') {
|
||||||
stepBack()
|
stepBack()
|
||||||
|
|||||||
@ -281,6 +281,8 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
required: true,
|
required: true,
|
||||||
skip: false,
|
skip: false,
|
||||||
|
warningMessage:
|
||||||
|
'Fillets cannot touch other fillets yet. This is under development.',
|
||||||
},
|
},
|
||||||
radius: {
|
radius: {
|
||||||
inputType: 'kcl',
|
inputType: 'kcl',
|
||||||
|
|||||||
@ -113,6 +113,7 @@ export type CommandArgumentConfig<
|
|||||||
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
|
commandBarContext: { argumentsToSubmit: Record<string, unknown> }, // Should be the commandbarMachine's context, but it creates a circular dependency
|
||||||
machineContext?: C
|
machineContext?: C
|
||||||
) => boolean)
|
) => boolean)
|
||||||
|
warningMessage?: string
|
||||||
skip?: boolean
|
skip?: boolean
|
||||||
/** For showing a summary display of the current value, such as in
|
/** For showing a summary display of the current value, such as in
|
||||||
* the command bar's header
|
* the command bar's header
|
||||||
@ -189,6 +190,7 @@ export type CommandArgument<
|
|||||||
) => boolean)
|
) => boolean)
|
||||||
skip?: boolean
|
skip?: boolean
|
||||||
machineActor?: Actor<T>
|
machineActor?: Actor<T>
|
||||||
|
warningMessage?: string
|
||||||
/** For showing a summary display of the current value, such as in
|
/** For showing a summary display of the current value, such as in
|
||||||
* the command bar's header
|
* the command bar's header
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -152,6 +152,7 @@ export function buildCommandArgument<
|
|||||||
skip: arg.skip,
|
skip: arg.skip,
|
||||||
machineActor,
|
machineActor,
|
||||||
valueSummary: arg.valueSummary,
|
valueSummary: arg.valueSummary,
|
||||||
|
warningMessage: arg.warningMessage ?? '',
|
||||||
} satisfies Omit<CommandArgument<O, T>, 'inputType'>
|
} satisfies Omit<CommandArgument<O, T>, 'inputType'>
|
||||||
|
|
||||||
if (arg.inputType === 'options') {
|
if (arg.inputType === 'options') {
|
||||||
|
|||||||
Reference in New Issue
Block a user