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

+18 -7
View File
@@ -220,7 +220,7 @@ async function runEspnowPing({ btn, dot, statusEl } = {}) {
function applyEspnowPingToDeviceRows(responses, phase) {
const container = document.getElementById('devices-list-modal');
if (!container) return;
container.querySelectorAll('.profiles-row[data-device-transport="espnow"]').forEach((row) => {
container.querySelectorAll('.profiles-row[data-device-transport="espnow"], .profiles-row[data-device-transport="wifi"]').forEach((row) => {
const dot = row.querySelector('.device-status-dot');
if (!dot) return;
if (phase === 'pinging') {
@@ -427,14 +427,15 @@ async function createDeviceFromModal() {
if (statusEl) statusEl.textContent = 'Name is required';
return;
}
if (mac.length !== 12) {
if (transport === 'wifi') {
if (!address) {
if (statusEl) statusEl.textContent = 'Address is required for Wi-Fi devices (the driver hostname, e.g. led20)';
return;
}
} else if (mac.length !== 12) {
if (statusEl) statusEl.textContent = 'MAC must be 12 hex characters';
return;
}
if (transport === 'wifi' && !address) {
if (statusEl) statusEl.textContent = 'Address is required for Wi-Fi devices';
return;
}
if (btn) {
btn.disabled = true;
@@ -446,7 +447,7 @@ async function createDeviceFromModal() {
name,
transport,
type: 'led',
mac,
mac: transport === 'wifi' ? undefined : mac,
address: transport === 'wifi' ? address : mac,
};
const res = await fetch('/devices', {
@@ -549,6 +550,15 @@ function renderDevicesList(devices) {
label.style.flex = '1';
label.style.minWidth = '100px';
// Simulated (a driver of the rig page at /sim/, heard on the browser bridge) or a real board
const isSim = !!(dev && dev.sim);
const kind = document.createElement('span');
kind.className = `device-kind-badge device-kind-badge--${isSim ? 'sim' : 'real'}`;
kind.textContent = isSim ? 'sim' : 'real';
kind.title = isSim
? 'Simulated: a driver on the rig page (/sim/), reached over the browser bridge'
: 'A real board';
const editBtn = document.createElement('button');
editBtn.className = 'btn btn-secondary btn-small';
editBtn.textContent = 'Edit';
@@ -576,6 +586,7 @@ function renderDevicesList(devices) {
row.appendChild(dot);
row.appendChild(label);
row.appendChild(kind);
row.appendChild(editBtn);
row.appendChild(identifyBtn);
row.appendChild(deleteBtn);