feat(board): Terminal whiteboard backed by Excalidraw files
Merged
DE
3d ago+6657+6657+0123456789012345678901234567890123456789-9-9-0123456789
leaf board [file.excalidraw] (or leaf file.excalidraw) turns the terminal into a whiteboard you share with your agent. The board is a plain Excalidraw file, so it also opens on excalidraw.com.
What it does
- Tools: select, hand, box, diamond, ellipse, arrow, line, pen, text, frame, eraser.
- Arrows drawn between shapes attach and follow them when the shapes move.
- Select, marquee, move, resize from 8 handles (shift keeps proportions), turn from a knob (shift snaps to 15°).
- Text on the board or inside shapes. Group and ungroup, restack, duplicate, copy, cut and paste (Excalidraw clipboard JSON works too). Pasting or dropping a picture's path adds the picture.
- Styles: 6 colors, hachure, cross-hatch and solid fills, dashes, stroke width, how hand-drawn it looks, arrowheads, font, text size. Undo and redo.
- Rendering: terminals that show pictures (kitty, Ghostty, WezTerm, iTerm2, sixel) get the board painted from hand-drawn SVG. Other terminals get Braille dots with tinted fills and half-block pictures.
iswitches between the two. - Agent:
@sends the agent pane the board's path, the file layout and the selection. Every change saves at once and the board redraws when the file changes, so the agent's edits show up as it writes them. Oneuundoes an agent's change. - Export:
Ewrites SVG and PNG next to the board.leaf board file.excalidraw --export out.png|out.svgdoes it from the shell.
Testing
cargo test: 634 passed.- No clippy warnings in the new modules.
cargo fmtis clean.
š¤ Generated with Claude Code
Summary by cubic
Adds leaf board [file.excalidraw] (or leaf file.excalidraw) to turn the terminal into a whiteboard you share with your agent. The board is a plain Excalidraw file, so it also opens on excalidraw.com, and each change saves as you make it; with no file, it creates a board-<word>-<word>.excalidraw here and saves it on open.
Features
- Tools: select, hand, box, diamond, ellipse, arrow, line, pen, text, frame, eraser; arrows and lines snap onto nearby shapes when released, and arrows stay attached when a shape moves.
- Move, resize, turn, group, restack, duplicate, and copy/paste, plus 6 colors, fills, dashes, widths, arrowheads, fonts, and undo.
- A compact header shows the active tool and the ink, background, fill, line, and width new things get, each with its shortcut;
tab/shift+tabstep through tools andBcycles the background color. The canvas can be locked to stop accidental drags. - Picture-capable terminals (kitty, Ghostty, WezTerm, iTerm2, sixel) paint hand-drawn SVG; others get Braille dots;
iswitches. @hands the agent the board path, layout, and selection; the agent draws by editing the file and the board redraws within 30 ms of a write, so oneuundoes an agent's change.Ewrites SVG and PNG, andleaf board file.excalidraw --export out.png|out.svgdoes the same from the shell; export only accepts.png/.svgand won't overwrite the board.
Fixes and polish
- Drags and typing paint at about 1 MP, then sharpen once input settles; the board redraws only after input or a file change.
- Option-scroll zooms, and zoom stays smooth on trackpads; replaced images linger until their successors show even through upload, and synchronized updates end after draw errors.
- New board names are claimed atomically and creation errors are reported; failed boards don't linger.
- Selection dragging moves a selection, and copy and quit keys are clearer.
- Frames turn their titles and placeholders, diamond arrowheads draw as diamonds, and pen strokes export correctly.
- Parsing rejects JSON that isn't a board and broken element records; saving keeps the file's permissions.
- Requires stdin and stdout to be terminals.