Skip to content

Fully autonomous AI Agents system capable of performing complex penetration testing tasks

refactor(markdown-editor): default the field to fill its flex parent

Sergey Kozyrenko57988fba5842
diff --git a/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx b/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx
index 739bcd1a..456d3acd 100644
--- a/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx
+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx
@@ -79,6 +79,10 @@ export function MarkdownEditorField({
[mode, onChange, disabled],
);
+ // The editor fills its flex parent by default (every form embeds it in a `flex min-h-0 flex-col` column);
+ // applied FIRST so a consumer can override the height — e.g. a fixed `min-h-[…]` when it isn't in a flex box.
+ const boxClassName = cn('min-h-0 flex-1', className);
+
if (mode === 'raw') {
return (
<Textarea
@@ -86,7 +90,7 @@ export function MarkdownEditorField({
aria-invalid={ariaInvalid}
autoSize={false}
// Raw config is applied LAST so a consumer `className` can't override the byte-exact source styling.
- className={cn(className, 'aria-invalid:border-destructive resize-none font-mono text-sm')}
+ className={cn(boxClassName, 'aria-invalid:border-destructive resize-none font-mono text-sm')}
disabled={disabled}
id={id}
onBlur={onBlur}
@@ -109,7 +113,7 @@ export function MarkdownEditorField({
MARKDOWN_EDITOR_WRAPPER_CLASS,
'items-center justify-center',
disabled && 'pointer-events-none opacity-60',
- className,
+ boxClassName,
)}
id={id}
>
@@ -120,7 +124,7 @@ export function MarkdownEditorField({
<MarkdownEditor
aria-describedby={ariaDescribedby}
aria-invalid={ariaInvalid}
- className={className}
+ className={boxClassName}
disabled={disabled}
id={id}
onBlur={onBlur}
diff --git a/frontend/src/features/knowledges/knowledge-form-controls.tsx b/frontend/src/features/knowledges/knowledge-form-controls.tsx
index da887c5b..ebb2957d 100644
--- a/frontend/src/features/knowledges/knowledge-form-controls.tsx
+++ b/frontend/src/features/knowledges/knowledge-form-controls.tsx
@@ -99,7 +99,7 @@ export function KnowledgeContentField({
{hasLabel ? <FormLabel>Content</FormLabel> : null}
<FormControl>
<MarkdownEditorField
- className={fillParent ? 'min-h-0 flex-1' : 'min-h-[calc(100dvh-5rem)]'}
+ className={fillParent ? undefined : 'min-h-[calc(100dvh-5rem)]'}
disabled={isSaving}
mode={viewMode}
onBlur={field.onBlur}
diff --git a/frontend/src/pages/settings/settings-prompt.tsx b/frontend/src/pages/settings/settings-prompt.tsx
index 1e648c37..b08d1ee2 100644
--- a/frontend/src/pages/settings/settings-prompt.tsx
+++ b/frontend/src/pages/settings/settings-prompt.tsx
@@ -255,7 +255,6 @@ function FormMarkdownItem<T extends FieldValues>({
<FormItem className="flex min-h-0 flex-1 flex-col">
<FormControl>
<MarkdownEditorField
- className="min-h-0 flex-1"
disabled={disabled}
mode={mode}
onBlur={field.onBlur}
diff --git a/frontend/src/pages/templates/template.tsx b/frontend/src/pages/templates/template.tsx
index 61f6a11c..180ff67b 100644
--- a/frontend/src/pages/templates/template.tsx
+++ b/frontend/src/pages/templates/template.tsx
@@ -672,7 +672,6 @@ function Template() {
<FormItem className="flex min-h-0 flex-1 flex-col">
<FormControl>
<MarkdownEditorField
- className="min-h-0 flex-1"
disabled={isSaving}
mode={viewMode}
onBlur={field.onBlur}