From d53e800fd2d7af0da3cb2f163118a96a631290ad Mon Sep 17 00:00:00 2001 From: asus Date: Tue, 27 Oct 2026 10:56:58 +0700 Subject: [PATCH] feat: copy and paste shapes in the review editor (REQ-195) Two ways to copy a shape, both writing a real manual label: - Ctrl/Cmd + drag on a shape: a dashed ghost follows the pointer and the copy is written where the button is released, keeping the source class. The original is never moved or resized; Ctrl wins over the resize, vertex and midpoint handles. - Ctrl/Cmd+C / Ctrl/Cmd+V: the editor-local clipboard holds shapes only, never the system clipboard. Paste lands 0.015 down-right, clamped inside the frame. Ctrl+C and Ctrl+V are the only browser combos the editor claims; every other combo still reaches the browser, and typing in a field triggers nothing. --- docs/design.md | 2 +- docs/requirements.md | 14 ++++ docs/tasks.md | 38 +++++++++ docs/ui-spec.md | 32 +++++++- frontend/src/app.css | 11 +++ frontend/src/components/AnnotationCanvas.jsx | 82 ++++++++++++++++---- frontend/src/components/ShortcutsPanel.jsx | 8 ++ frontend/src/geometry.js | 21 +++++ frontend/src/hooks/useShapeClipboard.js | 67 ++++++++++++++++ frontend/src/pages/ReviewPage.jsx | 42 +++++++++- 10 files changed, 293 insertions(+), 24 deletions(-) create mode 100644 frontend/src/geometry.js create mode 100644 frontend/src/hooks/useShapeClipboard.js diff --git a/docs/design.md b/docs/design.md index 9279f5d..7c9d5d5 100644 --- a/docs/design.md +++ b/docs/design.md @@ -350,7 +350,7 @@ Pages (11, routed by hash in `App.jsx`): 4. **Data Prep** (`/data-prep/{pid}`) — the merge gate: pick batches, review frames, merge into datasets (REQ-052). 5. **Datasets** (`/datasets/{pid}`) — dataset list and membership. 6. **Trim** (`/trim/{pid}`) — `