Existing accounts (including admin) seeded before new demos shipped
had no easy way to pull in the latest copies — the registration-time
seeder is intentionally non-destructive. The new badge action fetches
src/static/bundled-demos/manifest.json, confirms the overwrite, and
re-copies each canonical demo into code/. Open tabs of those files are
refreshed in place so the user sees the new content immediately.
src/static/bundled-demos/ ships the six canonical files plus the
manifest so this works in local mode and on a static-only host. The
Dockerfile now mirrors workspace/code/<demo>.py into bundled-demos/
during the image build, keeping the two locations in sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
`_CANONICAL_DEMO_FILENAMES` now also lists `pin_demo.py`,
`adc_slider_demo.py`, and `serial_demo.py` so first-time users get
working examples for every simulator. Seeding stays idempotent — the
dst-exists guard keeps re-registration / sign-in from clobbering edits.
Co-authored-by: Cursor <cursoragent@cursor.com>
Boot:
- Editor now picks local vs server mode based on URL flag, sign-in
state, and a stale local-mode flag. Signed-in users are no longer
bounced to IndexedDB if they had previously clicked "Use locally".
Local mode:
- New LocalWorkspaceClient (src/static/local-workspace.js) with
pluggable IndexedDB and File System Access backends. Picked folder
handles persist across reloads with a Reconnect button when the
permission lapses.
- Static-only host: scripts/serve_static_editor.py serves src/static/
with COOP/COEP so SharedArrayBuffer-backed sims keep working.
- Bundled MicroPython stubs ship under src/static/bundled-lib/ for
static hosting; FastAPI also exposes them at /api/public/lib-bundle.
Workspace import / export:
- Zero-dep ZIP encoder + reader (STORE + DEFLATE via
DecompressionStream). Export/Import buttons in the workspace badge
work in both local and server modes; imports are confined to code/.
Pin / ADC / Serial simulation:
- machine.py grows ADC, UART, expanded Pin, and PWM mocks, all driven
by SharedArrayBuffer when cross-origin isolated and falling back to
postMessage + [pin-out] stdout markers otherwise — pins, ADC slider,
and serial input now keep working over plain HTTP / LAN-IP origins.
- NeoPixel pins are claimed via a [pin-claim] marker and dropped from
the Pins panel so the data line doesn't flicker per write().
- New demos: adc_slider_demo.py, pin_demo.py, serial_demo.py.
Lib layout:
- Single source of truth at repo lib/; workspace/lib/ caching layer
removed and the directory deleted. Filesystem service reads stubs
directly from PROJECT_ROOT/lib.
UI:
- Home page slimmed to "Sign in" + "Use locally" with optional editor
/ manage-users links. Admin user/invite UI moved to /users.
- Workspace badge gains storage indicator, Folder…/Reconnect, Export,
Import, and Exit controls.
- Mobile-friendly tweaks: safer-area padding, larger touch targets,
iOS-zoom-proof serial input, file-tree highlight fix.
Tests:
- test_auth.py patches PROJECT_ROOT for the lib-shared test so the
repo-root lib refactor stays green. test_api.py asserts the new
"LED Editor" branding.
Co-authored-by: Cursor <cursoragent@cursor.com>
Use "LED Editor" in page titles and the home heading. On narrow
viewports, make the file tree an off-canvas drawer with backdrop,
hamburger toggle, Escape to close, and auto-close after opening a
file. Add safe-area and tap-target tweaks, cache-bust static assets.
Co-authored-by: Cursor <cursoragent@cursor.com>
Move machine.py and neopixel.py into a tracked /lib/ at the repo root and
auto-copy them into WORKSPACE_ROOT/lib whenever files are missing, so empty
volumes and fresh per-user workspaces always have the read-only stubs
available to Jedi and Pyodide. Allow all users to browse lib/ in the UI
(writes still gated by the API), and add tests covering initial seeding
and re-population after the dir is wiped.
Co-authored-by: Cursor <cursoragent@cursor.com>
Implement invite-token registration with optional email delivery, add admin UI actions for creating invites and opening user workspaces, and support superuser workspace override while preserving per-user code isolation with shared read-only lib.
Made-with: Cursor