Remove Create with Text-to-CAD from toolbar, make commands in command palette more distinct (#7048)

* Remove Create with Text-to-CAD from the toolbar

* Remove "prompt-to-edit" wording, call commands "create" and "edit"

* Use sparkles for the ML feature, not chat

* lints

* Start fixing up tests, there are probably more though

* Fix up a few more tests

* Fix up prompt-to-edit tests (yay using fixtures!)

* Fix native file menu tests

* Update snapshots

* Fix menu test

* Fix snaps

---------

Co-authored-by: Pierre Jacquier <pierre@zoo.dev>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
This commit is contained in:
Frank Noirot
2025-05-18 06:24:48 -04:00
committed by GitHub
parent 3168c22de7
commit 5734cc7fc3
23 changed files with 177 additions and 92 deletions

View File

@ -1,5 +1,4 @@
import type { EventFrom, StateFrom } from 'xstate'
import { settingsActor } from '@src/lib/singletons'
import type { CustomIconName } from '@src/components/CustomIcon'
import { createLiteral } from '@src/lang/create'
@ -35,6 +34,7 @@ export type ToolbarItem = {
id: string
onClick: (props: ToolbarItemCallbackProps) => void
icon?: CustomIconName
className?: string
iconColor?: string
alwaysDark?: true
status: 'available' | 'unavailable' | 'kcl-only' | 'experimental'
@ -425,54 +425,20 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
},
'break',
{
id: 'ai',
array: [
{
id: 'text-to-cad',
onClick: () => {
const currentProject =
settingsActor.getSnapshot().context.currentProject
commandBarActor.send({
type: 'Find and select command',
data: {
name: 'Text-to-CAD',
groupId: 'application',
argDefaultValues: {
method: 'existingProject',
projectName: currentProject?.name,
},
},
})
},
icon: 'sparkles',
iconColor: '#29FFA4',
alwaysDark: true,
status: IS_ML_EXPERIMENTAL ? 'experimental' : 'available',
title: 'Create with Zoo Text-to-CAD',
description: 'Create geometry with AI / ML.',
links: [
{
label: 'API docs',
url: 'https://zoo.dev/docs/api/ml/generate-a-cad-model-from-text',
},
],
},
{
id: 'prompt-to-edit',
onClick: () =>
commandBarActor.send({
type: 'Find and select command',
data: { name: 'Prompt-to-edit', groupId: 'modeling' },
}),
icon: 'sparkles',
iconColor: '#29FFA4',
alwaysDark: true,
status: IS_ML_EXPERIMENTAL ? 'experimental' : 'available',
title: 'Modify with Zoo Text-to-CAD',
description: 'Edit geometry with AI / ML.',
links: [],
},
],
id: 'prompt-to-edit',
onClick: () =>
commandBarActor.send({
type: 'Find and select command',
data: { name: 'Prompt-to-edit', groupId: 'modeling' },
}),
icon: 'sparkles',
iconColor: '#29FFA4',
alwaysDark: true,
status: IS_ML_EXPERIMENTAL ? 'experimental' : 'available',
title: 'Text-to-CAD',
description:
'Edit or create geometry from a text prompt and selection.',
links: [],
},
],
},