Client for the edf pipeline node; the canvas shows a kind it has no form for by its raw name and leaves it out of the palette

This commit is contained in:
2026-11-28 10:30:49 -06:00
parent 43b5523f99
commit 5ce225df5a
5 changed files with 98 additions and 4 deletions
+10 -3
View File
@@ -47,7 +47,9 @@ function canvasNode(id: string, point: { x: number; y: number }, label: string):
};
}
export const KINDS: Record<Kind, string> = {
/** The kinds the palette offers. A kind the canvas has no form for yet (`edf`, Phase 5) is left
* out of the palette and shown by its raw name when a saved pipeline has one. */
export const KINDS: Partial<Record<Kind, string>> = {
source: 'Fuente',
read: 'Leer',
route: 'Filtrar',
@@ -312,7 +314,7 @@ export class Conectar {
return 'concept_map' in d ? (d.concept_map ?? undefined) : undefined;
}
protected kindLabel(kind: Doc['kind']): string {
return KINDS[kind ?? 'source'];
return kindName(kind);
}
protected cell(value: unknown): string {
return typeof value === 'object' && value !== null
@@ -322,7 +324,12 @@ export class Conectar {
}
function text(d: Doc): string {
return `${KINDS[d.kind ?? 'source']} · ${d.label || d.id}`;
return `${kindName(d.kind)} · ${d.label || d.id}`;
}
function kindName(kind: Doc['kind']): string {
const k = kind ?? 'source';
return KINDS[k] ?? k;
}
/** Each node's distance from the sources: its column when it has no saved position. */