feat: The Big One UI #47

Merged
j.gerla merged 115 commits from temp_screenshot_manual into dev 2026-01-28 08:27:30 +00:00
Showing only changes of commit 487ee30923 - Show all commits

View File

@@ -1,10 +1,11 @@
import {useReactFlow} from "@xyflow/react";
import {useReactFlow, useStoreApi} from "@xyflow/react";
import clsx from "clsx";
import {useEffect, useState} from "react";
import useFlowStore from "../VisProgStores.tsx";
import {
warningSummary,
type WarningSeverity, type EditorWarning
type WarningSeverity,
type EditorWarning, globalWarning
} from "./EditorWarnings.tsx";
import styles from "./WarningSidebar.module.css";
@@ -106,8 +107,11 @@ function WarningListItem(props: { warning: EditorWarning }) {
function useJumpToNode() {
const { getNode, setCenter } = useReactFlow();
const { addSelectedNodes } = useStoreApi().getState();
return (nodeId: string) => {
// user can't jump to global warning, so prevent further logic from running
if (nodeId === globalWarning) return;
const node = getNode(nodeId);
if (!node) return;
@@ -118,7 +122,10 @@ function useJumpToNode() {
position!.x + width / 2,
position!.y + height / 2,
{ zoom: 2, duration: 300 }
);
).then(() => {
// select the node
addSelectedNodes([nodeId]);
});
};
}