fix: content area unified branch (text+markdown→textarea/preview, richtext→RTE), no null dead-end

This commit is contained in:
Antigravity
2026-05-07 22:43:51 +00:00
parent 7bc63158bf
commit db899b0da2

View File

@@ -816,10 +816,10 @@ export function NoteEditor({ note, readOnly = false, onClose, fullPage = false }
<RichTextEditor
content={content}
onChange={(v) => { setContent(v); setIsDirty(true) }}
className="min-h-[300px] text-lg font-light leading-relaxed text-foreground/80"
className="min-h-[60vh] text-lg font-light leading-relaxed text-foreground/80"
onImageUpload={uploadImageFile}
/>
) : noteType === 'markdown' && showMarkdownPreview ? (
) : (noteType === 'markdown' || noteType === 'text') && showMarkdownPreview ? (
<div
className="min-h-[300px] cursor-text prose prose-lg dark:prose-invert max-w-none leading-relaxed"
onClick={() => !readOnly && setShowMarkdownPreview(false)}
@@ -831,7 +831,7 @@ export function NoteEditor({ note, readOnly = false, onClose, fullPage = false }
</p>
)}
</div>
) : noteType === 'text' || noteType === 'markdown' ? (
) : (
<div className="relative">
<textarea
ref={textareaRef}
@@ -843,13 +843,13 @@ export function NoteEditor({ note, readOnly = false, onClose, fullPage = false }
disabled={readOnly}
className="w-full min-h-[60vh] border-0 outline-none px-0 bg-transparent text-lg leading-relaxed font-light resize-none placeholder:text-foreground/20 text-foreground/80"
/>
{noteType === 'markdown' && content && !readOnly && (
{content && !readOnly && (
<button
type="button"
onClick={() => setShowMarkdownPreview(true)}
className="mt-2 text-[11px] text-foreground/40 hover:text-foreground flex items-center gap-1.5 transition-colors"
>
<Eye className="h-3 w-3" /> Preview Markdown
<Eye className="h-3 w-3" /> Preview
</button>
)}
{!readOnly && (
@@ -860,7 +860,7 @@ export function NoteEditor({ note, readOnly = false, onClose, fullPage = false }
/>
)}
</div>
) : null}
)}
</div>
</div>
</div>