Commit 71cc344
feat(playground): add UI components, MCP tools, and header link
Playground UI (SolidJS + Three.js + CodeMirror 6):
- PlaygroundCanvas: reactive WebGL renderer with preserveDrawingBuffer,
error extraction via getShaderInfoLog, auto screenshot capture
- PlaygroundEditor: CodeMirror 6 with C++ syntax (GLSL-compatible),
one-dark theme, external value sync without cursor loss
- PlaygroundLayout: split editor/canvas layout, SSE connection for
agent-driven updates, debounced manual edits, error display bar
- /playground route with ?session= param, auto-creates new session
MCP playground tools (4 new tools):
- create_playground: creates session, returns URL
- update_shader: updates GLSL, returns errors + screenshot as image content
- get_preview: returns latest screenshot as MCP image content
- get_errors: returns compilation error list
- Handlers with dependency-injected fetch for testability
- 8 handler tests (all passing)
Polish:
- Added "playground" link to Header navigation
- Updated existing MCP tests for 7 tools (was 3)
- All tests pass across 13 test files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 5ebe510 commit 71cc344
11 files changed
Lines changed: 1178 additions & 3 deletions
File tree
- apps/web
- src
- components
- playground
- routes
- packages/mcp/src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
23 | 30 | | |
24 | 31 | | |
25 | 32 | | |
| |||
0 commit comments