diff --git a/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts b/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts index 9d4e328de..3ccf1206c 100644 --- a/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts +++ b/e2e/playwright/prompt-to-edit-snapshot-tests.spec.ts @@ -99,6 +99,8 @@ test.describe('edit with AI example snapshots', () => { await test.step('fire off edit prompt', async () => { await cmdBar.captureTextToCadRequestSnapshot(test.info()) await cmdBar.openCmdBar('promptToEdit') + await page.waitForTimeout(100) + await cmdBar.progressCmdBar() // being specific about the color with a hex means asserting pixel color is more stable await page .getByTestId('cmd-bar-arg-value') diff --git a/e2e/playwright/prompt-to-edit.spec.ts b/e2e/playwright/prompt-to-edit.spec.ts index fcb80166e..f16590c7f 100644 --- a/e2e/playwright/prompt-to-edit.spec.ts +++ b/e2e/playwright/prompt-to-edit.spec.ts @@ -88,6 +88,8 @@ test.describe('Prompt-to-edit tests', () => { await test.step('fire off edit prompt', async () => { await cmdBar.openCmdBar('promptToEdit') + await page.waitForTimeout(100) + await cmdBar.progressCmdBar() // being specific about the color with a hex means asserting pixel color is more stable await page .getByTestId('cmd-bar-arg-value') @@ -165,6 +167,8 @@ test.describe('Prompt-to-edit tests', () => { await test.step('fire of bad prompt', async () => { await cmdBar.openCmdBar('promptToEdit') + await page.waitForTimeout(100) + await cmdBar.progressCmdBar() await page .getByTestId('cmd-bar-arg-value') .fill('ansheusha asnthuatshoeuhtaoetuhthaeu laughs in dvorak') diff --git a/src/components/CommandBar/CommandBarHeader.tsx b/src/components/CommandBar/CommandBarHeader.tsx index 12c67676e..d3add0321 100644 --- a/src/components/CommandBar/CommandBarHeader.tsx +++ b/src/components/CommandBar/CommandBarHeader.tsx @@ -102,10 +102,12 @@ function CommandBarHeader({ children }: React.PropsWithChildren
{Object.entries(nonHiddenArgs || {}) - .filter(([_, argConfig]) => - typeof argConfig.required === 'function' - ? argConfig.required(commandBarState.context) - : argConfig.required + .filter( + ([_, argConfig]) => + argConfig.skip === false || + (typeof argConfig.required === 'function' + ? argConfig.required(commandBarState.context) + : argConfig.required) ) .map(([argName, arg], i) => { const argValue = diff --git a/src/components/CommandBar/CommandBarSelectionInput.tsx b/src/components/CommandBar/CommandBarSelectionInput.tsx index 9b97a2f8b..91e378826 100644 --- a/src/components/CommandBar/CommandBarSelectionInput.tsx +++ b/src/components/CommandBar/CommandBarSelectionInput.tsx @@ -8,6 +8,7 @@ import { canSubmitSelectionArg, getSelectionCountByType, getSelectionTypeDisplayText, + type Selections, } from '@src/lib/selections' import { engineCommandManager, kclManager } from '@src/lib/singletons' import { reportRejection } from '@src/lib/trap' @@ -56,9 +57,13 @@ function CommandBarSelectionInput({ const selectionsByType = useMemo(() => { return getSelectionCountByType(selection) }, [selection]) + const isArgRequired = + arg.required instanceof Function + ? arg.required(commandBarState.context) + : arg.required const canSubmitSelection = useMemo