From f05656fb579884d23c3ee2b6428def2f233106bc Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Mon, 11 May 2026 20:05:44 +0200 Subject: [PATCH] MsgPreview: fix nav-to-home from chat screen; add fullscreen left/right message switching - msgRead(0) now only navigates to home when curr == msg_preview, preventing unexpected redirects while the user is in the chat selection screen - Fullscreen message view: LEFT/RIGHT navigate between unread messages (resets scroll to top); < > hints shown at bottom corners when more messages available Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/UITask.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 78fdb64c..3e832f18 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -2197,6 +2197,14 @@ public: display.setCursor(display.width() - 6, FS_START_Y + (FS_VISIBLE - 1) * FS_LINE_H); display.print("v"); } + if (_view_offset < num_unread - 1) { + display.setCursor(0, 56); + display.print("<"); + } + if (_view_offset > 0) { + display.setCursor(display.width() - 6, 56); + display.print(">"); + } } else { display.setCursor(0, 13); display.printWordWrap(filtered_msg, display.width()); @@ -2232,6 +2240,14 @@ public: if (_fullscreen) { if (c == KEY_UP) { if (_fs_scroll > 0) _fs_scroll--; return true; } if (c == KEY_DOWN) { _fs_scroll++; return true; } + if (c == KEY_LEFT) { + if (_view_offset < num_unread - 1) { _view_offset++; _fs_scroll = 0; } + return true; + } + if (c == KEY_RIGHT) { + if (_view_offset > 0) { _view_offset--; _fs_scroll = 0; } + return true; + } if (c == KEY_ENTER || c == KEY_CANCEL) { _fullscreen = false; return true; } return true; } @@ -2374,7 +2390,7 @@ void UITask::msgRead(int msgcount) { _msgcount = msgcount; if (msgcount == 0) { _room_unread = 0; - gotoHomeScreen(); + if (curr == msg_preview) gotoHomeScreen(); } }