From 111719dd25fd1e9520ab4aa4012a491ca5825e06 Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 29 Jul 2026 23:56:35 +0200 Subject: [PATCH] web/components: keep the editor the same height in both tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the preview pane had its own min-height (min-h-40, or min-h-24 from the comment editor) while the write tab took the textarea's, so toggling tabs resized the whole editor. the pane now takes the field's own height and inset from the exported textareaMinHeight, which leaves nothing to drift, and previewClass — which only existed to set that height — is gone. measured on the editor and reply stories: both tabs render a 256px pane at the same offset. Signed-off-by: eti --- .../lib/components/comment/CommentEditor.svelte | 3 --- web/src/lib/components/ui/MarkdownEditor.svelte | 17 +++++++---------- web/src/lib/components/ui/Textarea.svelte | 6 +++++- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/web/src/lib/components/comment/CommentEditor.svelte b/web/src/lib/components/comment/CommentEditor.svelte index e2a351dd..9d1d01db 100644 --- a/web/src/lib/components/comment/CommentEditor.svelte +++ b/web/src/lib/components/comment/CommentEditor.svelte @@ -28,7 +28,6 @@ markup: MarkupContext; rows?: number; placeholder?: string; - previewClass?: string; submitLabel: string; submitIcon: Component; autofocus?: boolean; @@ -49,7 +48,6 @@ markup, rows = 6, placeholder, - previewClass = "min-h-24", submitLabel, submitIcon, autofocus = false, @@ -121,7 +119,6 @@ (null); let previewing = $state(false); @@ -113,19 +114,15 @@ bind:element={textareaEl} {disabled} onkeydown={handleKeydown} - class={transparent ? "max-h-none bg-transparent" : "max-h-none"} + class={transparent ? "bg-transparent" : undefined} /> {:else if previewHtml} -
+
{@html previewHtml}
{:else} -
+
{previewing ? "Rendering…" : "Nothing to preview."}
{/if} diff --git a/web/src/lib/components/ui/Textarea.svelte b/web/src/lib/components/ui/Textarea.svelte index 26f797cf..960a580b 100644 --- a/web/src/lib/components/ui/Textarea.svelte +++ b/web/src/lib/components/ui/Textarea.svelte @@ -1,9 +1,13 @@