From aba7589cb41ebfcd18dd43260f6047d851c3c2d9 Mon Sep 17 00:00:00 2001 From: Sergey Kozyrenko Date: Sun, 5 Jul 2026 10:29:15 +0700 Subject: [PATCH] refactor(markdown-editor): collapse MarkdownEditorField class props to one className MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MarkdownEditorField exposed three class props — className (rich wrapper), contentClassName (rich content area), rawClassName (raw textarea). They are the same concept: "size the field's outer box." The rich wrapper and the raw textarea take identical flex/min-height layout, and contentClassName was used by exactly one consumer for a mobile content floor that a wrapper min-height expresses just as well. Collapse to a single `className` applied to whichever element renders. Drop the now-dead contentClassName prop from the underlying MarkdownEditor too. Consumers: knowledge non-fillParent bumps min-h-[280px]→min-h-[320px] to keep the mobile content area at ~240px once the toolbar wraps (previously floored via contentClassName); template/prompt raw drop the min-h-[640px] floor and become min-h-0 flex-1 like rich — flex-1 already fills at normal viewports (820px measured), and raw now shrinks-and-scrolls consistently with rich on short ones. Co-Authored-By: Claude Opus 4.8 --- .../shared/markdown-editor/markdown-editor-field.tsx | 11 +++-------- .../shared/markdown-editor/markdown-editor.tsx | 3 --- .../features/knowledges/knowledge-form-controls.tsx | 4 +--- frontend/src/pages/settings/settings-prompt.tsx | 1 - frontend/src/pages/templates/template.tsx | 1 - 5 files changed, 4 insertions(+), 16 deletions(-) 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 ae97327a..8e9cb810 100644 --- a/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx +++ b/frontend/src/components/shared/markdown-editor/markdown-editor-field.tsx @@ -14,10 +14,9 @@ import type { EditorViewMode } from './markdown-editor-view-mode'; const MarkdownEditor = lazy(() => import('./markdown-editor').then((module) => ({ default: module.MarkdownEditor }))); interface MarkdownEditorFieldProps extends Pick { - // `className` styles the rich wrapper, `rawClassName` the raw