From 1f9203e1da2feb2d1a177993ff9786ad520e9a3d Mon Sep 17 00:00:00 2001 From: David Kaya Date: Wed, 25 Mar 2026 19:35:25 +0100 Subject: [PATCH] fix: send button clearance and code block display mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Increase editable min-height from 40px to 52px and padding from 8px to 10px so the send button (32px + 8px bottom offset) has 12px clearance from the toolbar border instead of 0px - Add display: block to .mc-code-block — Lexical CodeNode renders as which is inline by default, causing border/padding to split visually across lines instead of forming a proper block - Revert empty code block to code.select() without synthetic TextNode Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/renderer/components/MarkdownComposer.tsx | 6 +++--- src/renderer/styles.css | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/renderer/components/MarkdownComposer.tsx b/src/renderer/components/MarkdownComposer.tsx index cea285f..957bf3e 100644 --- a/src/renderer/components/MarkdownComposer.tsx +++ b/src/renderer/components/MarkdownComposer.tsx @@ -284,10 +284,10 @@ function ToolbarPlugin({ disabled }: { disabled: boolean }) { p.selectEnd(); } else { const code = $createCodeNode(); - const textNode = $createTextNode(topElement.getTextContent()); - code.append(textNode); + const text = topElement.getTextContent(); + if (text) code.append($createTextNode(text)); topElement.replace(code); - textNode.select(0, 0); + code.select(); } }); }, [editor]); diff --git a/src/renderer/styles.css b/src/renderer/styles.css index 441ea7c..c2e8243 100644 --- a/src/renderer/styles.css +++ b/src/renderer/styles.css @@ -147,10 +147,10 @@ textarea { } .markdown-composer-editable { - min-height: 40px; + min-height: 52px; max-height: 200px; overflow-y: auto; - padding: 8px 48px 8px 16px; + padding: 10px 48px 10px 16px; font-size: 14px; line-height: 1.6; color: #f4f4f5; @@ -165,7 +165,7 @@ textarea { .markdown-composer-placeholder { position: absolute; - top: 8px; + top: 10px; left: 16px; font-size: 14px; line-height: 1.6; @@ -227,10 +227,11 @@ textarea { /* Code block */ .mc-code-block { + display: block; background: rgba(24, 24, 27, 0.8); border: 1px solid #27272a; border-radius: 6px; - padding: 8px 12px; + padding: 6px 10px; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace; font-size: 0.9em; white-space: pre-wrap;