Skip to content

CodeMirror 6 inline Markdown image widgets - #8

Merged
chasehuh merged 6 commits into
mainfrom
task/codemirror-inline-images
Jul 14, 2026
Merged

CodeMirror 6 inline Markdown image widgets#8
chasehuh merged 6 commits into
mainfrom
task/codemirror-inline-images

Conversation

@chasehuh

Copy link
Copy Markdown
Member

Summary

  • Replace the note <textarea> with CodeMirror 6 (Zed-like theme tokens, wrap toggle, Tab→spaces, scroll-beyond, line numbers, ->).
  • Render ![alt|width?](url) as block widgets under the source line; remove the document-bottom image gallery.
  • Keep paste/drop → /api/upload → Markdown at caret; resize handle rewrites Obsidian |width (double-click clears width). Markdown string remains the single source of truth for save/sync/DB.

Closes #7

Test plan

  • pnpm install && pnpm dev with MEDIA_UPLOAD_* set
  • Confirm no primary textarea; editor is CodeMirror with gutter
  • Paste/drop an image → CDN Markdown inserts at caret + widget under that line
  • Drag resize → source becomes ![alt|N](url); reload preserves width
  • Double-click handle clears |width
  • Soft wrap, Tab spaces, Hangul + , scroll-beyond still work
  • Two-tab draft sync still exchanges plain body strings
  • Bottom .zed-image-previews gallery is gone

Made with Cursor

chasehuh and others added 6 commits July 14, 2026 17:58
Add session-gated /api/upload that posts to a Cloudflare Worker bound
to chasehuh-media, insert ![alt](cdn-url) at the caret, and show a
preview strip under the editor.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the bottom media bar so image upload stays a power-user
gesture (clipboard paste or drop into the editor).

Co-authored-by: Cursor <cursoragent@cursor.com>
Render ![alt](url) images below the note text inside the buffer
scrollport, without restoring the media toolbar chrome.

Co-authored-by: Cursor <cursoragent@cursor.com>
Support ![alt|400](url) and drag the preview corner handle to rewrite
the markdown width in the note body.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the note textarea with CodeMirror 6 and render
![alt|width](url) as block widgets under the source line.
Keep paste/drop upload, Obsidian |width resize, and Zed-like
editor behaviors; Markdown remains the single source of truth.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
memo Ready Ready Preview, Comment Jul 14, 2026 9:06am

@chasehuh
chasehuh merged commit 7cb8447 into main Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CodeMirror 6 inline Markdown image widgets (Obsidian-style)

1 participant