From c10f4dc41d59c2cca4efd083a2e29f8eb0d5acfb Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 29 May 2026 19:51:54 +0000 Subject: [PATCH] Unify markdown on one engine (Milkdown Crepe) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the two-engine setup (MDXEditor for editing + react-markdown for display) with a single Crepe-based component used for both. Editing is inline WYSIWYG with full GFM that actually works — task lists, tables, and code blocks via type-to-create / the slash menu — and read-only mode renders the exact same way, so write and read can no longer drift (the root cause of the heading/list/table/checkbox bugs). - markdown-editor.tsx: Crepe wrapper supporting edit + readOnly, themed to the glass card via --crepe-* variable overrides (scoped to .milkdown so they win over frame-dark's own definitions). - text-particle-view.tsx: render the message card with the read-only editor; drop the react-markdown component map. - Remove now-unused deps: @mdxeditor/editor, react-markdown, remark-gfm, rehype-highlight, highlight.js. The compose immersive mode (short, centered plain text) is unchanged. https://claude.ai/code/session_019DU6V5z6Nr4Vu7b1fBDnq4 --- js/desktop/package.json | 6 +- .../src/features/compose/markdown-editor.css | 182 +- .../src/features/compose/markdown-editor.tsx | 155 +- .../features/particles/text-particle-view.tsx | 108 +- js/desktop/yarn.lock | 1648 ++++++++--------- 5 files changed, 848 insertions(+), 1251 deletions(-) diff --git a/js/desktop/package.json b/js/desktop/package.json index eae4203..76cc62b 100644 --- a/js/desktop/package.json +++ b/js/desktop/package.json @@ -58,7 +58,7 @@ "dependencies": { "@livekit/components-react": "^2.9.20", "@livekit/components-styles": "^1.2.0", - "@mdxeditor/editor": "^4.0.1", + "@milkdown/crepe": "^7.21.1", "@sentry/electron": "^7.11.0", "@sentry/react": "^10.54.0", "@tanstack/react-query": "^5.90.21", @@ -66,7 +66,6 @@ "clsx": "^2.1.1", "electron-squirrel-startup": "^1.0.1", "firebase": "^12.10.0", - "highlight.js": "^11.11.1", "livekit-client": "^2.18.0", "lucide-react": "^0.575.0", "next-themes": "^0.4.6", @@ -74,11 +73,8 @@ "react": "^19.2.4", "react-dom": "^19.2.4", "react-error-boundary": "^6.1.1", - "react-markdown": "^10.1.0", "react-router-dom": "^7.13.0", "react-use": "^17.6.0", - "rehype-highlight": "^7.0.2", - "remark-gfm": "^4.0.1", "shadcn": "^3.8.5", "sonner": "^2.0.7", "tailwind-merge": "^3.5.0", diff --git a/js/desktop/src/features/compose/markdown-editor.css b/js/desktop/src/features/compose/markdown-editor.css index 8ef32d5..d7fcefc 100644 --- a/js/desktop/src/features/compose/markdown-editor.css +++ b/js/desktop/src/features/compose/markdown-editor.css @@ -1,155 +1,49 @@ -/* Blend MDXEditor into the compose glass card, and restore prose typography. - * - * MDXEditor renders real

/