refactor(ui-core): UiCore becomes MyMesh's Listener for ui-new

ui-new hands MyMesh the UI Core (UITaskBase::meshListener()). The Core
applies the display filter, labels room posts, files history, keeps DM /
channel / room unread and the queue count, and reports incoming messages
and adverts as MessageArrived / AdvertHeard events. UITask now derives
UITaskBase + UiCoreHost: it answers "is this conversation on screen" and
keeps the selection after an insert, forwards not-yet-extracted parts
(room login / admin, bot device actions, removal cleanup, shutdown), and
turns events into alert / wake / sound, drained at the start and end of
its loop(). Mesh callbacks no longer touch the display or buzzer.

AbstractUITask is split into UITaskBase (lifecycle, link state, helpers)
and the Listener glue ui-orig / ui-tiny keep using unchanged. Screenshot
handler reaches ui_task directly instead of casting the Listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-09-24 23:28:58 +02:00
co-authored by Claude Opus 5.5
parent 124265b8be
commit 74db0d69a5
10 changed files with 305 additions and 142 deletions
+3 -3
View File
@@ -3124,13 +3124,13 @@ void MyMesh::handleCmdFrame(size_t len) {
#ifdef ENABLE_SCREENSHOT
void MyMesh::handleScreenshotRequest() {
#ifdef DISPLAY_CLASS
UITask* ui_task = static_cast<UITask*>(getListener());
if (!ui_task || !ui_task->hasDisplay()) {
extern UITask ui_task; // main.cpp -- the Listener may be the UI Core, not UITask
if (!ui_task.hasDisplay()) {
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
return;
}
DisplayDriver* display = ui_task->getDisplay();
DisplayDriver* display = ui_task.getDisplay();
if (!display) {
writeErrFrame(ERR_CODE_UNSUPPORTED_CMD);
return;