Skip to content

feat(ui): image paste from clipboard in editor#61

Open
advancedresearcharray wants to merge 5 commits into
mainfrom
feat/issue-425-image-paste-redelivery
Open

feat(ui): image paste from clipboard in editor#61
advancedresearcharray wants to merge 5 commits into
mainfrom
feat/issue-425-image-paste-redelivery

Conversation

@advancedresearcharray

@advancedresearcharray advancedresearcharray commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add clipboard paste and drag-and-drop image upload in KiwiEditor for both visual (BlockNote) and source (CodeMirror) modes
  • Upload via existing POST /api/kiwi/assets with standardized paste-YYYYMMDD-HHMMSS.ext filenames
  • Show ![Uploading...]() placeholder during upload in source mode; BlockNote native loading in visual mode
  • Dashed-border drop overlay on drag-over; error toast (6s auto-dismiss) on upload failure
  • Unit tests for paste helpers and CodeMirror upload/replace/error paths

Closes kiwifs#425

Test plan

  • cd ui && npm test -- --run editorImagePaste — 11 passed
  • cd ui && npm test -- --run — 200 passed (35 files)
  • Manual: paste PNG/JPEG/GIF/WebP in visual mode → image block inserted
  • Manual: paste image in source mode → ![paste-...](...) markdown at cursor
  • Manual: drag image into editor → overlay shown, upload succeeds
  • Manual: upload failure (e.g. oversized file) → placeholder removed, toast shown

Array Fleet and others added 5 commits June 30, 2026 21:17
Enable clipboard paste and drag-and-drop image upload in both visual
(BlockNote) and source (CodeMirror) editor modes with loading placeholders,
standardized paste filenames, and error toasts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
CodeMirror upload already renames via uploadAssetForEditor; derive alt
text from the uploaded asset ref instead of pre-renaming the file twice.

Co-authored-by: Cursor <cursoragent@cursor.com>
…kiwifs#425)

Delegate file rename to the upload callback (same as CodeMirror path) and
derive alt text from the uploaded asset ref basename.

Co-authored-by: Cursor <cursoragent@cursor.com>
Block source-mode save while uploads are in-flight, fix Safari clipboard
extraction fallback, add paste/drop handler tests, and remove unused
ProseMirror plugin to avoid double-handling with BlockNote uploadFile.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

feat(ui): image paste from clipboard in editor

1 participant