feat: wire Part Design task parameters

This commit is contained in:
2026-08-02 19:44:54 -04:00
parent ed3d1cddc5
commit 288260b1e2
3 changed files with 22 additions and 8 deletions

View File

@@ -303,12 +303,14 @@ export function createMockFacade(): BitBybitWebCadFacade {
tree.push(item)
}
const objectSnapshot = createObjectSnapshot(item)
if (commandId === 'primitive') {
objectSnapshot.properties = objectSnapshot.properties.map((property) => {
const candidate = draft[property.name.toLowerCase()]
return typeof candidate === 'number' && Number.isFinite(candidate) ? { ...property, value: candidate } : property
})
}
objectSnapshot.properties = objectSnapshot.properties.map((property) => {
if (!property.recompute || property.type === 'App::PropertyLink') return property
const candidate = draft[property.name.toLowerCase()]
if (property.type === 'App::PropertyBool' && typeof candidate === 'boolean') return { ...property, value: candidate }
if ((property.type === 'App::PropertyLength' || property.type === 'App::PropertyAngle' || property.type === 'App::PropertyPercent' || property.type === 'App::PropertyFloat') && typeof candidate === 'number' && Number.isFinite(candidate)) return { ...property, value: candidate }
if (property.type === 'App::PropertyEnumeration' && typeof candidate === 'string' && property.options?.includes(candidate)) return { ...property, value: candidate }
return property
})
if (isPartObject && commandId !== 'primitive') {
objectSnapshot.properties = objectSnapshot.properties.map((property) => property.name === 'Base' && state.selectedObjectId ? { ...property, value: state.selectedObjectId } : property)
}