diff --git a/ui/src/components/cliproxy/provider-editor/raw-editor-section.tsx b/ui/src/components/cliproxy/provider-editor/raw-editor-section.tsx index bae26325..904a4dcc 100644 --- a/ui/src/components/cliproxy/provider-editor/raw-editor-section.tsx +++ b/ui/src/components/cliproxy/provider-editor/raw-editor-section.tsx @@ -32,7 +32,7 @@ export function RawEditorSection({ } > -
+
{!isRawJsonValid && rawJsonEdits !== null && (
@@ -56,13 +56,14 @@ export function RawEditorSection({
)} -
+
diff --git a/ui/src/components/compatible-cli/raw-json-settings-editor-panel.tsx b/ui/src/components/compatible-cli/raw-json-settings-editor-panel.tsx index 6eec468b..0a84103a 100644 --- a/ui/src/components/compatible-cli/raw-json-settings-editor-panel.tsx +++ b/ui/src/components/compatible-cli/raw-json-settings-editor-panel.tsx @@ -85,15 +85,21 @@ export function RawJsonSettingsEditorPanel({ Loading settings.json...
) : ( -
+
{parseWarning && (
Parse warning: {parseWarning}
)} -
+
- +
diff --git a/ui/src/components/copilot/config-form/raw-editor-section.tsx b/ui/src/components/copilot/config-form/raw-editor-section.tsx index 6a13c9e1..b1369951 100644 --- a/ui/src/components/copilot/config-form/raw-editor-section.tsx +++ b/ui/src/components/copilot/config-form/raw-editor-section.tsx @@ -40,7 +40,7 @@ export function RawEditorSection({
} > -
+
{!isRawJsonValid && rawJsonEdits !== null && (
@@ -63,13 +63,14 @@ export function RawEditorSection({
)} -
+
diff --git a/ui/src/components/profiles/editor/raw-editor-section.tsx b/ui/src/components/profiles/editor/raw-editor-section.tsx index d4bbe4ac..686fb2e7 100644 --- a/ui/src/components/profiles/editor/raw-editor-section.tsx +++ b/ui/src/components/profiles/editor/raw-editor-section.tsx @@ -41,7 +41,7 @@ export function RawEditorSection({
} > -
+
{!isRawJsonValid && rawJsonEdits !== null && (
@@ -64,13 +64,14 @@ export function RawEditorSection({
)} -
+
diff --git a/ui/src/components/shared/code-editor.tsx b/ui/src/components/shared/code-editor.tsx index 47f95edc..e1dd049e 100644 --- a/ui/src/components/shared/code-editor.tsx +++ b/ui/src/components/shared/code-editor.tsx @@ -20,6 +20,7 @@ interface CodeEditorProps { readonly?: boolean; className?: string; minHeight?: string; + heightMode?: 'content' | 'fill-parent'; } interface ValidationResult { @@ -70,10 +71,12 @@ export function CodeEditor({ readonly = false, className, minHeight = '300px', + heightMode = 'content', }: CodeEditorProps) { const { isDark } = useTheme(); const [isFocused, setIsFocused] = useState(false); const [isMasked, setIsMasked] = useState(true); + const isFillParent = heightMode === 'fill-parent'; // Validate on every change for JSON const validation = useMemo(() => { @@ -153,7 +156,7 @@ export function CodeEditor({ ); return ( -
+
{/* Editor container */}
- {} : onChange} - highlight={highlightCode} - key={isDark ? 'dark-editor' : 'light-editor'} - padding={12} - disabled={readonly} - onFocus={() => setIsFocused(true)} - onBlur={() => setIsFocused(false)} - textareaClassName={cn( - 'focus:outline-none font-mono text-sm', - readonly && 'cursor-not-allowed' - )} - preClassName="font-mono text-sm" - style={{ - fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace', - fontSize: '0.875rem', - minHeight, - }} - /> +
+ {} : onChange} + highlight={highlightCode} + key={isDark ? 'dark-editor' : 'light-editor'} + padding={12} + disabled={readonly} + onFocus={() => setIsFocused(true)} + onBlur={() => setIsFocused(false)} + textareaClassName={cn( + 'focus:outline-none font-mono text-sm', + readonly && 'cursor-not-allowed' + )} + preClassName="font-mono text-sm" + style={{ + fontFamily: 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace', + fontSize: '0.875rem', + minHeight, + }} + /> +
{/* Secrets Toggle Overlay */}
diff --git a/ui/src/components/shared/settings-dialog.tsx b/ui/src/components/shared/settings-dialog.tsx index faeffb54..dac1321d 100644 --- a/ui/src/components/shared/settings-dialog.tsx +++ b/ui/src/components/shared/settings-dialog.tsx @@ -279,7 +279,7 @@ function SettingsDialogContent({ - + @@ -293,6 +293,7 @@ function SettingsDialogContent({ onChange={handleRawJsonChange} language="json" minHeight="calc(60vh - 120px)" + heightMode="fill-parent" /> diff --git a/ui/src/pages/cliproxy-ai-providers.tsx b/ui/src/pages/cliproxy-ai-providers.tsx index f7a492f2..b7a8c79e 100644 --- a/ui/src/pages/cliproxy-ai-providers.tsx +++ b/ui/src/pages/cliproxy-ai-providers.tsx @@ -1248,6 +1248,7 @@ function EntryInspector({ onChange={handleRawJsonChange} language="json" minHeight="100%" + heightMode="fill-parent" />
@@ -1271,6 +1272,7 @@ function EntryInspector({ language="json" readonly minHeight="100%" + heightMode="fill-parent" />