From fd828c0ade20e4f8cbf67953a8a9d58a1bbfe18a Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Tue, 17 Nov 2026 12:33:53 +0800 Subject: [PATCH] test(plugins): keep the editor panel's problem levels out of the text catalog (#3896) The severity map's `hint: "weakWarning"` entry read as UI text to the text-catalog check (`hint` is a text property), failing it on main since #3885. A function maps the levels instead. --- src/features/plugins/views/editorPanel.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/features/plugins/views/editorPanel.tsx b/src/features/plugins/views/editorPanel.tsx index 75f2e9c0f..d2fd94050 100644 --- a/src/features/plugins/views/editorPanel.tsx +++ b/src/features/plugins/views/editorPanel.tsx @@ -42,12 +42,8 @@ export interface EditorPanelDecl { } /** The marker bar's levels (IDEA's): `info` is a weak warning; hints have no mark. */ -const PROBLEM_LEVEL: Record = { - error: "error", - warning: "warning", - info: "weakWarning", - hint: "weakWarning", -}; +const problemLevel = (severity: Severity): EditorProblem["severity"] => + severity === "error" || severity === "warning" ? severity : "weakWarning"; const syntaxMarks = new Map(); const syntaxMark = (classes: string) => { @@ -280,7 +276,7 @@ export class PanelEditor implements FrameEditor { return markerBarProblems(view.state).map((m) => ({ line: doc.lineAt(m.from).number - 1, lastLine: doc.lineAt(Math.max(m.from, m.to - 1)).number - 1, - severity: PROBLEM_LEVEL[m.severity], + severity: problemLevel(m.severity), })); }