-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Multi message storage #8182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Multi message storage #8182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces comprehensive multi-message storage and threaded conversation view capabilities to BaseUI. It transforms how messages are displayed, stored, and preserved across device sessions.
- Implements persistent message storage (last 20 messages in RAM + flash persistence)
- Adds threaded conversation views with automatic sorting and status indicators
- Modernizes message handling by centralizing logic in MessageStore and MessageRenderer
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/MessageStore.h/.cpp | New central message storage system with persistence and filtering |
src/graphics/draw/MessageRenderer.h/.cpp | Enhanced renderer with thread modes and conversation switching |
src/graphics/draw/MenuHandler.h/.cpp | New conversation management UI with view modes and reply options |
src/modules/TextMessageModule.h/.cpp | Updated to use centralized storage instead of direct display |
src/modules/CannedMessageModule.h/.cpp | Improved message sending with storage integration and ACK tracking |
src/graphics/Screen.h/.cpp | Refactored to remove legacy message handling and add persistence |
src/modules/SystemCommandsModule.cpp | Added message persistence on reboot |
src/Power.cpp | Added message persistence on shutdown |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
if (idx == 0 || _line.find("ago") != std::string::npos || _line.rfind("me ", 0) == 0) { | ||
isHeader = true; | ||
} | ||
|
||
// Look ahead to see if next line is a header → this is the last line of a message | ||
bool beforeHeader = | ||
(idx + 1 < lines.size() && (lines[idx + 1].find("ago") != std::string::npos || lines[idx + 1].rfind("me ", 0) == 0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header detection logic using string searches for 'ago' and 'me ' is fragile and could produce false positives. Consider using a more robust approach like explicit header marking or enum-based line types.
Copilot uses AI. Check for mistakes.
this->runState = CANNED_MESSAGE_RUN_STATE_SENDING_ACTIVE; | ||
this->payload = wantReplies ? 1 : 0; | ||
requestFocus(); // focus only after event is dispatched |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block is duplicated at lines 1029-1031. The state assignment and focus request logic should be consolidated to avoid duplication.
Copilot uses AI. Check for mistakes.
// Values are always 0–255, no need to check | ||
TFT_MESH = COLOR565(TFT_MESH_r, TFT_MESH_g, TFT_MESH_b); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the condition check but kept the closing brace, creating unmatched braces that will cause compilation errors.
Copilot uses AI. Check for mistakes.
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
(not hard power cut or reset button press).
space restored on boot.
Conversation Threads
messages are updated and written with the corrected timestamp for persistence.
Message Status Indicators (for sent messages)
Client Integration
Additional Changes