Upload images from the clipboard and by drag and drop (#53) #56

Merged
miko merged 1 commit from feature/53-paste-and-drop-images into development 2026-11-03 14:38:27 +01:00
Owner

Closes #53.

Step, cover and category images can now be pasted or dropped, besides chosen as a file. All three ways go through one intake (src/images/intake.ts, useImageIntake) and then the same type/size checks and 4:3 crop dialog.

  • Paste from clipboard button at every image editor (navigator.clipboard.read()), with messages for "no image" and "no access → use Ctrl/⌘+V".
  • Ctrl/⌘+V goes to the focused image editor (focus ring shown). Outside every editor, an image pasted without text goes to the active step's images — even from a step line or EditorJS field; pasted text always stays text. On a category's page, the category image takes it.
  • Drag & drop onto an editor, highlighted while dragging; files dropped elsewhere are ignored instead of opened. Step reordering is unaffected.
  • Several images at once → the first, with a notice. A full step → "A step may have at most 3 images." Cover/category image: a new one replaces the current one.

Tests: unit tests for the intake, e2e/imageIntake.spec.ts (paste in a text field, real Ctrl+V on the focused cover, clipboard button, drops up to a full step). Full unit and e2e suites pass.

🤖 Generated with Claude Code

Closes #53. Step, cover and category images can now be pasted or dropped, besides chosen as a file. All three ways go through one intake (`src/images/intake.ts`, `useImageIntake`) and then the same type/size checks and 4:3 crop dialog. - **Paste from clipboard** button at every image editor (`navigator.clipboard.read()`), with messages for "no image" and "no access → use Ctrl/⌘+V". - **Ctrl/⌘+V** goes to the focused image editor (focus ring shown). Outside every editor, an image pasted *without text* goes to the active step's images — even from a step line or EditorJS field; pasted text always stays text. On a category's page, the category image takes it. - **Drag & drop** onto an editor, highlighted while dragging; files dropped elsewhere are ignored instead of opened. Step reordering is unaffected. - Several images at once → the first, with a notice. A full step → "A step may have at most 3 images." Cover/category image: a new one replaces the current one. Tests: unit tests for the intake, `e2e/imageIntake.spec.ts` (paste in a text field, real Ctrl+V on the focused cover, clipboard button, drops up to a full step). Full unit and e2e suites pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Step, cover and category images now also come pasted or dropped, through
one intake that applies the same checks before the crop dialog:

- A "Paste from clipboard" button reads the clipboard, saying when it holds
  no image or the browser allows no access.
- Ctrl/⌘+V goes to the focused image editor; outside every editor, an image
  pasted without text goes to the active step's images (on a category's
  page, to its image), even from a text field, which keeps pasted text.
- Files dropped onto an editor are taken; dropped elsewhere they are
  ignored rather than opened. Of several, only the first is taken.
- A full step refuses further images with a message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 9f25aea846 into development 2026-11-03 14:38:27 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!56
No description provided.