* refactor: render chat rows from presentation state * Fix Meshtastic channel sync and add MeshCore CN preset * Add granular chat notification settings * Add SD settings backup and restore * Prepare 0.1.26-alpha release --------- Co-authored-by: vicliu624 <vicliu@outlook.com>
3.0 KiB
Chat Runtime Event Pump Specification
Purpose
Define the Phase 7.7 ownership boundary for Chat runtime event routing, delivery projection, key verification projection, and ChatService scheduling.
Core Rule
Runtime event projection belongs to the event pump.
UI refresh belongs to the controller.
The controller must not own runtime event projection or runtime scheduling.
Types
IChatUiRefreshSink
IChatUiRefreshSink is the minimal UI refresh port exposed to runtime event code.
It may:
- notify the UI that a runtime message arrived
- notify the UI that a send result changed
- notify the UI that unread counts changed
- ask the UI to show a key verification snapshot
It must not:
- expose
ChatService - expose
ChatDeliveryReadModel - expose
ChatDeliveryEventProjector - expose
LegacyKeyVerificationSource - expose raw EventBus events
ChatPageRuntimeEventPump
ChatPageRuntimeEventPump is the chat page event pump and event router.
It may:
- call
ChatService::processIncoming() - call
ChatService::flushStore() - receive EventBus
sys::Eventobjects - route
ChatSendResultEventtoLegacyChatDeliveryEventBridge - route key verification events to
LegacyKeyVerificationSource - select the key verification peer on
KeyVerificationModel - notify
IChatUiRefreshSink - delete consumed EventBus events
It must not:
- render LVGL widgets
- own
ChatWorkspaceModel - encode Team payloads
- retry messages
- implement protocol packet flow
ChatPageRuntimeFacade
ChatPageRuntimeFacade implements IChatUiRuntime for existing app facade integration.
It calls:
event_pump.update()
controller.update()
for ticks, and:
event_pump.handleEvent(event)
for EventBus events.
chat_page_runtime.cpp registers the facade, not ChatUiController, as the active chat UI runtime.
Event Handling Order
ChatSendResultEvent
ChatPageRuntimeEventPumpcallsLegacyChatDeliveryEventBridge::onChatSendResult(...).ChatPageRuntimeEventPumpcallsIChatUiRefreshSink::onRuntimeSendResult(...).
ChatNewMessageEvent
- Chat service already owns message storage.
ChatPageRuntimeEventPumpcallsIChatUiRefreshSink::onRuntimeMessageArrived(...).
ChatUnreadChangedEvent
ChatPageRuntimeEventPumpcallsIChatUiRefreshSink::onRuntimeUnreadChanged().
Key Verification Events
ChatPageRuntimeEventPumpupdatesLegacyKeyVerificationSource.ChatPageRuntimeEventPumpselects peer onKeyVerificationModel.ChatPageRuntimeEventPumpcallsIChatUiRefreshSink::showKeyVerification(...).
Runtime Scheduling
ChatPageRuntimeEventPump::update() owns the chat page's legacy runtime tick:
ChatService::processIncoming()
ChatService::flushStore()
ChatUiController::update() remains UI-only and may refresh dirty UI state.
Non-goals
Phase 7.7 does not:
- rewrite EventBus
- rewrite
ChatService - rewrite
ChatUiController - implement a new thread model
- change protocol packet flow
- solve Team rich payload rendering
- solve Map tile/cache ownership