Repository navigation
feat(board): Terminal whiteboard backed by Excalidraw files - #55
Conversation
`leaf board [file.excalidraw]` (or `leaf file.excalidraw`) opens a whiteboard shared with the agent. Boxes, diamonds, ellipses, arrows that attach to shapes, lines, pen ink, text, frames and pictures; select, move, resize from handles, turn from a knob, group, restack, duplicate, copy and paste, fills, dashes, widths, fonts and undo. Terminals that show pictures get the board painted from hand-drawn SVG; others get Braille dots with tinted fills and half-block pictures. Every change saves to the file and the board redraws when the file changes, so `@` asks the agent pane and it draws by editing the file. `--export` and `E` write SVG or PNG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 8 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…ew fixes - Reload the board within 30 ms of an agent's write. A half-written or empty file is ignored, and a write right after our own save is no longer mistaken for ours. - `leaf board` with no file starts board-<word>-<word>.excalidraw in the folder and saves it on open, so the agent can be pointed at it at once. - Paint while dragging or typing at about 1 MP, then sharp once input settles; paint bands on every core; redraw only after input or a file change; stop copying the whole board on each drag step. - Pen strokes named stroke-width twice, which broke the picture. - Export refuses anything but .png/.svg and won't write over the board. - Turned frames turn their titles and placeholders; arrows follow shapes that turn; diamond arrowheads draw as diamonds. - Parsing refuses JSON that isn't a board and broken element records instead of dropping them; saving keeps the file's permissions. - The board needs stdin and stdout to be terminals. - Completions offer whiteboard, --export, and .excalidraw at the top level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- Add scroll-to-zoom mode and option-scroll zoom - Claim new board filenames atomically and report creation errors - Keep replaced terminal images visible during refresh
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- Separate ink and background controls, and apply toolbar styles to new shapes - Add selection dragging, clearer copy and quit keys, and prevent failed boards from lingering - Keep Kitty image successors visible through upload and end synchronized updates after draw errors
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- Show stroke and fill colors, fill styles, line patterns, and widths - Fill new frames and delete only excess Kitty image placements
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/boardview.rs">
<violation number="1">
P2: The short-toolbar branch drops the fill, line, and width buttons, leaving them inaccessible by mouse on terminals under 13 rows. Add a compact representation of `shapes` that fits this layout, or preserve the previous combined style row.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -0,0 +1,3618 @@ | |||
| //! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to | |||
There was a problem hiding this comment.
P2: The short-toolbar branch drops the fill, line, and width buttons, leaving them inaccessible by mouse on terminals under 13 rows. Add a compact representation of shapes that fits this layout, or preserve the previous combined style row.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/boardview.rs, line 2118:
<comment>The short-toolbar branch drops the fill, line, and width buttons, leaving them inaccessible by mouse on terminals under 13 rows. Add a compact representation of `shapes` that fits this layout, or preserve the previous combined style row.</comment>
<file context>
@@ -2037,24 +2098,24 @@ impl App {
let mut row = tools;
row.push(divider());
- row.extend(styles);
+ row.extend(colors);
self.place(f.buffer_mut(), &row, area.x, area.y, area);
}
</file context>
There was a problem hiding this comment.
1 existing issue remains and 1 new issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/boardview.rs">
<violation number="1">
P2: New frames can now store a background fill, but the SVG renderer hard-codes frame backgrounds to `fill="none"`, so the selected fill is invisible on the board. Update the `Shape::Frame` renderer to emit the element's fill.</violation>
</file>
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -0,0 +1,3618 @@ | |||
| //! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to | |||
There was a problem hiding this comment.
P2: New frames can now store a background fill, but the SVG renderer hard-codes frame backgrounds to fill="none", so the selected fill is invisible on the board. Update the Shape::Frame renderer to emit the element's fill.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/boardview.rs, line 1641:
<comment>New frames can now store a background fill, but the SVG renderer hard-codes frame backgrounds to `fill="none"`, so the selected fill is invisible on the board. Update the `Shape::Frame` renderer to emit the element's fill.</comment>
<file context>
@@ -1623,7 +1638,7 @@ impl App {
element.stroke = self.stroke;
if let Some(style) = self.fill_style
- && element.shape.holds()
+ && fillable(&element)
{
element.fill = Some(Fill {
</file context>
- Show the active tool and drawing styles with their keyboard shortcuts - Add tab navigation for tools and cycle background colors with B
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/boardview.rs">
<violation number="1">
P3: The new header is rendered as one unwrapped line, so it is clipped on common 80-column terminals and hides the right-hand style values and keys. Add a responsive second row or otherwise compact the header when it exceeds the terminal width.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -0,0 +1,3473 @@ | |||
| //! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to | |||
There was a problem hiding this comment.
P3: The new header is rendered as one unwrapped line, so it is clipped on common 80-column terminals and hides the right-hand style values and keys. Add a responsive second row or otherwise compact the header when it exceeds the terminal width.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/boardview.rs, line 1988:
<comment>The new header is rendered as one unwrapped line, so it is clipped on common 80-column terminals and hides the right-hand style values and keys. Add a responsive second row or otherwise compact the header when it exceeds the terminal width.</comment>
<file context>
@@ -1970,175 +1929,63 @@ impl App {
+ if self.locked { "locked" } else { "lock" }.to_owned(),
+ "L",
+ );
+ f.render_widget(Paragraph::new(Line::from(spans)), area);
}
</file context>
- Snap arrows and lines onto nearby shape edges when released - Keep arrows bound to shapes; leave lines unbound
leaf board [file.excalidraw](orleaf 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
iswitches between the two.@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.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.cargo fmtis clean.🤖 Generated with Claude Code
Summary by cubic
Adds
leaf board [file.excalidraw](orleaf 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 aboard-<word>-<word>.excalidrawhere and saves it on open.Features
tab/shift+tabstep through tools andBcycles the background color. The canvas can be locked to stop accidental drags.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
Written for commit 7cbe106. Summary will update on new commits.