Keep the retry markdown override only while the parent prop still contains
the stale body that originally failed MDX import. Once NotesManager's
source-draft debounce catches up, the editor goes back to normal prop
synchronization instead of keeping an old retry seed around.
Co-Authored-By: Claude <noreply@anthropic.com>
Codex review follow-ups for the unrenderable-markdown fallback:
- Retry now seeds the MDX import from the editor's latest accepted source
draft. NotesManager debounces source drafts (300 ms), so retrying right
after fixing the markdown could remount the rich editor with the stale
pre-fix `value` prop and drop straight back into the fallback.
- The read-only preview fallback no longer mutates the note: NoteSourceEditor
skips its custom Tab insertion, undo/redo handling and imperative
insertAction when readOnly is set (the DOM readOnly attribute alone did
not block those paths).
Co-Authored-By: Claude <noreply@anthropic.com>
The Vault notes rich editor parses note content as MDX. Some valid
CommonMark is not valid MDX — most commonly an unbalanced angle tag such
as `mysql -h <host> -u <user>` written in prose. When mdxeditor fails to
import the markdown it clears the lexical document and only reports the
failure through its onError callback, which netcatty never wired up. The
note then rendered as an empty editor with just the placeholder, while
the content was still intact in the vault (export/copy still worked).
This is exactly the note-view half of #3167: the AI wrote a skill
document into Vault → Notes, the note showed no content, and exporting
it produced a complete markdown file.
The editor now listens to MDXEditor's onError and falls back to the raw
markdown source view with a short notice, so the content is always
visible (and editable) instead of silently blank. Recovery is
deterministic: switching note or editor mode retries the rich import,
and the notice offers an explicit retry.
Co-Authored-By: Claude <noreply@anthropic.com>