From b3b77b94ad0bb0d68a98900b529c9c806efffe0c Mon Sep 17 00:00:00 2001 From: JGerla Date: Wed, 14 Jan 2026 16:11:48 +0100 Subject: [PATCH] feat: slightly modified structure for better global logic ref: N25B-450 --- .../visualProgrammingUI/EditorWarnings.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/pages/VisProgPage/visualProgrammingUI/EditorWarnings.tsx b/src/pages/VisProgPage/visualProgrammingUI/EditorWarnings.tsx index 54c5c11..65f8e6c 100644 --- a/src/pages/VisProgPage/visualProgrammingUI/EditorWarnings.tsx +++ b/src/pages/VisProgPage/visualProgrammingUI/EditorWarnings.tsx @@ -21,17 +21,13 @@ export type EditorWarning = { }; /** - * either a single warningType, or a scoped warningKey. - * - * supported-scopes: - * - `handle` + * a scoped WarningKey, + * `handleId` is `null` if the warning is not specific to one handle on the node */ -export type WarningKey = - | WarningType // for warnings that can only occur once per node - | { type: WarningType, handleId: string }; // for warnings that can occur on a per-handle basis +export type WarningKey = { type: WarningType, handleId: string | null }; // for warnings that can occur on a per-handle basis export type WarningRegistry = Map>; -export type SeverityIndex = Map>; +export type SeverityIndex = Map>; export type EditorWarningRegistry = { editorWarningRegistry: WarningRegistry; @@ -76,8 +72,8 @@ export type EditorWarningRegistry = { export const editorWarningRegistry : EditorWarningRegistry = { editorWarningRegistry: new Map>(), severityIndex: new Map([ - ['INFO', new Set()], - ['WARNING', new Set()] + ['INFO', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()], + ['WARNING', new Set<{ nodeId: NodeId, warningKey: WarningKey}>()] ]), getWarningsBySeverity: (_warningSeverity) => { return []},