rspace-online/backlog/tasks/task-29 - Port-folk-drawfas...

2.0 KiB

id title status assignee created_date updated_date labels milestone dependencies references priority
TASK-29 Port folk-drawfast shape (collaborative drawing/gesture recognition) Done
2026-02-18 19:50 2026-04-10 21:28
shape-port
phase-2
creative
m-0
TASK-24
canvas-website/src/shapes/DrawfastShapeUtil.tsx
low

Description

Port DrawfastShapeUtil from canvas-website to rspace-online.

Source: canvas-website/src/shapes/DrawfastShapeUtil.tsx (652 lines) Target: rspace-online/lib/folk-drawfast.ts

Features to implement:

  • Freehand sketch input canvas
  • Gesture recognition (circles, lines, rectangles, arrows)
  • Shape detection and conversion
  • Real-time collaborative drawing
  • May use perfect-freehand (already in rspace deps)

Acceptance Criteria

  • #1 Freehand drawing works with pointer/touch input
  • #2 Gesture recognition detects basic shapes
  • #3 Drawing state syncs across clients
  • #4 Toolbar button added to canvas.html

Implementation Notes

2026-04-10: Added AI sketch-to-image generation (fal.ai + Gemini via /api/image-gen/img2img). Split-view layout with drawing canvas + AI result. Auto-generate toggle, strength slider, provider selector. Image preloading for smooth transitions. Port descriptors for folk-arrow connections. AC#1 (freehand drawing) and AC#4 (toolbar button) were already implemented. AC#2 (gesture recognition) and AC#3 (collaborative sync) still outstanding.

AC#2: Implemented Unistroke Recognizer with templates for circle, rectangle, triangle, line, arrow, checkmark. Freehand strokes matching >70% confidence are auto-converted to clean geometric shapes with a floating badge. AC#3: Fixed applyData() to restore strokes array, prompt text, and last result URL from Automerge sync data. toJSON() now exports prompt text for sync.