From ea62d68cddd6ec1a5906fdece4c536e3e9f76619 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Thu, 7 May 2026 23:09:45 +0000 Subject: [PATCH] fix: sticky header needs overflow-y-auto parent, textarea auto-resize on preview toggle, markdown source always visible --- memento-note/components/home-client.tsx | 4 ++-- memento-note/components/note-editor.tsx | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/memento-note/components/home-client.tsx b/memento-note/components/home-client.tsx index 88d55ca..859dcb7 100644 --- a/memento-note/components/home-client.tsx +++ b/memento-note/components/home-client.tsx @@ -358,7 +358,7 @@ export function HomeClient({ initialNotes, initialSettings }: HomeClientProps) { fullPage /> ) : ( - <> +
- +
)} diff --git a/memento-note/components/note-editor.tsx b/memento-note/components/note-editor.tsx index 5c8cef8..56c59d0 100644 --- a/memento-note/components/note-editor.tsx +++ b/memento-note/components/note-editor.tsx @@ -266,6 +266,20 @@ export function NoteEditor({ note, readOnly = false, onClose, fullPage = false } el.style.height = Math.max(el.scrollHeight, 280) + 'px' }, [content]) + // Also auto-grow when switching FROM preview TO edit mode + useEffect(() => { + if (showMarkdownPreview) return // we're in preview, textarea not mounted + // Defer one frame so the textarea is in the DOM + const raf = requestAnimationFrame(() => { + const el = textareaRef.current + if (!el) return + el.style.height = 'auto' + el.style.height = Math.max(el.scrollHeight, 280) + 'px' + el.focus() + }) + return () => cancelAnimationFrame(raf) + }, [showMarkdownPreview]) + const handleRemoveImage = (index: number) => { const removedUrl = images[index] setImages(images.filter((_, i) => i !== index))