Icons: small images of their own size for pages

Bitmaps that only pages use (backgrounds, images by state) are now icons:
own width and height, stored in /icons, not in the page lists or the Home
Assistant dropdowns. Page backgrounds and image elements use icons or
bitmaps; the renderer gets icons expanded at the top left, so pages look
the same. Web UI: Icons tab with an editor, Make icon / Make bitmap, Save
as icon on the Draw tab, icons in the backup.

A one-time migration in time-boxed steps moves the uploaded bitmaps that
only pages use, after the new firmware is marked good.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-16 22:03:18 +02:00
1 parent 1704cbf17b
commit ab001e5d18
37 files changed
+955 -78

No files matched your search

+10
View File
@@ -149,6 +149,16 @@ See README.md for the overview.
`VERSION` there (old records then fall back to defaults).
- Bitmaps on LittleFS in the `spiffs` partition (`/bitmaps/<name>.bin`, 209 bytes). Names
are restricted (`validBitmapName`), which also makes them safe in paths and JSON.
- Icons (`logic/icon_format.h`, `display/icon_store`, `/icons/<name>.bin`: width, height,
rows of (w+7)/8 bytes) are small images that pages use (Image elements, backgrounds at
the top left); they are never shown on their own and are not in the page lists or HA
dropdowns. Bitmaps, icons and pages share one namespace. `PageResources::background()`
tries bitmaps, then icons (expanded at 0,0), so the renderer doesn't know the difference.
`appMigrateIcons()` ran once (marker `/icons/.migrated`) after 2.10.0 was marked good.
- LittleFS is slow: listing a directory (`listBitmaps()`, `listPages()`, `storedNames()`)
takes about a second with 40 files. Never list per item in a loop. The first icon
migration did that, hit the 30 s watchdog and crash-looped into the recovery app; work
that touches many files runs in time-boxed steps over several `loop()` passes.
- The display mirror comes from the driver's shadow buffer (`BROSE9323::shownPixel`).
- Dynamic pages (`logic/page.h`): background per time slot + elements, stored as a
versioned binary struct (`display/page_store.cpp`, bump `VERSION` when `DynamicPage`