Skip to content

Commit 395e336

Browse files
engmungclaude
andcommitted
feat(web): in-app Gemini pattern generation in Pattern Lab (BYOK PoC)
Replace the copy-paste prompt loop with in-app generation via the Gemini API (gemini-3.5-flash, generateContent + structured output). Bring-your-own key, stored only in localStorage and sent directly to Google — no server proxy, no bundled key. PostHog session replay redacts the API host and the key field is type=password + ph-no-capture. Pattern Lab gallery: - Code | Gallery tab toggle in the right panel; tab-specific header actions. - Parallel job queue (live status + elapsed timer), accumulating gallery, count (1-20), thinking level, orientation, and reference-count controls. - Click a card to load it; Select mode for pin (keep at top) / delete; a random sample of presets is fed as references to widen variety. - Generated patterns auto-stamped with an editable CC-BY-SA license header + footer attributing patternflow.work/pattern-lab. Runtime hardening for AI-generated code (both PatternRuntime and the 3D LedMatrixTexture): tolerate the setPixel(x, y, [r,g,b]) array form and mirror knob/button state onto params so params.knobValues works in draw(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 9ca5b04 commit 395e336

8 files changed

Lines changed: 1892 additions & 103 deletions

File tree

web/package-lock.json

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

web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@chenglou/pretext": "^0.0.6",
13+
"@google/genai": "^2.9.0",
1314
"@mdx-js/loader": "^3.1.1",
1415
"@mdx-js/react": "^3.1.1",
1516
"@monaco-editor/react": "^4.7.0",

0 commit comments

Comments
 (0)