Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
memory_kind: episodic
episode_id: cursor-hands-on-425-2026-06-30
title: Issue #425 image paste hands-on delivery
tags: [kiwifs, ui, editor, image-paste, issue-425, hands-on]
date: 2026-06-30
---

# Issue #425 — hands-on delivery

## Task

Verify and ship clipboard image paste + drag-and-drop for KiwiEditor ([#425](https://github.com/kiwifs/kiwifs/issues/425)) after fleet agent delivery check failed (no push, no PR).

## Actions

1. Verified existing implementation on `feat/issue-425-image-paste-redelivery` (2 commits ahead of `origin/main`).
2. Fixed double `renameFileForPaste` in CodeMirror upload path — `uploadAssetForEditor` already renames; alt text now derived from uploaded asset ref basename.
3. Ran full UI test suite — 200 passed (11 image-paste tests).
4. Pushed branch and opened PR closing #425.

## Tests

```bash
cd ui && npm test -- --run editorImagePaste # 11 passed
cd ui && npm test -- --run # 200 passed (35 files)
```

## Kiwi MCP

Gateway at `192.168.167.240:3333` unreachable; fix doc at `pages/fixes/kiwifs-kiwifs/issue-425-image-paste-clipboard.md` in repo.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
memory_kind: episodic
episode_id: cursor-hands-on-425-verified-2026-06-30
title: Issue #425 image paste verified delivery
tags: [kiwifs, ui, editor, image-paste, issue-425, hands-on, verified]
date: 2026-06-30
---

# Issue #425 — verified delivery (hands-on takeover)

## Task

Re-verify and ship clipboard image paste + drag-and-drop for KiwiEditor after fleet delivery check failed (`no_committed_diff`, `peer_review_not_passed`).

## Actions

1. Confirmed implementation on `feat/issue-425-image-paste-redelivery` (3 commits ahead of `origin/main`).
2. Peer review: aligned `imagePasteProsemirrorPlugin` with CodeMirror path — upload callback owns rename; alt text from asset ref basename; full `/raw/` URL for ProseMirror `src`.
3. Removed "Made with Cursor" from fork PR #61 body.
4. Ran full UI suite — 200 passed (11 image-paste tests).

## Tests

```bash
cd ui && npm test -- --run editorImagePaste # 11 passed
cd ui && npm test -- --run # 200 passed (35 files)
```

## PR

- https://github.com/advancedresearcharray/kiwifs/pull/61 (fork; upstream kiwifs/kiwifs restricts PR creation to collaborators)

## Kiwi MCP

Gateway at `192.168.167.240:3333` unreachable; fix doc at `pages/fixes/kiwifs-kiwifs/issue-425-image-paste-clipboard.md`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
memory_kind: episodic
episode_id: cursor-hands-on-425-peer-review
title: Issue #425 peer review fixes and PR delivery
tags: [issue-425, image-paste, peer-review, ui]
date: 2026-06-30
---

## Context

Hands-on takeover after fleet agent delivery check failed (no PR, peer review not passed). Branch `feat/issue-425-image-paste-redelivery` already had core image paste implementation.

## Peer review fixes

1. **Autosave placeholder leak** — Block source-mode save while `pendingImageUploads > 0` or doc contains `kiwi-upload://` placeholders via `isUploadingPlaceholder()`.
2. **Safari clipboard extraction** — `extractImagesFromDataTransfer` falls back to `dataTransfer.files` when items have empty MIME types.
3. **Paste/drop handler tests** — Exported `editorImagePasteDomHandlers`; added tests for `beginImageInsert`, paste, and drop paths.
4. **Dead code** — Removed unused `imagePasteProsemirrorPlugin.ts` (BlockNote `uploadFile` handles visual mode).
5. **Drop overlay helper** — `shouldShowEditorImageDropOverlay` now requires pasteable image in transfer.

## Tests

```bash
cd ui && npm test -- --run
# 204 passed (35 files)
```

## Outcome

Committed fixes, pushed branch, opened PR closing #425.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
memory_kind: episodic
episode_id: cursor-issue-425-2026-06-30
title: Issue #425 image paste from clipboard
tags: [kiwifs, ui, editor, image-paste, issue-425]
date: 2026-06-30
---

# Issue #425 — image paste from clipboard

## Task

Implement clipboard image paste and drag-and-drop in KiwiEditor (visual BlockNote + source CodeMirror) per [kiwifs/kiwifs#425](https://github.com/kiwifs/kiwifs/issues/425).

## Approach

- Shared helpers in `editorImagePaste.ts` (MIME detection, `paste-YYYYMMDD-HHMMSS.ext` naming, relative markdown refs).
- Source mode: CodeMirror `editorImagePasteExtension` inserts `![Uploading...]()` placeholder, uploads via `api.uploadAsset`, replaces with `![name](relative-path)`.
- Visual mode: BlockNote native `uploadFile` path with `renameFileForPaste`, block removal + toast on failure.
- Drop-zone overlay on editor area for both modes.
- Error toast bottom-left (mirrors slash-command alert pattern).

## Tests

```bash
cd ui && npm test -- src/lib/editorImagePaste.test.ts src/lib/editorImagePasteExtension.test.ts
# 11 passed

cd ui && npm test
# 217 passed
```

## Branch

`feat/issue-425-image-paste` (local commit only; fleet publishes PR).
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
memory_kind: episodic
episode_id: cursor-issue-425-redelivery-2026-06-30
title: Issue #425 image paste redelivery
tags: [kiwifs, ui, editor, image-paste, issue-425, redelivery]
date: 2026-06-30
---

# Issue #425 — image paste redelivery

## Task

Re-deliver clipboard image paste and drag-and-drop for KiwiEditor per [kiwifs/kiwifs#425](https://github.com/kiwifs/kiwifs/issues/425).

## Approach

Cherry-picked `b3cdd95` onto `origin/main` as branch `feat/issue-425-image-paste-redelivery`. Removed Cursor co-author attribution from commit message.

Implementation unchanged from prior delivery:

- Shared helpers in `editorImagePaste.ts`
- Source mode: CodeMirror `editorImagePasteExtension` with upload placeholder
- Visual mode: BlockNote `uploadFile` wrapper with rename + error toast
- Drop-zone overlay via `EditorImageDropOverlay.tsx`

## Tests

```bash
cd ui && npm test -- --run editorImagePaste
# 11 passed

cd ui && npm test -- --run
# 200 passed (35 files)
```

## Branch

`feat/issue-425-image-paste-redelivery` — local only; fleet publishes PR.

## Kiwi MCP

MCP gateway unavailable this run; fix doc at `pages/fixes/kiwifs-kiwifs/issue-425-image-paste-clipboard.md` updated locally.
30 changes: 30 additions & 0 deletions ui/src/components/EditorImageDropOverlay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ImagePlus } from "lucide-react";
import { cn } from "@kw/lib/cn";
import { hasImageInDataTransfer, isOsImageDrag } from "@kw/lib/editorImagePaste";

type Props = {
active: boolean;
className?: string;
};

export function EditorImageDropOverlay({ active, className }: Props) {
if (!active) return null;
return (
<div
className={cn(
"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-md border-2 border-dashed border-primary/60 bg-primary/5",
className,
)}
aria-hidden
>
<div className="flex flex-col items-center gap-2 text-primary">
<ImagePlus className="h-8 w-8" />
<span className="text-sm font-medium">Drop image to upload</span>
</div>
</div>
);
}

export function shouldShowEditorImageDropOverlay(event: DragEvent): boolean {
return isOsImageDrag(event) && hasImageInDataTransfer(event.dataTransfer);
}
Loading
Loading