Add per-agent whiteboard using tldraw#751
Closed
selfcontained wants to merge 1 commit into
Closed
Conversation
Implements a per-agent whiteboard as a new center-pane tab alongside Terminal and Changes. Uses tldraw v5 for the canvas (React.lazy code-split) and @tldraw/tlschema for server-side shape construction, enabling agents to draw diagrams via MCP tools without a browser. Backend: DB migration (whiteboards table with optimistic locking), whiteboard builder (~230 LOC translating WhiteboardOps to tldraw records), REST API (GET/PUT/snapshot), MCP tools (whiteboard_get, whiteboard_update), SSE sync (whiteboard.changed events). Frontend: tldraw canvas with debounced save (2s) and snapshot export (4s), pointer-down deferral for mid-gesture updates, theme-aware (colorScheme prop), agent-drew violet dot indicator on tab, lazy-loaded pane with Suspense fallback, full routing integration. Tests: 31 unit tests (builder ops, simplifyElements), 3 E2E tests (tab rendering, API CRUD, deep-link routing). All 181 E2E tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
Closing — tldraw requires a commercial license for production use, so this isn't viable. Going with the Excalidraw implementation in #735 instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@tldraw/tlschema), REST API with optimistic locking, MCP tools (whiteboard_get,whiteboard_update), SSE syncKey design decisions
WhiteboardOpoperations regardless of which canvas library ships@tldraw/tlschemadirectly (~230 lines vs Excalidraw's ~1,220 lines of coordinate math)React.lazy— tldraw chunk (~1.7MB) only loads when the whiteboard tab is openedTest plan
pnpm run check— all type checks pass (server + web + scripts)pnpm run finalize:web— production build succeedspnpm run test— 31 whiteboard unit tests passpnpm run test:e2e— all 181 E2E tests pass (3 new whiteboard tests)