Skip to content

feat(mqtt-data): show the screen title while connecting - #41

Merged
red77290 merged 2 commits into
red77290:mainfrom
TooncesToo:feat/mqtt-waiting-labels
Nov 29, 2026
Merged

red77290 merged 2 commits into
red77290:mainfrom
TooncesToo:feat/mqtt-waiting-labels

Conversation

@TooncesToo

@TooncesToo TooncesToo commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What. While an MQTT Data page is still waiting for its first payload, a screen with a title shows <TITLE> INCOMING... (for example WEATHER INCOMING...) instead of the generic CONNECTING notice. There is no new setting: it reuses the screen_title that 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_labels version, as suggested in review.

Commits.

  1. fix(config): keep screen_title when pruning unknown instance keys. ConfigSanitizer pruned 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_title is now kept as a UI-level key (UI_KEYS). Covered by a new test_sanitizer test.
  2. 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 appends INCOMING....
    • draw_notice_with() uses it only for Notice::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 warnings and cargo test --all-targets pass. 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

Copy link
Copy Markdown
Owner

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 screen_title with a small Showcase-style waiting animation instead of adding a manual waiting_labels field. Let's align on the approach there first!

TooncesToo and others added 2 commits November 28, 2026 23:50
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>
@TooncesToo
TooncesToo force-pushed the feat/mqtt-waiting-labels branch from 3723324 to f277400 Compare November 29, 2026 07:50
@TooncesToo TooncesToo changed the title feat(mqtt-data): per-topic waiting labels feat(mqtt-data): show the screen title while connecting Nov 29, 2026
@TooncesToo

Copy link
Copy Markdown
Contributor Author

Updated to the screen_title approach from the review on red77290/ArcadeMatrix#78. It now includes a separate fix so ConfigSanitizer keeps screen_title, which was being pruned on RPi. See the description for details.

@red77290 red77290 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@red77290
red77290 merged commit b4ce397 into red77290:main Nov 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants