feat: browser simulator served by the controller, desktop build, browser bridge

- led-simulator: the rig runs the C++ led-driver as WebAssembly (sim-driver/),
  one single-threaded worker per bar, no cross-origin isolation needed. Rooms
  (one JSON per room) with an on-page editor, and a pattern gallery. The
  Python server, Pyodide boot and ring buffer are removed.
- sim-controller sim_rig.c: serves /sim/ from an embedded pack, the page's
  WebSocket and the rooms/flash API. The desktop build embeds it too.
- bridge.c: a "browser" bridge kind that carries ESP-NOW frames to the page;
  devices announced through it are marked sim.
- UI: Simulator in the Menu, split view with resize and pop-out, swipe
  between controller and rig on phones; SIM/REAL badges in Devices.
- Fades: preset pushes and Wi-Fi driver bodies always carry fade and
  beat_time, so "off" no longer inherits an earlier fade.
- Also the sequences-v2 work in progress: desktop port, bridge firmware,
  serial bridge, Wi-Fi drivers, sequence timeline, audio and API changes.
- led-driver: ESP-NOW link, beat sync, control messages, sim hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-16 19:32:46 +13:00
1 parent 698c1463c0
commit 581b751904
506 files changed
+42336 -3599

No files matched your search

+20
View File
@@ -70,3 +70,23 @@ def test_sequence_round_trip(c, profile):
step = resp.json()[new]["lanes"][0][0]
assert step["beats"] == 3 and step["preset_id"] != a
assert step["preset_id"] in c.get("/presets").json()
def test_profile_import_folds_animation_ids(c, profile):
"""Older bundles list a zone's one-shots apart, in animation_ids: they land in sequence_ids."""
a = next(iter(c.get("/presets").json()))
sid = new_id(c.post("/sequences", json={"name": "pytest-seq", "lanes": [[{"preset_id": a, "beats": 2}]]}))
oid = new_id(c.post("/sequences", json={"name": "pytest-once", "loop": False,
"lanes": [[{"preset_id": a, "beats": 1}]]}))
zid = c.get(f"/profiles/{profile}").json()["zones"][0]
c.put(f"/zones/{zid}", json={"sequence_ids": [sid, oid]})
bundle = c.get(f"/profiles/{profile}/export").json()
z = bundle["zones"][zid]
z["sequence_ids"], z["animation_ids"] = [sid], [oid] # as an older controller exported it
new = c.post("/profiles/import", json={"bundle": bundle, "name": "pytest-imported"}).json()["id"]
zone = c.get(f"/zones/{c.get(f'/profiles/{new}').json()['zones'][0]}").json()
assert "animation_ids" not in zone
names = [c.get(f"/sequences/{s}").json()["name"] for s in zone["sequence_ids"]]
assert names == ["pytest-seq", "pytest-once"]
c.delete(f"/profiles/{new}")