Commit 395e336
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
- src
- app/pattern-lab
- components/3d
- lib
- providers
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 | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments