From bb77a01779ded443fdcf9e03dfcc44ee5f7b59c9 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Fri, 3 Apr 2026 17:46:43 -0500 Subject: [PATCH] Settings tweaks (#22750) * add ability to order subfields with dot notation * put review genai enabled at the top of the genai subsection * fix genai summary title truncation issue in detail stream --- .../config-form/section-configs/review.ts | 2 +- .../components/overlay/chip/GenAISummaryChip.tsx | 2 +- web/src/components/timeline/DetailStream.tsx | 2 +- web/src/lib/config-schema/transformer.ts | 15 +++++++++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/web/src/components/config-form/section-configs/review.ts b/web/src/components/config-form/section-configs/review.ts index 6f769179d..ce0d7b911 100644 --- a/web/src/components/config-form/section-configs/review.ts +++ b/web/src/components/config-form/section-configs/review.ts @@ -47,7 +47,7 @@ const review: SectionConfigOverrides = { "detections.labels": "/configuration/review/#alerts-and-detections", }, restartRequired: [], - fieldOrder: ["alerts", "detections", "genai"], + fieldOrder: ["alerts", "detections", "genai", "genai.enabled"], fieldGroups: {}, hiddenFields: [ "enabled_in_config", diff --git a/web/src/components/overlay/chip/GenAISummaryChip.tsx b/web/src/components/overlay/chip/GenAISummaryChip.tsx index d5f7a9969..b056c36b2 100644 --- a/web/src/components/overlay/chip/GenAISummaryChip.tsx +++ b/web/src/components/overlay/chip/GenAISummaryChip.tsx @@ -108,7 +108,7 @@ export function GenAISummaryDialog({ return ( -
{children}
+
{children}
- + {review.data.metadata.title} diff --git a/web/src/lib/config-schema/transformer.ts b/web/src/lib/config-schema/transformer.ts index eb57d4c94..797b07ee5 100644 --- a/web/src/lib/config-schema/transformer.ts +++ b/web/src/lib/config-schema/transformer.ts @@ -483,9 +483,20 @@ function generateUiSchema( const schemaObj = schema as Record; - // Set field ordering + // Set field ordering — supports dot notation (e.g. "genai.enabled") if (fieldOrder && fieldOrder.length > 0) { - uiSchema["ui:order"] = [...fieldOrder, "*"]; + const depth = currentPath.length; + const localOrder = fieldOrder + .map((f) => f.split(".")) + .filter((segments) => { + if (segments.length !== depth + 1) return false; + return currentPath.every((p, i) => segments[i] === p); + }) + .map((segments) => segments[depth]); + + if (localOrder.length > 0) { + uiSchema["ui:order"] = [...localOrder, "*"]; + } } if (!isSchemaObject(schemaObj.properties)) {