firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Multi message storage

Open HarukiToreda opened this issue 4 months ago • 7 comments

Overview

This PR introduces multi-message storage and threaded conversation view support to BaseUI, improving how messages are displayed, stored, and preserved across sessions.

Features

  • Message Storage

    • Stores the last 20 messages in RAM.
    • Persists the last 20 messages to flash on properly initiated reboot/shutdown
      (not hard power cut or reset button press).
    • Automatically restores saved messages from flash into RAM on boot.
    • Added debug logs showing the exact space used when saving to flash and the
      space restored on boot.
  • Conversation Threads

    • Messages are displayed newest to oldest with timestamps in an auto-scrollable thread view.
    • Sent messages are labeled as “Me”.
    • Incoming messages are automatically sorted into the correct thread (DM or Channel broadcast).
    • Auto-focuses on the last active conversation when a new message arrives.
    • Uses boot time counter if no RTC is available, and once valid time is obtained,
      messages are updated and written with the corrected timestamp for persistence.
    • Conversation Menu Options:
      • Switch between conversation views (Channels, DMs, or All).
      • Reply directly to the currently focused conversation.
      • Dismiss Last: remove the oldest message in the current conversation.
      • Dismiss All: clear all messages (when in View All).
  • Message Status Indicators (for sent messages)

    • Checkmark = confirmed ACK.
    • X = failed or timed-out.
    • ⚠️ Exclamation mark = relayed but no ACK.
  • Client Integration

    • Messages created on other clients (phone/web) are captured and added into the correct thread.

Additional Changes

  • Removed legacy message handling from Screen.cpp.
  • Cleaned up CannedMessageModule by removing legacy message sending and temporary message logic.
  • Fixed Emote screen rendering issues.
  • Added autofocus to message screen after sending a new message.
  • Favorite Node screens jump to conversation with action menu option.

HarukiToreda avatar Oct 02 '25 00:10 HarukiToreda

big change, we switched from dynamic std::string storage to fixed-size char[] to reduce flash build size

HarukiToreda avatar Oct 14 '25 18:10 HarukiToreda

Is it possible, for example, to add UP-DOWN arrows for devices that have a keyboard to switch between messages or scroll through a list? Thank you very much for this feature, it brings standalone devices up to the level of those with the new UI.

bobricius avatar Oct 20 '25 10:10 bobricius

Is it possible, for example, to add UP-DOWN arrows for devices that have a keyboard to switch between messages or scroll through a list? Thank you very much for this feature, it brings standalone devices up to the level of those with the new UI.

This will be reviewed and performed in a separate initiative and update to BaseUI

Xaositek avatar Oct 20 '25 12:10 Xaositek

This is great!

⚠️ Exclamation mark = relayed but no ACK.

May I suggest the usage of a different emoji for this particular delivery state? maybe :signal_strength: ? Failure to retrieve an ack from the final destination is very common and is no indicator of whether it actually reached them or not.

I think the exclamation mark is a bit loaded, i.e. it seems like a bad thing has happened.

ford-jones avatar Oct 27 '25 19:10 ford-jones

yeah unfortunately the ack part of multimessage is a side adjustment, it will need to be expanded to be more advanced in the future, for example, if you receive an ack from the first node, we currently stop listening to any others, what happens if that ack came from one of your other home nodes? it gives you a sense that something happened when it could mean nothing. Maybe a message telling you how many nodes first relayed your message in the future could be a possible expansion, but that PR should not focus on that, that seems like sometihng that should be addressed later instead.

this is what it currently looks like 20251027_155458

HarukiToreda avatar Oct 27 '25 19:10 HarukiToreda

Is any testing for this being done on the T-Pager?

nasiralamreeki avatar Oct 30 '25 18:10 nasiralamreeki

Is any testing for this being done on the T-Pager?

it has been fully tested and working on all devices with screens, T-Pager included.

HarukiToreda avatar Oct 30 '25 18:10 HarukiToreda