Make assemblies commands available for release (#6498)

* Make assemblies commands available for release
Fixes #6497

* Break insert out of the group, new icon, add Clone disabled

* Add rotate thanks to @franknoirot

* Update relevant snapshots

* Trigger CI
This commit is contained in:
Pierre Jacquier
2025-04-25 12:49:11 -04:00
committed by GitHub
parent fe22a67cf6
commit 604e244395
17 changed files with 59 additions and 35 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -29,5 +29,5 @@
} }
} }
], ],
"kcl_version": "0.2.62" "kcl_version": "0.2.63"
} }

View File

@ -630,7 +630,7 @@ const CustomIconMap = {
<path <path
fillRule="evenodd" fillRule="evenodd"
clipRule="evenodd" clipRule="evenodd"
d="M9.64645 12.3535L10 12.7071L10.3536 12.3535L13.8536 8.85352L13.1464 8.14642L10.5 10.7929L10.5 3H9.5L9.5 10.7929L6.85355 8.14642L6.14645 8.85352L9.64645 12.3535ZM15 5H12.4999V4H15H16V5V15V16H15H5H4V15V5V4H5H7.49988V5H5V15H15V5Z" d="M9.64651 12.3535L10.0001 12.7071L10.3536 12.3535L13.8536 8.85354L13.1465 8.14643L10.5001 10.7929V4.08661H9.50006V10.7929L6.85361 8.14643L6.14651 8.85354L9.64651 12.3535ZM4.00659 6.77736V12.7392V13.0186L4.24454 13.165L9.73802 16.5456L10.0001 16.7069L10.2621 16.5456L15.7556 13.165L15.9935 13.0186V12.7392V6.77736H14.9935V12.4598L10.0001 15.5327L5.00659 12.4598V6.77736H4.00659Z"
fill="currentColor" fill="currentColor"
/> />
</svg> </svg>
@ -854,6 +854,21 @@ const CustomIconMap = {
/> />
</svg> </svg>
), ),
rotate: (
<svg
viewBox="0 0 20 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-label="move"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M15.9814 8.09473C16.129 8.21931 16.2638 8.34937 16.3828 8.48633C16.77 8.93194 16.9999 9.44727 17 10L16.9893 10.2061C16.9398 10.6808 16.7214 11.1239 16.3828 11.5137C15.9986 11.9559 15.4569 12.3349 14.8115 12.6426L14.375 12.834C14.0118 12.9799 13.62 13.1023 13.209 13.208C13.0595 13.7896 12.8716 14.3311 12.6426 14.8115L12.5244 15.0488C12.2398 15.59 11.9006 16.0466 11.5137 16.3828L11.3438 16.5205C10.9391 16.8239 10.4837 17 10 17C9.44729 16.9999 8.93192 16.77 8.48633 16.3828C8.33659 16.2527 8.19534 16.1036 8.06055 15.9395L8.94141 15.4297C9.00826 15.5026 9.0749 15.5691 9.14258 15.6279C9.44859 15.8938 9.73914 15.9999 10 16C10.2284 16 10.4798 15.9184 10.7441 15.7197L10.8584 15.6279C11.1292 15.3926 11.3959 15.0443 11.6377 14.585L11.7402 14.3809C11.8763 14.0953 11.9967 13.7782 12.1045 13.4365C11.4243 13.5432 10.7144 13.5996 10 13.5996C9.11604 13.5996 8.23831 13.5159 7.41602 13.3535C7.19094 13.3091 6.97117 13.257 6.75684 13.2012L7.51855 14.5205L6.65332 15.0205L4.98926 12.1377L7.87109 10.4736L8.37109 11.3398L6.87988 12.2002C7.11353 12.2646 7.35704 12.3232 7.60938 12.373C7.85738 12.422 8.11225 12.4589 8.37109 12.4922L8.375 12.4912C8.90266 12.5593 9.4487 12.5986 10 12.5986C10.6681 12.5986 11.329 12.5452 11.958 12.4463C12.0813 12.4269 12.2036 12.4068 12.3242 12.3838L12.3906 12.3721L12.6865 12.3096C13.1641 12.201 13.6057 12.0649 14.001 11.9062L14.3809 11.7402C14.9423 11.4726 15.3589 11.1679 15.6279 10.8584C15.8606 10.5906 15.9711 10.3342 15.9951 10.0996L16 10C15.9999 9.73915 15.8937 9.44858 15.6279 9.14258C15.5273 9.02682 15.4063 8.91151 15.2646 8.79883L15.9814 8.09473ZM10 3C10.5527 3.00004 11.0681 3.23013 11.5137 3.61719L11.6768 3.76855C11.7264 3.81776 11.7744 3.86965 11.8223 3.92285C11.8384 3.94079 11.8542 3.95916 11.8701 3.97754C11.9058 4.01874 11.9409 4.06112 11.9756 4.10449C11.9841 4.11515 11.9925 4.12594 12.001 4.13672C12.0375 4.18324 12.074 4.23044 12.1094 4.2793C12.1254 4.30137 12.1405 4.32415 12.1562 4.34668C12.1821 4.38367 12.2082 4.42078 12.2334 4.45898C12.2531 4.4889 12.2727 4.51916 12.292 4.5498C12.3161 4.588 12.3398 4.62672 12.3633 4.66602C12.3804 4.69469 12.3973 4.72368 12.4141 4.75293C12.4389 4.79624 12.4632 4.84024 12.4873 4.88477C12.5408 4.98354 12.5938 5.08502 12.6436 5.18945C12.946 5.82407 13.1818 6.56414 13.3438 7.36621L14.3379 6.10059L15.125 6.71777L13.0703 9.33691L10.4512 7.28223L11.0684 6.49609L12.3496 7.50098C12.2436 6.99176 12.1067 6.52055 11.9443 6.09863L11.9434 6.09961C11.9176 6.03259 11.8906 5.96709 11.8643 5.90234C11.8547 5.8796 11.8466 5.8564 11.8369 5.83398L11.7402 5.61914C11.506 5.12774 11.243 4.74799 10.9736 4.48047L10.8584 4.37207C10.5523 4.10607 10.2609 4.00004 10 4C9.73918 4.0001 9.44854 4.1063 9.14258 4.37207L9.02637 4.47949C8.75702 4.747 8.49503 5.12772 8.26074 5.61914L8.09473 5.99902C7.93598 6.39437 7.79902 6.83573 7.69043 7.31348L7.62793 7.60938L7.5752 7.89551C7.48263 8.43857 7.42746 9.00773 7.40918 9.58594L6.4043 10.166C6.40362 10.1107 6.40137 10.0554 6.40137 10C6.40137 9.28573 6.45704 8.57565 6.56348 7.89551C6.22164 8.00337 5.90478 8.12459 5.61914 8.26074L5.41504 8.3623C4.95555 8.60415 4.60745 8.87173 4.37207 9.14258C4.10626 9.44858 4.00007 9.73915 4 10C4 10.261 4.10603 10.5522 4.37207 10.8584C4.46022 10.9598 4.56484 11.0599 4.68457 11.1592L3.77539 11.6836C3.72003 11.6281 3.66732 11.5714 3.61719 11.5137C3.23003 11.068 3 10.5528 3 10C3.00007 9.44727 3.23001 8.93194 3.61719 8.48633C3.95336 8.09948 4.41007 7.76116 4.95117 7.47656L5.18848 7.35742C5.66891 7.12841 6.21038 6.94047 6.79199 6.79102C6.8977 6.37985 7.02103 5.98833 7.16699 5.625L7.3584 5.18848C7.62768 4.62371 7.95121 4.13841 8.32422 3.76855L8.48633 3.61719C8.93189 3.23008 9.44735 3.0001 10 3Z"
fill="currentColor"
/>
</svg>
),
network: ( network: (
<svg <svg
viewBox="0 0 20 20" viewBox="0 0 20 20"

View File

@ -1,5 +1,4 @@
import type { Models } from '@kittycad/lib' import type { Models } from '@kittycad/lib'
import { DEV } from '@src/env'
import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo' import { angleLengthInfo } from '@src/components/Toolbar/angleLengthInfo'
import { getNodeFromPath } from '@src/lang/queryAst' import { getNodeFromPath } from '@src/lang/queryAst'
@ -32,7 +31,6 @@ import type { Selections } from '@src/lib/selections'
import { codeManager, kclManager } from '@src/lib/singletons' import { codeManager, kclManager } from '@src/lib/singletons'
import { err } from '@src/lib/trap' import { err } from '@src/lib/trap'
import type { SketchTool, modelingMachine } from '@src/machines/modelingMachine' import type { SketchTool, modelingMachine } from '@src/machines/modelingMachine'
import { IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
type OutputFormat = Models['OutputFormat3d_type'] type OutputFormat = Models['OutputFormat3d_type']
type OutputTypeKey = OutputFormat['type'] type OutputTypeKey = OutputFormat['type']
@ -596,7 +594,7 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
}, },
}, },
'Boolean Intersect': { 'Boolean Intersect': {
description: 'Create a solid from the intersection of two solids.', description: 'Create a solid from the intersection of two solids.',
icon: 'booleanIntersect', icon: 'booleanIntersect',
needsReview: true, needsReview: true,
args: { args: {
@ -1039,9 +1037,8 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
}, },
Translate: { Translate: {
description: 'Set translation on solid or sketch.', description: 'Set translation on solid or sketch.',
icon: 'dimension', // TODO: likely not the best icon icon: 'move',
needsReview: true, needsReview: true,
hide: DEV || IS_NIGHTLY_OR_DEBUG ? undefined : 'both',
args: { args: {
nodeToEdit: { nodeToEdit: {
description: description:
@ -1080,9 +1077,8 @@ export const modelingMachineCommandConfig: StateMachineCommandSetConfig<
}, },
Rotate: { Rotate: {
description: 'Set rotation on solid or sketch.', description: 'Set rotation on solid or sketch.',
icon: 'angle', // TODO: likely not the best icon icon: 'rotate',
needsReview: true, needsReview: true,
hide: DEV || IS_NIGHTLY_OR_DEBUG ? undefined : 'both',
args: { args: {
nodeToEdit: { nodeToEdit: {
description: description:

View File

@ -2,7 +2,6 @@ import type { UnitLength_type } from '@kittycad/lib/dist/types/src/models'
import toast from 'react-hot-toast' import toast from 'react-hot-toast'
import { CommandBarOverwriteWarning } from '@src/components/CommandBarOverwriteWarning' import { CommandBarOverwriteWarning } from '@src/components/CommandBarOverwriteWarning'
import { DEV } from '@src/env'
import { updateModelingState } from '@src/lang/modelingWorkflows' import { updateModelingState } from '@src/lang/modelingWorkflows'
import { addImportAndInsert } from '@src/lang/modifyAst' import { addImportAndInsert } from '@src/lang/modifyAst'
import { import {
@ -25,7 +24,6 @@ import { codeManager, editorManager, kclManager } from '@src/lib/singletons'
import { err, reportRejection } from '@src/lib/trap' import { err, reportRejection } from '@src/lib/trap'
import type { IndexLoaderData } from '@src/lib/types' import type { IndexLoaderData } from '@src/lib/types'
import type { CommandBarContext } from '@src/machines/commandBarMachine' import type { CommandBarContext } from '@src/machines/commandBarMachine'
import { IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
interface OnSubmitProps { interface OnSubmitProps {
name: string name: string
@ -112,7 +110,7 @@ export function kclCommands(commandProps: KclCommandConfig): Command[] {
description: 'Insert from a file in the current project directory', description: 'Insert from a file in the current project directory',
icon: 'import', icon: 'import',
groupId: 'code', groupId: 'code',
hide: DEV || IS_NIGHTLY_OR_DEBUG ? 'web' : 'both', hide: 'web',
needsReview: true, needsReview: true,
reviewMessage: reviewMessage:
'Reminder: point-and-click insert is in development and only supports one part instance per assembly.', 'Reminder: point-and-click insert is in development and only supports one part instance per assembly.',

View File

@ -10,7 +10,6 @@ import {
isEditingExistingSketch, isEditingExistingSketch,
pipeHasCircle, pipeHasCircle,
} from '@src/machines/modelingMachine' } from '@src/machines/modelingMachine'
import { IS_NIGHTLY_OR_DEBUG } from '@src/routes/utils'
export type ToolbarModeName = 'modeling' | 'sketching' export type ToolbarModeName = 'modeling' | 'sketching'
@ -339,28 +338,28 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
}, },
'break', 'break',
{ {
id: 'modules', id: 'insert',
array: [ onClick: () =>
commandBarActor.send({
type: 'Find and select command',
data: { name: 'Insert', groupId: 'code' },
}),
hotkey: 'I',
icon: 'import',
status: 'available',
disabled: () => !isDesktop(),
title: 'Insert',
description: 'Insert from a file in the current project directory',
links: [
{ {
id: 'insert', label: 'API docs',
onClick: () => url: 'https://zoo.dev/docs/kcl/import',
commandBarActor.send({
type: 'Find and select command',
data: { name: 'Insert', groupId: 'code' },
}),
hotkey: 'I',
icon: 'import',
status: DEV || IS_NIGHTLY_OR_DEBUG ? 'available' : 'kcl-only',
disabled: () => !isDesktop(),
title: 'Insert',
description: 'Insert from a file in the current project directory',
links: [
{
label: 'API docs',
url: 'https://zoo.dev/docs/kcl/import',
},
],
}, },
],
},
{
id: 'transform',
array: [
{ {
id: 'translate', id: 'translate',
onClick: () => onClick: () =>
@ -368,7 +367,8 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
type: 'Find and select command', type: 'Find and select command',
data: { name: 'Translate', groupId: 'modeling' }, data: { name: 'Translate', groupId: 'modeling' },
}), }),
status: DEV || IS_NIGHTLY_OR_DEBUG ? 'available' : 'kcl-only', icon: 'move',
status: 'available',
title: 'Translate', title: 'Translate',
description: 'Apply a translation to a solid or sketch.', description: 'Apply a translation to a solid or sketch.',
links: [ links: [
@ -385,7 +385,8 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
type: 'Find and select command', type: 'Find and select command',
data: { name: 'Rotate', groupId: 'modeling' }, data: { name: 'Rotate', groupId: 'modeling' },
}), }),
status: DEV || IS_NIGHTLY_OR_DEBUG ? 'available' : 'kcl-only', icon: 'rotate',
status: 'available',
title: 'Rotate', title: 'Rotate',
description: 'Apply a rotation to a solid or sketch.', description: 'Apply a rotation to a solid or sketch.',
links: [ links: [
@ -395,6 +396,20 @@ export const toolbarConfig: Record<ToolbarModeName, ToolbarMode> = {
}, },
], ],
}, },
{
id: 'clone',
onClick: () => undefined,
status: 'kcl-only',
title: 'Clone',
icon: 'patternLinear3d', // TODO: add a clone icon
description: 'Clone a solid or sketch.',
links: [
{
label: 'API docs',
url: 'https://zoo.dev/docs/kcl/clone',
},
],
},
], ],
}, },
'break', 'break',