Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Commit a675db5

Browse files
Fix flow blueprint layout (#117)
* Fixed typos in blueprint code * Pull in newer trustgraph/react-state
1 parent 91dcb7f commit a675db5

3 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎package-lock.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@tanstack/react-table": "^8.21.3",
2323
"@trustgraph/client": "^1.2.1",
2424
"@trustgraph/react-provider": "^1.2.0",
25-
"@trustgraph/react-state": "^1.2.0",
25+
"@trustgraph/react-state": "^1.2.1",
2626
"@types/dagre": "^0.7.53",
2727
"compute-cosine-similarity": "^1.1.0",
2828
"dagre": "^0.8.5",

‎src/components/flow-blueprints/FlowBlueprintEditorView.tsx‎

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ const nodeTypes = {
301301
interface: InterfaceNode,
302302
};
303303

304-
interface FlowBlueprints {
304+
interface FlowBlueprint {
305305
blueprint?: Record<string, unknown>;
306306
flow?: Record<string, unknown>;
307307
}
@@ -311,7 +311,7 @@ const generateNodesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Node[] =
311311
const nodes: Node[] = [];
312312

313313
// Add blueprint processors
314-
Object.keys(flowBlueprints.blueprint || {}).forEach((processorName) => {
314+
Object.keys(flowBlueprint.blueprint || {}).forEach((processorName) => {
315315
// Strip template suffix to get base processor name for service map lookup
316316
const baseProcessorName = processorName.replace(/:\{[^}]+\}$/, "");
317317

@@ -343,7 +343,7 @@ const generateNodesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Node[] =
343343
});
344344

345345
// Add flow processors
346-
Object.keys(flowBlueprints.flow || {}).forEach((processorName) => {
346+
Object.keys(flowBlueprint.flow || {}).forEach((processorName) => {
347347
// Strip template suffix to get base processor name for service map lookup
348348
const baseProcessorName = processorName.replace(/:\{[^}]+\}$/, "");
349349

@@ -375,7 +375,7 @@ const generateNodesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Node[] =
375375
});
376376

377377
// Add interface nodes
378-
Object.entries(flowBlueprints.interfaces || {}).forEach(
378+
Object.entries(flowBlueprint.interfaces || {}).forEach(
379379
([interfaceName, interfaceQueues]) => {
380380
// Look up interface definition in service map
381381
const interfaceDefinition = serviceMap.interfaces?.[interfaceName];
@@ -469,24 +469,24 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
469469
}>
470470
>();
471471

472-
// Collect all processors and their connections from service map + flow blueprint queues
472+
// Collect all processors and their connections from service map + flow class queues
473473
const allProcessors = [
474-
...Object.keys(flowBlueprints.blueprint || {}).map((name) => ({
474+
...Object.keys(flowBlueprint.blueprint || {}).map((name) => ({
475475
name,
476476
type: "blueprint",
477477
baseProcessorName: name.replace(/:\{[^}]+\}$/, ""),
478-
flowBlueprintsConnections: flowBlueprint.blueprint[name],
478+
flowBlueprintConnections: flowBlueprint.blueprint[name],
479479
})),
480-
...Object.keys(flowBlueprints.flow || {}).map((name) => ({
480+
...Object.keys(flowBlueprint.flow || {}).map((name) => ({
481481
name,
482482
type: "flow",
483483
baseProcessorName: name.replace(/:\{[^}]+\}$/, ""),
484-
flowBlueprintsConnections: flowBlueprint.flow[name],
484+
flowBlueprintConnections: flowBlueprint.flow[name],
485485
})),
486486
];
487487

488488
allProcessors.forEach(
489-
({ name, type, baseProcessorName, flowBlueprintsConnections }) => {
489+
({ name, type, baseProcessorName, flowBlueprintConnections }) => {
490490
const processorInfo = serviceMap.processors[baseProcessorName];
491491
if (!processorInfo?.connections) return;
492492

@@ -505,21 +505,21 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
505505
// For providers: look for request and response
506506
if (connection.role === "provides") {
507507
queues = {
508-
request: flowBlueprintsConnections.request,
509-
response: flowBlueprintsConnections.response,
508+
request: flowBlueprintConnections.request,
509+
response: flowBlueprintConnections.response,
510510
};
511511
} else if (connection.role === "consumes") {
512512
queues = {
513-
request: flowBlueprintsConnections[`${connection.name}-request`],
514-
response: flowBlueprintsConnections[`${connection.name}-response`],
513+
request: flowBlueprintConnections[`${connection.name}-request`],
514+
response: flowBlueprintConnections[`${connection.name}-response`],
515515
};
516516
}
517517
} else if (connectionKind === "flow") {
518518
// For flow: single queue value at connection.name
519-
queues = { value: flowBlueprintsConnections[connection.name] };
519+
queues = { value: flowBlueprintConnections[connection.name] };
520520
} else if (connectionKind === "passive") {
521521
// For passive: both consumer and provider use single queue value
522-
queues = { value: flowBlueprintsConnections[connection.name] };
522+
queues = { value: flowBlueprintConnections[connection.name] };
523523
}
524524

525525
// Only add if we found valid queues
@@ -609,7 +609,7 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
609609

610610
// Connect interfaces to their implementing processors
611611

612-
Object.entries(flowBlueprints.interfaces || {}).forEach(
612+
Object.entries(flowBlueprint.interfaces || {}).forEach(
613613
([interfaceName, interfaceQueues]) => {
614614
const interfaceDefinition = serviceMap.interfaces?.[interfaceName];
615615
const interfaceKind = interfaceDefinition?.kind;
@@ -620,7 +620,7 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
620620

621621
// Find processors that match this interface's queue pattern
622622
allProcessors.forEach(
623-
({ name, type, baseProcessorName, flowBlueprintsConnections }) => {
623+
({ name, type, baseProcessorName, flowBlueprintConnections }) => {
624624
const processorId = `${type}-${name}`;
625625
const processorInfo = serviceMap.processors[baseProcessorName];
626626
if (!processorInfo?.connections) return;
@@ -639,8 +639,8 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
639639

640640
// Check if this processor provides this service
641641
if (
642-
flowBlueprintsConnections.request === interfaceRequest &&
643-
flowBlueprintsConnections.response === interfaceResponse
642+
flowBlueprintConnections.request === interfaceRequest &&
643+
flowBlueprintConnections.response === interfaceResponse
644644
) {
645645
// Find the service connection that provides
646646
matchingConnection = processorInfo.connections.find(
@@ -657,7 +657,7 @@ const generateEdgesFromFlowBlueprints = (flowBlueprint: FlowBlueprint): Edge[] =
657657
// Check only provider connections for matching queue
658658
processorInfo.connections.forEach((connection) => {
659659
if (connection.role === "provides") {
660-
const connectionQueue = flowBlueprintsConnections[connection.name];
660+
const connectionQueue = flowBlueprintConnections[connection.name];
661661
if (connectionQueue === interfaceQueue) {
662662
matchingConnection = connection;
663663
isMatch = true;
@@ -740,7 +740,7 @@ export const FlowBlueprintEditorView: React.FC<FlowBlueprintEditorViewProps> = (
740740
[setEdges],
741741
);
742742

743-
if (!flowBlueprints) {
743+
if (!flowBlueprint) {
744744
return (
745745
<Box p={6}>
746746
<HStack spacing={4} mb={4}>
@@ -790,7 +790,7 @@ export const FlowBlueprintEditorView: React.FC<FlowBlueprintEditorViewProps> = (
790790
</HStack>
791791

792792
<VStack spacing={2} align="start" w="100%">
793-
<Heading size="lg">{flowBlueprints.name}</Heading>
793+
<Heading size="lg">{flowBlueprint?.name}</Heading>
794794
</VStack>
795795

796796
<Separator />

0 commit comments

Comments
 (0)