feat(ui-lvgl): roadmap stage 3 - message history on SD, Storage screen, saved trails

- Message history archived per conversation on the SD card (HIST_ARCHIVE):
  restored on boot, Older/Newer paging in threads, kept count selectable
- Settings > System > Storage: card and flash usage, breakdown by maps,
  messages, trails and other, kept-per-chat setting, delete history;
  reads the mounted volume and warns when the FAT partition is much
  smaller than the card
- Saved trails on the card: every Save is a new file, Load opens a list
  with load (framed on the map), GPX export and delete
- Diagnostics: GPS data rows, last start reason, last crash summary
- Messages restored before the clock is set show their date instead of 0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-09-26 19:17:08 +02:00
co-authored by Claude Opus 5.5
parent 4f5357031f
commit 277c0cddf1
15 changed files with 1272 additions and 37 deletions
+12
View File
@@ -301,3 +301,15 @@ The speaker plays through the ES8311 codec (I2S MCLK 10 / BCK 11 / WS 12 / DOUT
- [ ] Nearby with many nodes: up to 64 rows; contact list "All" shows beyond 64 contacts
- [ ] Home tile and screen title read "Nodes" (was "Nearby")
- [ ] Nodes > advert: "Zero hop" / "Flood" (were "Nearby only" / "Everyone"), toasts "Zero-hop advert sent" / "Flood advert sent"
## Roadmap stage 3: message history on the SD card (2026-09-26)
- [ ] Receive and send a few channel posts and DMs, reboot: they're all back (Messages list and inside), relay marks / delivery ticks as before the reboot
- [ ] A busy channel: "Older messages (n)" at the top pages back 50 at a time, "Newer messages" at the bottom returns; older than the ~256 the memory holds are still there
- [ ] Settings > System > Storage: SD used / free bar, Maps / Messages / Trails / Other fill in while "Counting files..." runs (a big map takes a while), internal flash bar
- [ ] Kept per chat 500 → 100: conversations with more keep their newest 100; back to 500 keeps working (new messages add up again)
- [ ] Delete message history: first tap asks, second deletes; Messages is empty, the card's Messages size drops to ~0
- [ ] Without an SD card: messages work as before (memory only), Storage says "No SD card"
- [ ] A channel deleted and added again (same name / key) gets its history back
- [ ] Map tools > Save with a card: toast "Saved trails/trail-....trl"; Save again later: a second file
- [ ] Map tools > Load: list newest first ("Saved on the device" too if there is one); a trail: distance / time / points, Load frames it on the map, GPX writes trails/<name>.gpx, Delete asks then deletes
- [ ] Diagnostics > Live: GPS row (no data / no fix, n sats / fix, n sats), Last start, Last crash (after a crash)
+20 -5
View File
@@ -54,11 +54,26 @@ Decisions already made:
## 3. Data on the SD card
Postponed (2026-09-26): the user may extend this stage first.
- [ ] Message history on SD, kept across reboots (~100 per conversation;
the newest ones cached in PSRAM).
- [ ] Trail saved to SD (it holds 4096 points in PSRAM since stage 2).
- [x] Message history on SD (`HistoryStore.h`, `-D HIST_ARCHIVE`): one
file per conversation in `/sdcard/meshcore/history` (channels keyed by a
hash of name + secret, contacts / rooms by key prefix), a ring of the
history entries themselves, every new message and later change (relay
echo, delivery) written at once. After a reboot the newest entries go
back into the RAM ring (Messages list, previews); a conversation shows
50 at a time with "Older messages (n)" / "Newer messages" and reads the
card, so it reaches back as far as the card keeps. Kept per chat: 100 /
250 / 500 (default) / 1000 / 2000, ~20 KB per 100 messages.
- [x] Settings > Storage: SD card used / free with what takes it (maps,
messages, GPX trails, other; files counted in the background), the
internal flash, "Kept per chat", "Delete message history" (tap twice).
- [x] Saved trails on the SD card: Map tools > Save writes a new
`/sdcard/trails/trail-YYYYMMDD-HHMM.trl` each time (the internal slot
without a card); Load lists them newest first (plus the internal slot,
where the low-battery auto-save goes) -- each with distance, time and
points, Load (the map frames it), GPX, Delete.
- [x] Diagnostics > Live: GPS (off / no data / fix or no fix with satellites),
why the device last started (crash, watchdog, low voltage...), and the
last crash from the core dump partition (task and address).
## 4. UI layout