Add example drawings to coding interviews
Coding candidates need a way to draw examples while keeping their code visible. This adds an optional, collapsible Example drawing area below the editor, beside the candidate test cases. It is disabled by default in the lobby. The lower panel stays compact when collapsed, and candidates can drag the divider to resize it.
The first version includes pen, eraser, undo and clear, with color selection. The buttons use icons with accessible labels and tooltips. Shapes will be added in a later change.
Drawings are sent to Gemini Live only when requested. The browser keeps the latest JPEG snapshot on the server, but edits, drawing handovers and reconnects do not send it to Gemini. When the candidate refers to the drawing, Jim is instructed to call read_board. The server then sends the latest image through realtimeInput.video before returning the tool response, at most once per tool batch. A drawing that is not referenced adds no image inputs. Once read, the image remains in the Live context and incurs the existing per-turn context cost.
Drawing activity delays idle reminders, and stopping drawing can hand the turn back to Jim without automatically sending an image. Code and drawings are preserved in recordings and replay, and the final drawing is shown separately in the report. Drawings do not add or deduct coding or communication points and are not sent as images to the report model.
Validation:
./scripts/test.shexited with status 0, with all 1118 browser tests passing.- Browser tests cover the toolbar, panel resizing, pen strokes, undo, clear, drawing turns and reconnecting.
- Backend tests confirm that coding drawings are sent only on an explicit read and that Whiteboard keeps its existing behavior. Restoring automatic image sends causes the new regression test to fail.
Closes #255
Summary by cubic
Adds an opt-in Example drawing area to coding interviews so candidates can sketch examples without hiding their code. The lobby toggle is disabled by default and unavailable in Whiteboard, and the choice is signed into token metadata, so disabled or non-coding sessions refuse drawing streams and read_board calls. Drawings stay out of assessment, and the contract bundle is bumped to 35.
- After the first drawing arrives, coding stops forwarding camera frames so Gemini sees the drawing, not the camera; images are sent only when Jim calls
read_board, once per turn. - Drawing activity resets the idle-window reminder without adding evidence or requesting a model reply; a drawing handover counts as a turn, cannot restart a stale countdown, and a failed resend no longer stops the room loop.
- Excess strokes are rejected so Gemini sees the same drawing as the candidate, and recordings replay the drawing alongside code.
- The final drawing appears in the report with a note that it does not affect scores; report prompts and validation forbid picture-only credit but allow discussing candidate-described images, keeping the original rubric.
- Provides pen, eraser, undo and clear with color selection; strokes use the existing whiteboard wire format. The lower panel collapses compactly and the divider drags to resize it.
Closes #255.