chore: cleanup broken tests, add extra documentation, make sure everything is clean and code style isn't inconsistant

This commit is contained in:
Björn Otgaar
2025-11-19 10:13:08 +01:00
parent 8c2e51114e
commit f37df1c726
12 changed files with 56 additions and 74 deletions

View File

@@ -24,10 +24,8 @@ export type PhaseNodeData = {
hasReduce: boolean;
};
export type PhaseNode = Node<PhaseNodeData>
/**
* Defines how a phase node should be rendered
* @param props NodeProps, like id, label, children
@@ -36,9 +34,7 @@ export type PhaseNode = Node<PhaseNodeData>
export default function PhaseNode(props: NodeProps<Node>) {
const data = props.data as PhaseNodeData;
const {updateNodeData} = useFlowStore();
const updateLabel = (value: string) => updateNodeData(props.id, {...data, label: value});
const label_input_id = `phase_${props.id}_label_input`;
return (
@@ -62,10 +58,11 @@ export default function PhaseNode(props: NodeProps<Node>) {
);
};
/**
* Reduces each phase, including its children down into its relevant data.
* @param props: The Node Properties of this node.
* @param node the node which is being reduced
* @param nodes all the nodes currently in the flow.
* @returns A collection of all reduced nodes in this phase, starting with this phases' reduced data.
*/
export function PhaseReduce(node: Node, nodes: Node[]) {
const thisnode = node as PhaseNode;
@@ -104,7 +101,12 @@ export function PhaseReduce(node: Node, nodes: Node[]) {
return result;
}
/**
* This function is called whenever a connection is made with this node type (phase)
* @param thisNode the node of this node type which function is called
* @param otherNode the other node which was part of the connection
* @param isThisSource whether this instance of the node was the source in the connection, true = yes.
*/
export function PhaseConnects(thisNode: Node, otherNode: Node, isThisSource: boolean) {
console.log("Connect functionality called.")
const node = thisNode as PhaseNode