Add basic shapes to the example drawing

CH
23m ago
+931-70

Problem and behavior

As described in #625, candidates currently need to draw basic shapes freehand when illustrating coding examples, making it difficult to create consistent diagrams.

Add Line, Rectangle and Ellipse tools to the Example drawing toolbar. Each tool previews the shape while dragging and commits it as one undoable edit when the pointer is released. Selecting a color preserves the active shape tool.

Approach

Follow the agreed approach in the issue discussion by representing each completed shape as an ordinary stroke: two endpoints for a line, a closed four-corner path for a rectangle, and a closed polyline for an ellipse.

Dragging replaces the uncommitted preview rather than adding intermediate shapes to the journal. Completed shapes reuse the existing color, undo, clear, recording, replay and reconnection paths without introducing a new operation kind.

Update the drawing-tool documentation to match the supported tools.

Validation

./scripts/test.sh browser passed on the final head: 3,155 passed, zero failures, and one test skipped because ffmpeg is unavailable.

make build passed. Manual checks of the local drawing preview covered all three tools, color selection, Undo and Clear. Additional browser probes checked keyboard selection, cancellation when the board becomes locked, and stroke/point capacity boundaries.

Browser regression tests verify all four drag directions, shape geometry, painted pixels, preview/journal separation, color selection, undo, clear, replay, reconnection and cancellation.

The full gate was attempted but did not pass. The fork's stale origin/main caused Rust size-baseline findings; the fork has since been synchronized, but the full gate was not rerun. An unchanged Rust handoff test also failed with a socket fixture/handshake error, including when run in isolation. The run was stopped during desktop dependency setup, so the remaining checks were not completed.

A credentialed live interview was not run. Replay and reconnection were checked through local browser regressions.

Screenshots

screenshots

Closes #625


Summary by cubic

Adds Line, Rectangle, and Ellipse tools to the Example drawing toolbar so candidates can produce consistent diagrams while explaining examples. Shapes preview while dragging and commit as one ordinary, replayable stroke on release, closing #625.

  • Rectangle commits as a closed four-corner path and ellipse as a closed 128-segment polyline; drag previews are not journaled.
  • Completed shapes reuse the existing color, undo, clear, recording, replay, and reconnection paths; selecting a color preserves the active shape tool. Color buttons are renamed to their color name alone, and the group is now labelled "Colour".
  • Pointer movement uses the board's own rounding and bounds, so sub-pixel drags no longer rebuild an unchanged preview. Shapes that collapse to one pixel, and shapes finished before any move, are dropped without an edit; pen clicks still leave dots. A shape that drops the shared preview also resends the restored board.
  • Updates drawing-tool docs and adds shared browser test helpers covering drag directions, geometry, pixel output, cancellation, history, reconnect flush, and the 2 s flush deadline.
  • The Chromium CI action gains a full-browser input, letting only the browser lane install full Chromium for native pointer capture; all other lanes keep the headless shell, with a matching cache key and gate coverage.