Wire up edit flow for symmetric

This commit is contained in:
Pierre Jacquier
2025-06-16 11:32:35 -04:00
parent 1a1a152fbf
commit 3339da96b5

View File

@ -95,12 +95,23 @@ const prepareToEditExtrude: PrepareToEditCallback = async ({ operation }) => {
return { reason: "Couldn't retrieve length argument" }
}
// symmetric argument from a string to a KCL expression
let symmetric: boolean | undefined
if ('symmetric' in operation.labeledArgs && operation.labeledArgs.symmetric) {
symmetric =
codeManager.code.slice(
operation.labeledArgs.symmetric.sourceRange[0],
operation.labeledArgs.symmetric.sourceRange[1]
) === 'true'
}
// 3. Assemble the default argument values for the command,
// with `nodeToEdit` set, which will let the actor know
// to edit the node that corresponds to the StdLibCall.
const argDefaultValues: ModelingCommandSchema['Extrude'] = {
sketches,
length,
symmetric,
nodeToEdit: pathToNodeFromRustNodePath(operation.nodePath),
}
return {