From 5930e24bf458b6fbf5df73b18c31fa219e8623dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Otgaar?= Date: Wed, 28 Jan 2026 11:35:34 +0100 Subject: [PATCH] chore: intitial commit, starting seperating concerns for plan editor. --- .../components/PlanEditor.tsx | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/pages/VisProgPage/visualProgrammingUI/components/PlanEditor.tsx b/src/pages/VisProgPage/visualProgrammingUI/components/PlanEditor.tsx index 2c2d098..c5f9d33 100644 --- a/src/pages/VisProgPage/visualProgrammingUI/components/PlanEditor.tsx +++ b/src/pages/VisProgPage/visualProgrammingUI/components/PlanEditor.tsx @@ -12,6 +12,32 @@ type PlanEditorDialogProps = { description? : string; }; + +/** + * Creates an action, as a step for a plan. + * @param type the type of action to build + * @param value the value of this action to build + * @param isGestureTag whether or not this action, restricted to gestures, is a tag. + * @returns An action + */ +function createAction( + type: ActionTypes, + value: string, + isGestureTag: boolean +): Action { + const id = crypto.randomUUID(); + + switch (type) { + case "speech": + return { id, text: value, type: "speech" }; + case "gesture": + return { id, gesture: value, isTag: isGestureTag, type: "gesture" }; + case "llm": + return { id, goal: value, type: "llm" }; + } +} + + export default function PlanEditorDialog({ plan, onSave,