From 9fafc90c573fe6a303fed204e2e0775c9d9c0fde Mon Sep 17 00:00:00 2001 From: Kurt Hutten Irev-Dev Date: Tue, 10 Sep 2024 13:23:21 +1000 Subject: [PATCH] remove surplus | 'radius's --- e2e/playwright/testing-segment-overlays.spec.ts | 2 -- src/clientSideScene/ClientSideSceneComp.tsx | 11 ++++------- src/lang/std/sketchcombos.ts | 1 + src/lang/std/stdTypes.ts | 10 +++++----- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/e2e/playwright/testing-segment-overlays.spec.ts b/e2e/playwright/testing-segment-overlays.spec.ts index a3faa5b35..f7cc286ee 100644 --- a/e2e/playwright/testing-segment-overlays.spec.ts +++ b/e2e/playwright/testing-segment-overlays.spec.ts @@ -40,7 +40,6 @@ test.describe('Testing segment overlays', () => { | 'horizontal' | 'vertical' | 'tangentialWithPrevious' - | 'radius' | LineInputsType expectBeforeUnconstrained: string expectAfterUnconstrained: string @@ -122,7 +121,6 @@ test.describe('Testing segment overlays', () => { | 'horizontal' | 'vertical' | 'tangentialWithPrevious' - | 'radius' | LineInputsType expectBeforeUnconstrained: string expectAfterUnconstrained: string diff --git a/src/clientSideScene/ClientSideSceneComp.tsx b/src/clientSideScene/ClientSideSceneComp.tsx index f0311313d..c1ddec1e3 100644 --- a/src/clientSideScene/ClientSideSceneComp.tsx +++ b/src/clientSideScene/ClientSideSceneComp.tsx @@ -34,7 +34,6 @@ import { CustomIcon, CustomIconName } from 'components/CustomIcon' import { ConstrainInfo } from 'lang/std/stdTypes' import { getConstraintInfo } from 'lang/std/sketch' import { Dialog, Popover, Transition } from '@headlessui/react' -import { LineInputsType } from 'lang/std/sketchcombos' import toast from 'react-hot-toast' import { InstanceProps, create } from 'react-modal-promise' import { executeAst } from 'lang/langHelpers' @@ -547,12 +546,10 @@ const ConstraintSymbol = ({ iconName: 'dimension', }, } - const varName = - _type in varNameMap ? varNameMap[_type as LineInputsType].varName : 'var' - const name: CustomIconName = varNameMap[_type as LineInputsType].iconName - const displayName = varNameMap[_type as LineInputsType]?.displayName - const implicitDesc = - varNameMap[_type as LineInputsType]?.implicitConstraintDesc + const varName = _type in varNameMap ? varNameMap[_type].varName : 'var' + const name: CustomIconName = varNameMap[_type].iconName + const displayName = varNameMap[_type]?.displayName + const implicitDesc = varNameMap[_type]?.implicitConstraintDesc const _node = useMemo( () => getNodeFromPath(kclManager.ast, pathToNode), diff --git a/src/lang/std/sketchcombos.ts b/src/lang/std/sketchcombos.ts index cbac3bf03..932256be5 100644 --- a/src/lang/std/sketchcombos.ts +++ b/src/lang/std/sketchcombos.ts @@ -59,6 +59,7 @@ export type LineInputsType = | 'length' | 'intersectionOffset' | 'intersectionTag' + | 'radius' export type ConstraintType = | 'equalLength' diff --git a/src/lang/std/stdTypes.ts b/src/lang/std/stdTypes.ts index 81751f41c..8f57ac18d 100644 --- a/src/lang/std/stdTypes.ts +++ b/src/lang/std/stdTypes.ts @@ -82,19 +82,19 @@ export type VarValueKeys = | 'center' export interface SingleValueInput { type: 'singleValue' - argType: LineInputsType | 'radius' + argType: LineInputsType expr: T } export interface ArrayItemInput { type: 'arrayItem' index: 0 | 1 - argType: LineInputsType | 'radius' + argType: LineInputsType expr: T } export interface ObjectPropertyInput { type: 'objectProperty' key: VarValueKeys - argType: LineInputsType | 'radius' + argType: LineInputsType expr: T } @@ -102,14 +102,14 @@ interface ArrayOrObjItemInput { type: 'arrayOrObjItem' key: VarValueKeys index: 0 | 1 - argType: LineInputsType | 'radius' + argType: LineInputsType expr: T } interface ArrayInObject { type: 'arrayInObject' key: VarValueKeys - argType: LineInputsType | 'radius' + argType: LineInputsType index: 0 | 1 expr: T }