Skip to content

feat(board): Terminal whiteboard backed by Excalidraw files - #55

Merged
DeepanshuMishraa merged 8 commits into
mainfrom
feat/whiteboard
Nov 20, 2026
Merged

DeepanshuMishraa merged 8 commits into
mainfrom
feat/whiteboard

Conversation

@DeepanshuMishraa

@DeepanshuMishraa DeepanshuMishraa commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

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. i switches 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. One u undoes an agent's change.
  • Export: E writes SVG and PNG next to the board. leaf board file.excalidraw --export out.png|out.svg does it from the shell.

Testing

  • cargo test: 634 passed.
  • No clippy warnings in the new modules. cargo fmt is 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+tab step through tools and B cycles 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; i switches.
  • @ 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 one u undoes an agent's change.
  • E writes SVG and PNG, and leaf board file.excalidraw --export out.png|out.svg does the same from the shell; export only accepts .png/.svg and 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.

Written for commit 7cbe106. Summary will update on new commits.

View guided diff Turn on auto-fix

`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>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/boardsvg.rs Resolved
Comment thread src/main.rs Resolved
Comment thread completions/leaf.fish Resolved
Comment thread src/doc.rs Resolved
Comment thread src/boardsvg.rs Resolved
Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread src/boardsvg.rs Resolved
Comment thread completions/_leaf Resolved
Comment thread src/board.rs Resolved
…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>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/boardview.rs Resolved
Comment thread src/board.rs Resolved
Comment thread src/boardview.rs Resolved
- 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

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/kitty.rs Resolved
Comment thread src/board.rs Resolved
Comment thread src/kitty.rs Resolved
Comment thread src/boardview.rs Resolved
- 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

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/kitty.rs Resolved
Comment thread src/boardview.rs Resolved
- Show stroke and fill colors, fill styles, line patterns, and widths
- Fill new frames and delete only excess Kitty image placements

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/boardview.rs
@@ -0,0 +1,3618 @@
//! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/boardview.rs
@@ -0,0 +1,3618 @@
//! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/boardview.rs
@@ -0,0 +1,3473 @@
//! The whiteboard on screen. The terminal is the canvas: pick a tool, drag to

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@DeepanshuMishraa
DeepanshuMishraa merged commit 8410987 into main Nov 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant