From 29808a683c7b9b133bf32563282cb71149e2d0dc Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Tue, 21 Oct 2025 14:23:25 +0200 Subject: [PATCH] fired transitions run animation once --- src/App/BottomPanel.tsx | 6 ++++-- src/App/TextDialog.tsx | 13 +++++++------ src/Plant/DigitalWatch/DigitalWatch.tsx | 2 +- src/VisualEditor/VisualEditor.css | 11 ++++++----- src/VisualEditor/VisualEditor.tsx | 15 +++++++++++++++ todo.txt | 1 + 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/App/BottomPanel.tsx b/src/App/BottomPanel.tsx index b829fc6..27d31ce 100644 --- a/src/App/BottomPanel.tsx +++ b/src/App/BottomPanel.tsx @@ -6,9 +6,10 @@ import "./BottomPanel.css"; import head from "../head.svg" ; import { usePersistentState } from "@/util/persistent_state"; import { PersistentDetails } from "./PersistentDetails"; +import { DigitalWatch } from "@/Plant/DigitalWatch/DigitalWatch"; export function BottomPanel(props: {errors: TraceableError[]}) { - const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!"); + const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!"
); useEffect(() => { setTimeout(() => { @@ -17,7 +18,8 @@ export function BottomPanel(props: {errors: TraceableError[]}) { }, []); return
- <>{greeting} + {greeting} + {props.errors.length > 0 &&
diff --git a/src/App/TextDialog.tsx b/src/App/TextDialog.tsx index f524ec8..627aa04 100644 --- a/src/App/TextDialog.tsx +++ b/src/App/TextDialog.tsx @@ -1,9 +1,10 @@ -import { Dispatch, ReactElement, SetStateAction, useState, KeyboardEvent } from "react"; +import { Dispatch, ReactElement, SetStateAction, useState, KeyboardEvent, useEffect, useRef } from "react"; import { parse as parseLabel } from "../statecharts/label_parser"; export function TextDialog(props: {setModal: Dispatch>, text: string, done: (newText: string|undefined) => void}) { const [text, setText] = useState(props.text); + function onKeyDown(e: KeyboardEvent) { if (e.key === "Enter") { if (!e.shiftKey) { @@ -19,19 +20,19 @@ export function TextDialog(props: {setModal: Dispatch Text label:
-