feat: WYSIWYG document editing with Milkdown Crepe#13
Merged
Conversation
Replace the whole-file textarea quick editor with an in-place WYSIWYG surface built on Milkdown's Crepe editor (ProseMirror + remark over plain markdown, no block document model). The pencil now opens the doc as it reads, with a slash menu, block drag handles, a selection toolbar, and live tables; agents remain the primary writers. Editing safety: - Frontmatter is split off before editing and re-attached byte-for-byte on save, so metadata is never reformatted. - An unchanged doc is never rewritten: the dirty check compares against Crepe's own normalized serialization captured at load. - A save is refused if the file changed on disk during the edit session (agent or external write), surfacing a reload prompt instead. The editor is themed to match the reader exactly (prose typography, muted list markers, accent checkboxes, transparent surface) and is lazy-loaded so it stays off the reader's initial bundle. Save/Cancel live in the header where the pencil was. Removes QuickEditor and its test; adds CrepeEditor, its theme, a splitFrontmatter helper with round-trip tests, and saveEdit coverage for the frontmatter, no-op, and on-disk-change paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the whole-file textarea quick editor with an in-place WYSIWYG editing surface built on Milkdown's Crepe editor (ProseMirror + remark over plain markdown - no block document model). The pencil now opens a doc as it reads, with a slash menu, block drag handles, a selection toolbar, and live tables. Agents remain the primary writers; this is the human editing affordance.
Editing safety
UX
React.lazy) so ProseMirror/CodeMirror stay off the reader's initial bundle.Round-trip verification
Headless serialization test (real
@milkdown/crepe,getMarkdown()of loaded samples):$…$,$$…$$)-→*, divider padding); renders identically> [!NOTE]> \[!NOTE]on editThe alert escaping is harmless today (the reader has no alert plugin, so both forms render as a plain blockquote). When alert rendering lands as a Tier-1 reader feature, that work must un-escape alert markers on save.
Validation
tsc --noEmitcleansplitFrontmatterround-trip,saveEditfrontmatter / no-op / on-disk-change coverage; removes QuickEditor + its test)bun run buildsucceedsDeferred
Editor screenshots for
docs/can follow;docs/FEATURES.mdalready describes the WYSIWYG editor in text.