You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(gui): restore live metrics + preview on LED devices (cutover regressions)
Summoned LED/DIGITAL coolers showed M1-M6 = `--` and a dead preview. Three
regressions from the next/ cutover, all restored; LED now uses the SAME paths
as LCD (the device's render IS the preview, off one source):
1. Handler built without `app`. `_add_handler` hand-wired two divergent
branches; the LED branch forgot `app=`, so `LEDHandler._app` stayed None and
`update_metrics` early-returned every tick. Collapsed both branches into one
`_build_handler` chokepoint that injects `app` + panels uniformly, driven by
the new shared presentation backbone. `LEDHandler` now REQUIRES `app` (raises,
like LCDHandler) and the dead `set_app` is gone.
2. Sensor tick skipped LED. The render observer only re-rendered devices with a
theme (LCD); LED has none, so `RenderLed` never fired on a sensor update. Now
ticks `RenderLed` for connected LED devices — the LED twin of RenderAndSend.
3. Render output never reached the preview. `RenderLed` published only a count.
Now it publishes its colors on `FrameSent` — the SAME event/slot LCD uses
(`surface` for LCD, `display_colors` for LED) → one `_on_bus_frame_sent` →
`handle_frame` → preview. One render → FrameSent → preview, for both kinds.
No parallel pipe.
New shared backbone: `ui/presentation/device_presentation.py` —
`presentation_for(ProductInfo) -> DevicePresentation` (kind→view+gauges, keyed on
vid/pid+handshake), Qt-free, for both ui/gui and ui/qtgui to join against instead
of re-deriving device→view.
Verified deterministically (real event loop, real widget state, not the
formatter): summoned AX120 → M1-M6 show live CPU/GPU + preview 30/30 segments
lit. Tests: presentation_for over the registry; LEDHandler-rejects-None-app.
Logging filled on the silent hops (handle_frame, update_sensor_metrics). 1498
green, ruff + pyright clean. dev/tools/diagnose_metrics.py: deterministic
single-device probe (force-added; .gitignore `tools/` catches dev/tools).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments