Skip to content

Libraries panel, 2 more examples, stop tracking outputs/#10

Merged
vecnode merged 1 commit into
mainfrom
libraries-panel-and-examples
Jun 28, 2026
Merged

Libraries panel, 2 more examples, stop tracking outputs/#10
vecnode merged 1 commit into
mainfrom
libraries-panel-and-examples

Conversation

@vecnode

@vecnode vecnode commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What & why

1. Stop tracking outputs/

Generated sketches, PNG captures, and WebM recordings are local. Added outputs/* to .gitignore (keeping outputs/README.md as the folder placeholder) and removed the four old test .js files from tracking (kept on disk). The app re-creates outputs/ at runtime.

2. Two more examples

Added Random walker and Particle swarm to the Examples menu (5 total). Selecting one loads and runs it.

3. Libraries panel (relates to #3)

New Libraries section in the right side panel, under Capture:

  • A dropdown of p5.js builds, populated from a new public/libraries.json manifest ({ id, name, version, url, isLocal }). The manifest doubles as the allow-list of injectable builds — the JS-first approach proposed in Proposal: JS-First Library Injection Architecture (replace C++ LibraryRegistry) #3.
  • An inline Apply button. Applying sets activeLibrary, so future sketch runs load that build's <script>, reloads any running sketch, and updates the version label under the editor to the chosen build.
  • The bundled v1.11.3 (isLocal: true) is the default and keeps the app fully offline. The three online options load p5 from cdnjs — trading offline-first for version flexibility, loaded inside the same sandboxed, opaque-origin iframe (no access to the parent page or local API).

Reviewer notes

  • node --check passes; libraries.json is valid JSON; the Debug target builds and re-embeds assets.
  • Smoke-tested at runtime: GET /libraries.json returns 200 with all four entries.
  • Online builds require a network connection; selecting one when offline will make the sketch fail to find p5 (surfaced as a sketch error). The default stays offline.
  • Styling reuses the existing panel tokens (select + inline button match the panel buttons).

🤖 Generated with Claude Code

- Libraries section in the right side panel: a dropdown of p5.js builds
  (from new public/libraries.json) with an inline Apply button. Applying
  swaps the build the sketch iframe loads, reloads any running sketch,
  and updates the version label under the editor. The manifest doubles
  as the injectable-build allow-list (relates to #3). Bundled v1.11.3 is
  the offline default; online builds load p5 from a CDN.
- Two more example sketches: Random walker, Particle swarm (5 total).
- Stop tracking outputs/ contents (.gitignore outputs/* with the folder
  README kept); generated sketches/captures/recordings stay local.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vecnode vecnode merged commit 1858677 into main Jun 28, 2026
@vecnode vecnode deleted the libraries-panel-and-examples branch June 28, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant