Skip to content

Commit 71cc344

Browse files
devallibusclaude
andcommitted
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/bun.lock

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/web/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
},
1313
"dependencies": {
1414
"@ai-sdk/anthropic": "^3.0.58",
15+
"@codemirror/lang-cpp": "^6.0.3",
16+
"@codemirror/state": "^6.5.4",
17+
"@codemirror/theme-one-dark": "^6.1.3",
18+
"@codemirror/view": "^6.39.16",
1519
"@fontsource/geist-mono": "^5.2.7",
1620
"@fontsource/geist-sans": "^5.2.5",
1721
"@tailwindcss/vite": "^4.1.18",
@@ -22,6 +26,7 @@
2226
"@tanstack/solid-start": "latest",
2327
"ai": "^6.0.116",
2428
"better-auth": "^1.5.4",
29+
"codemirror": "^6.0.2",
2530
"nitro": "npm:nitro-nightly@latest",
2631
"solid-js": "^1.9.11",
2732
"tailwindcss": "^4.1.18",

apps/web/src/components/Header.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ export default function Header() {
2020
>
2121
shaders
2222
</Link>
23+
<Link
24+
to="/playground"
25+
class="text-text-muted no-underline transition hover:text-text-primary"
26+
activeProps={{ class: 'text-text-primary' }}
27+
>
28+
playground
29+
</Link>
2330
<Link
2431
to="/about"
2532
class="text-text-muted no-underline transition hover:text-text-primary"

0 commit comments

Comments
 (0)