Repository navigation
feat(mqtt-data): show the screen title while connecting - #41
Conversation
|
Thanks @TooncesToo for pairing the RPi PR right alongside the ESP32 one! I just left a question over on red77290/ArcadeMatrix#78 to make sure I properly understand the underlying use case, and to see whether we could do this automatically from the topic / existing |
The web UI saves a screen card's custom title as instance.config.screen_title, but the sanitizer pruned every key outside the engine schema, so the title was dropped on save. ESP32 keeps it. screen_title is now kept as a UI-level key on every engine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While a page is still waiting for its first payload, a screen with a title shows "<TITLE> INCOMING..." (e.g. WEATHER INCOMING...) instead of the generic CONNECTING notice. No new setting: it reuses the screen_title every screen card already has. Screens with no title, or still titled with the engine's default name, keep CONNECTING. A label too wide for the 5x7 font on the panel is drawn in the 3x5 tiny font. The engine also reports is_realtime() while CONNECTING is shown, so the first payload is drawn without waiting out the 200 ms idle frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3723324 to
f277400
Compare
|
Updated to the |
red77290
left a comment
There was a problem hiding this comment.
Great work—and awesome catch on ConfigSanitizer pruning screen_title on RPi! Keeping UI_KEYS intact fixes custom screen card titles across every engine on the Pi, and splitting it into its own commit with a dedicated sanitizer test is super clean.
Shared::has_page() via ArcSwapOption::load() and gating is_realtime() strictly to Notice::Connecting is also spot-on. LGTM, merging!
What. While an MQTT Data page is still waiting for its first payload, a screen with a title shows
<TITLE> INCOMING...(for exampleWEATHER INCOMING...) instead of the generic CONNECTING notice. There is no new setting: it reuses thescreen_titlethat every screen card already has. Screens with no title, or still titled with the engine's default name (MQTT DATA / DONNEES MQTT / DONNÉES MQTT / DATOS MQTT), keep CONNECTING. ESP32 counterpart: red77290/ArcadeMatrix#78.This replaces the earlier
waiting_labelsversion, as suggested in review.Commits.
fix(config): keep screen_title when pruning unknown instance keys.ConfigSanitizerpruned every instance key outside the engine schema, so the title typed in a screen card was dropped on save on RPi, for every engine. ESP32 keeps unknown keys.screen_titleis now kept as a UI-level key (UI_KEYS). Covered by a newtest_sanitizertest.feat(mqtt-data): show the screen title while connecting.waiting_label()trims and uppercases the title, cuts it to 19 characters (so the ESP32 32-byte buffer fits it) and appendsINCOMING....draw_notice_with()uses it only forNotice::Connecting. If it is too wide for 5x7 on the panel (64-wide, TATE), it is drawn in the 3x5 tiny font, clamped to x ≥ 0.is_realtime()returns true only while CONNECTING is shown, so the first payload is drawn without waiting out the 200 ms idle frame. Pages with data stay on the static cadence.Shared::has_page()checks for a payload without touching the reference count.Tests.
cargo fmt --check,cargo clippy -- -D warningsandcargo test --all-targetspass. There are new tests for the label rules, for "replaces CONNECTING only" and for the tiny-font fallback.Hardware verification (Pi 2, 128×32). Cross-built for armv7 and swapped in. A weather instance titled "Weather" shows
WEATHER INCOMING...on every slot activation until the retained payload arrives, then the weather page. The title now survives saving, and untitled instances still show CONNECTING.🤖 Generated with Claude Code