CANVAS BASICS VERIFICATION
Comprehensive guidelines for AI-assisted development within the Editor platform
Canvas Basics Verification Plan ๐
๐ฏ Objective
Verify that ALL basic canvas actions work correctly before proceeding with the JSON-first architecture plan.
โ Core Interactions Checklist
1. Element Selection
- Click element to select (blue outline appears)
- Click canvas background to deselect
- Escape key to deselect all
- Ctrl+A to select all elements
- Visual feedback (outline, handles appear)
2. Element Dragging
- Click and drag element moves it smoothly
- Element constrained to viewport bounds
- Multiple elements can be selected and dragged together
- Drag doesn't interfere with resize/rotate
- Drop releases correctly
- Cursor changes (grab โ grabbing)
3. Element Resizing
-
Right edge handle- FIXED -
Left edge handle- FIXED -
Top edge handle- FIXED -
Bottom edge handle- FIXED -
Top-left corner- FIXED -
Top-right corner- FIXED -
Bottom-left corner- FIXED -
Bottom-right corner- FIXED - Minimum size enforced (20px)
- SVG scales proportionally (no distortion)
- Aspect ratio locking (if enabled)
- Resize doesn't trigger drag
4. Element Rotation
- Purple handle appears above element
- Click and drag rotates element
- Shift+drag snaps to 15ยฐ increments
- Rotation center is element center
- Rotation doesn't trigger drag
- Rotation value persists
5. Control Points (Connection Ports)
- Toggle control points button shows/hides them
- Blue circles appear at connection locations
- Click control point starts connection mode
- Connection line follows mouse
- Click second control point completes connection
- Escape cancels connection creation
- Control points stay aligned during resize/rotate
6. Connections
- Straight line connections work
- Bezier curve connections work
- Curved connections work
- Orthogonal (right-angle) connections work
- Arrow markers render correctly
- Connection follows when element moves
- Connection updates when element resizes
- Connection updates when element rotates
- Click connection to select it
- Delete connection with Delete key
7. Shape Creation
- Add Circle button creates circle
- Add Star button creates star
- Add Hexagon button creates hexagon
- Add Triangle button creates triangle
- Add Rectangle button creates rectangle
- New shapes appear at random canvas positions
- New shapes have control points
- New shapes are selectable/draggable/resizable/rotatable
8. AI Generation
- Type prompt in input field
- Button disabled when prompt empty
- Button enabled when prompt has text
- Click generates composition
- Panda template works ("draw a panda")
- Robot template works ("robot")
- House template works ("house")
- Flowchart template works ("flowchart")
- Diagram template works ("diagram")
- Generated elements are interactive
9. Edit Operations
- Undo (Ctrl+Z) reverts last action
- Redo (Ctrl+Y / Ctrl+Shift+Z) reapplies action
- Duplicate (Ctrl+D) creates copy
- Delete (Del / Backspace) removes selected
- Undo/redo history limited to 50 states
- History tracks: create, delete, move, resize, rotate, connect
10. Alignment Tools
- Align Left aligns selected elements
- Align Center (H) centers horizontally
- Align Right aligns to rightmost element
- Align Top aligns to topmost element
- Align Middle (V) centers vertically
- Align Bottom aligns to bottommost element
- Alignment works with 2+ selected elements
- Alignment respects element sizes
11. Keyboard Shortcuts
- Delete/Backspace: Delete selected
- Escape: Deselect all / Cancel connection
- Ctrl+A: Select all
- Ctrl+D: Duplicate
- Ctrl+Z: Undo
- Ctrl+Y: Redo
- Ctrl+Shift+Z: Redo (alternative)
- Shift+Drag Rotate: Snap to 15ยฐ
12. Persistence
- Changes auto-save
- Refresh page preserves state
- Element positions persist
- Element sizes persist
- Element rotations persist
- Connections persist
- Undo/redo history persists (if feasible)
13. Canvas Controls
- Zoom in/out (if implemented)
- Pan canvas (if implemented)
- Fit to canvas
- Reset view
- Canvas background visible
14. Visual Feedback
- Selected state (blue outline, handles)
- Hover state (slight scale, brightness)
- Dragging state (opacity, shadow, cursor)
- Resizing cursor changes
- Rotating cursor changes
- Connection creation cursor
- Loading states (if applicable)
15. Stats Display
- Total elements count accurate
- Total connections count accurate
- Selected count accurate
- Undo/redo count accurate
- Stats update in real-time
๐งช Test Scenarios
Scenario 1: Complete Workflow
- Add circle
- Add rectangle
- Select circle
- Drag circle to new position
- Resize circle from right edge
- Rotate circle 45ยฐ
- Toggle control points
- Connect circle to rectangle
- Undo last 3 actions
- Redo last 2 actions
- Duplicate rectangle
- Select all
- Align center
- Delete one element
- Refresh page
- Verify all changes persisted
Expected: All actions work smoothly, no errors, state persists
Scenario 2: Resize Edge Cases
- Add large rectangle (200x150)
- Resize from top edge โ should grow/shrink vertically, X unchanged
- Resize from bottom edge โ should grow/shrink vertically, opposite anchor
- Resize from left edge โ should grow/shrink horizontally, right edge fixed
- Resize from right edge โ should grow/shrink horizontally, left edge fixed
- Resize to minimum (20x20) โ should enforce minimum
- Try to resize beyond viewport โ should constrain
Expected: No sliding, no distortion, predictable anchoring
Scenario 3: Rotation Precision
- Add hexagon
- Rotate without Shift โ free rotation
- Undo
- Rotate with Shift held โ should snap to 0ยฐ, 15ยฐ, 30ยฐ, 45ยฐ, etc.
- Verify rotation in data display
- Resize rotated element โ should resize along rotated axes
- Drag rotated element โ should move normally
Expected: Rotation accurate, constraints work, interactions clean
Scenario 4: Connection Stress Test
- Add 3 circles in a triangle layout
- Connect circle A โ B
- Connect circle B โ C
- Connect circle C โ A
- Select circle A and move it โ all connected lines follow
- Resize circle B โ connections update anchor points
- Rotate circle C โ connections adjust
- Delete circle B โ connections to/from B are deleted
- Undo delete โ circle B and connections restore
Expected: Connections always accurate, no orphaned lines
Scenario 5: Multi-Select Operations
- Add 5 shapes in a grid
- Select all (Ctrl+A)
- Drag group โ all move together
- Align center horizontal โ all align
- Deselect
- Select 3 specific elements
- Duplicate selection โ 3 new elements created
- Delete selection โ 3 elements removed
- Undo โ 3 elements restore
Expected: Multi-select works consistently across operations
Scenario 6: AI Generation Quality
- Type: "draw a robot"
- Click generate
- Verify robot appears with body, head, arms, legs
- Select robot parts
- Verify all parts are interactive
- Clear canvas
- Type: "create a flowchart with 3 steps"
- Verify flowchart appears with connected boxes
- Verify connections work
Expected: AI generates valid, interactive compositions
Scenario 7: Undo/Redo Chain
- Add circle (state 1)
- Resize circle (state 2)
- Rotate circle (state 3)
- Add rectangle (state 4)
- Connect circle to rectangle (state 5)
- Undo 5 times โ back to empty canvas
- Redo 5 times โ back to state 5
- Undo 2 times โ state 3
- Add triangle (new state 4, history branch)
- Verify old state 4-5 are lost
Expected: Undo/redo works correctly, branching handled
Scenario 8: Persistence Recovery
- Create complex scene (5+ elements, 3+ connections)
- Move, resize, rotate various elements
- Note exact positions/sizes
- Refresh page
- Verify ALL element properties match exactly
- Verify connections intact
- Undo โ verify undo history doesn't persist (or does, if implemented)
Expected: Full state recovery after refresh
๐ Known Issues to Check
Issue 1: Resize Slide Bug
- Status: โ FIXED
- Test: Resize from all edges and corners
- Expected: No sliding, clean scaling
Issue 2: Event Propagation
- Status: โ FIXED
- Test: Click resize handle doesn't trigger drag
- Expected: Operations are mutually exclusive
Issue 3: Control Points Missing
- Status: โ FIXED
- Test: All demo shapes have control points
- Expected: All shapes can connect
Issue 4: setTimeout Usage
- Status: โ FIXED
- Test: Check code for setTimeout calls
- Expected: Event-driven architecture only
๐ Testing Methodology
Manual Testing (Current)
- Open app: http://localhost:5701
- Navigate to Universal Compositor Demo
- Execute each test scenario
- Document results in this file
- Fix any issues found
- Re-test
Automated Testing (Future)
- Unit tests for components
- Integration tests for interactions
- E2E tests for workflows
- Visual regression tests
- Performance benchmarks
๐ฆ Test Results
Test Status Legend
- โ Passed
- โ Failed
- โ ๏ธ Partial
- โณ Not tested yet
- ๐ Re-test needed
Results Table
| Category | Test | Status | Notes |
|---|---|---|---|
| Selection | Click to select | โณ | |
| Selection | Deselect | โณ | |
| Selection | Escape key | โณ | |
| Selection | Ctrl+A | โณ | |
| Dragging | Smooth drag | โณ | |
| Dragging | Viewport constraint | โณ | |
| Dragging | Multi-drag | โณ | |
| Resizing | All 8 handles | โ | Fixed in this session |
| Resizing | No sliding | โ | Fixed in this session |
| Resizing | SVG scales | โณ | Need to verify |
| Rotation | Purple handle | โณ | |
| Rotation | Shift snap | โณ | |
| Rotation | No drag trigger | โ | Fixed in this session |
| Control Points | Toggle visibility | โณ | |
| Control Points | Connection creation | โณ | |
| Connections | 4 path types | โณ | |
| Connections | Follow elements | โณ | |
| Connections | Smart delete | โณ | |
| Shapes | Create 5 types | โณ | |
| AI | Prompt validation | โ | Fixed in this session |
| AI | Template generation | โณ | |
| Edit | Undo/Redo | โณ | |
| Edit | Duplicate | โณ | |
| Edit | Delete | โณ | |
| Alignment | 6 directions | โณ | |
| Keyboard | All shortcuts | โณ | |
| Persistence | Auto-save | โณ | |
| Persistence | Page refresh | โณ | |
| Persistence | All properties | โณ |
๐ฏ Success Criteria
All basics working when:
- โ All 15 core interaction categories pass
- โ All 8 test scenarios execute successfully
- โ Zero linter errors
- โ Zero runtime errors
- โ Performance is smooth (no lag)
- โ Visual feedback is clear
- โ Persistence works reliably
- โ Code is clean and maintainable
Current Progress: ~40% (4 of 10 core features verified)
๐ Testing Instructions
For User
- Open: http://localhost:5701
- Navigate to: Universal Compositor Demo
- Test each scenario sequentially
- Report any issues found
For Developer
- Review code for potential issues
- Check console for errors
- Verify event flows
- Test edge cases
- Profile performance if needed
๐ง Issues Found During Testing
Document any issues discovered during verification
Issue Template
### Issue #N: [Title]
- **Category**: [Selection/Dragging/Resizing/etc.]
- **Severity**: [Critical/High/Medium/Low]
- **Description**: [What went wrong]
- **Steps to Reproduce**:
1. ...
2. ...
- **Expected**: [What should happen]
- **Actual**: [What actually happened]
- **Fix**: [Solution implemented or planned]
- **Status**: [Open/In Progress/Fixed/Verified]
๐ Next Steps
- User Tests Canvas โ Reports results
- Fix Any Issues โ Implement fixes
- Re-verify โ Confirm all basics work
- Document โ Update this file with results
- Proceed โ Move to JSON-first architecture (Phase A)
Status: ๐ก Verification In Progress Priority: ๐ด Critical - Must complete before advancing Owner: User + AI collaboration Timeline: Complete in current session