@@ -17,6 +17,7 @@ import { EvaluatorJsonView } from './evaluator-json-view';
1717import type { ConfigViewMode } from './types' ;
1818
1919const DEFAULT_HEIGHT = 450 ;
20+ const CONTENT_MIN_HEIGHT_EXTRA = 60 ;
2021type ValidationStatus = 'idle' | 'validating' | 'valid' | 'invalid' ;
2122
2223type EvaluatorConfigSectionProps = {
@@ -72,6 +73,8 @@ export function EvaluatorConfigSection({
7273 ? 'red'
7374 : 'dimmed' ;
7475
76+ const contentHeight = height + CONTENT_MIN_HEIGHT_EXTRA ;
77+
7578 return (
7679 < Stack gap = "md" >
7780 < Group justify = "space-between" align = "center" >
@@ -91,45 +94,44 @@ export function EvaluatorConfigSection({
9194 </ Group >
9295 </ Anchor >
9396 </ Group >
94- < SegmentedControl
95- value = { configViewMode }
96- onChange = { handleConfigViewModeChange }
97- disabled = { configViewMode === 'json' && ! ! jsonError }
98- data = { [
99- { value : 'form' , label : 'Form' } ,
100- { value : 'json' , label : 'JSON' } ,
101- ] }
102- size = "xs"
103- />
97+ < Group gap = "xs" align = "center" >
98+ { statusLabel ? (
99+ < Text size = "xs" c = { statusColor } >
100+ { statusLabel }
101+ </ Text >
102+ ) : null }
103+ < SegmentedControl
104+ value = { configViewMode }
105+ onChange = { handleConfigViewModeChange }
106+ disabled = { configViewMode === 'json' && ! ! jsonError }
107+ data = { [
108+ { value : 'form' , label : 'Form' } ,
109+ { value : 'json' , label : 'JSON' } ,
110+ ] }
111+ size = "xs"
112+ />
113+ </ Group >
104114 </ Group >
105- { statusLabel ? (
106- < Text size = "xs" c = { statusColor } >
107- { statusLabel }
108- </ Text >
109- ) : null }
110-
111115 < Paper withBorder radius = "sm" p = { 16 } >
112- { configViewMode === 'form' && (
113- < ScrollArea h = { height } type = "auto" >
114- { FormComponent ? (
116+ < ScrollArea h = { contentHeight } type = "always" offsetScrollbars = "y" >
117+ { configViewMode === 'form' ? (
118+ FormComponent ? (
115119 < FormComponent form = { evaluatorForm } />
116120 ) : (
117121 < Text c = "dimmed" ta = "center" py = "xl" >
118122 No form available for this evaluator. Use JSON view to
119123 configure.
120124 </ Text >
121- ) }
122- </ ScrollArea >
123- ) }
124-
125- { configViewMode === 'json' && (
126- < EvaluatorJsonView
127- onValidateConfig = { onValidateConfig }
128- onValidationStatusChange = { setValidationStatus }
129- height = { height }
130- { ...jsonViewProps }
131- />
132- ) }
125+ )
126+ ) : (
127+ < EvaluatorJsonView
128+ onValidateConfig = { onValidateConfig }
129+ onValidationStatusChange = { setValidationStatus }
130+ height = { height }
131+ { ...jsonViewProps }
132+ />
133+ ) }
134+ </ ScrollArea >
133135 </ Paper >
134136 </ Stack >
135137 ) ;
0 commit comments