Commit Graph

10 Commits

Author SHA1 Message Date
bincxz 070a9f0daa fix(notes): retry the rich editor with the latest source draft
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>
2026-08-27 20:22:40 +08:00
bincxz 6db5f823ba fix(notes): keep unrenderable markdown visible in the notes editor
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>
2026-08-27 20:13:29 +08:00
bincxz 0fd7bed991 feat(notes): polish editor workflow and presentation 2026-08-24 18:32:56 +08:00
Sammsai ada3d13ca3 修复笔记源码模式光标自动跳到笔记末尾 2026-08-24 00:12:25 +08:00
Sammsai c138e1fc74 修复笔记源码模式光标自动跳到笔记末尾 2026-08-23 19:31:37 +08:00
Sammsai 600544fd7f 修复笔记源码模式光标自动跳到笔记末尾 2026-08-23 14:22:18 +08:00
Sammsai 9b0c07e614 1 2026-08-21 23:35:32 +08:00
Sammsai ea2c2ad301 笔记模块功能优化 2026-08-21 07:19:24 +08:00
Sammsai d98cd37be6 笔记模块问题修复与优化 2026-08-20 22:15:24 +08:00
Sammsai d752897aa1 笔记模块升级 2026-08-20 21:29:48 +08:00