From 7c98482c0b6a23c1f0de613c05c4433cf99ef44f Mon Sep 17 00:00:00 2001 From: Adelin Danaila Date: Fri, 13 Mar 2026 00:09:01 +0200 Subject: [PATCH 1/2] fix(ui): improve edit control ux, no layout shift, consistent label spacing --- .../edit-control/evaluator-config-section.tsx | 77 ++++++++++--------- .../edit-control/evaluator-json-view.tsx | 11 +++ ui/src/pages/_app.tsx | 4 +- ui/src/theme.ts | 49 ++++++++++++ 4 files changed, 104 insertions(+), 37 deletions(-) create mode 100644 ui/src/theme.ts diff --git a/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-config-section.tsx b/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-config-section.tsx index 077ea210..6251617e 100644 --- a/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-config-section.tsx +++ b/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-config-section.tsx @@ -1,5 +1,6 @@ import { Anchor, + Box, Group, Paper, ScrollArea, @@ -17,6 +18,7 @@ import { EvaluatorJsonView } from './evaluator-json-view'; import type { ConfigViewMode } from './types'; const DEFAULT_HEIGHT = 450; +const CONTENT_MIN_HEIGHT_EXTRA = 60; type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid'; type EvaluatorConfigSectionProps = { @@ -91,45 +93,48 @@ export function EvaluatorConfigSection({ - + + {statusLabel ? ( + + {statusLabel} + + ) : null} + + - {statusLabel ? ( - - {statusLabel} - - ) : null} - - {configViewMode === 'form' && ( - - {FormComponent ? ( - - ) : ( - - No form available for this evaluator. Use JSON view to - configure. - - )} - - )} + + {configViewMode === 'form' && ( + + {FormComponent ? ( + + ) : ( + + No form available for this evaluator. Use JSON view to + configure. + + )} + + )} - {configViewMode === 'json' && ( - - )} + {configViewMode === 'json' && ( + + )} + ); diff --git a/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-json-view.tsx b/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-json-view.tsx index cd218098..e9560df6 100644 --- a/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-json-view.tsx +++ b/ui/src/core/page-components/agent-detail/modals/edit-control/evaluator-json-view.tsx @@ -3,6 +3,10 @@ import { useDebouncedValue } from '@mantine/hooks'; import { useEffect, useRef } from 'react'; import { isApiError } from '@/core/api/errors'; +import { + labelPropsInline, + LabelWithTooltip, +} from '@/core/components/label-with-tooltip'; import { ApiErrorAlert } from './api-error-alert'; import type { EvaluatorJsonViewProps } from './types'; @@ -79,6 +83,13 @@ export const EvaluatorJsonView = ({ return (