From 3a0b0a4fee08a853422b2c75fd7fa0e5e6d97d15 Mon Sep 17 00:00:00 2001 From: Christos Themelis Date: Mon, 4 May 2026 13:44:37 +0300 Subject: [PATCH] ui fixes --- examples/simple_secure_chat_ui/main.cpp | 5 +++-- examples/simple_secure_chat_ui/uiManager.cpp | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/simple_secure_chat_ui/main.cpp b/examples/simple_secure_chat_ui/main.cpp index 9343764e3..052f39e73 100644 --- a/examples/simple_secure_chat_ui/main.cpp +++ b/examples/simple_secure_chat_ui/main.cpp @@ -330,7 +330,7 @@ void msgstore_load_dm(const uint8_t* pub_key) { uiManager->addPrivateChatBubble(time_buf, text.c_str(), dir == '>', false); } f.close(); - uiManager->scrollPrivateChatToBottom(); + // scroll is done by the caller (handleContactClick) after flex layout is re-enabled #endif } @@ -383,7 +383,7 @@ void msgstore_load_public() { uiManager->addChatBubble(time_buf, sender.c_str(), text.c_str(), dir == '>', false); } f.close(); - uiManager->scrollPublicChatToBottom(); + // scroll done by caller after endPublicHistoryLoad() re-enables flex #endif } @@ -1151,6 +1151,7 @@ void initializeMesh() { uiManager->beginPublicHistoryLoad(); msgstore_load_public(); uiManager->endPublicHistoryLoad(); + uiManager->scrollPublicChatToBottom(); // after flex layout is recalculated Serial.printf("[ui] free heap: %u B free PSRAM: %u B\n", esp_get_free_heap_size(), esp_get_free_internal_heap_size()); diff --git a/examples/simple_secure_chat_ui/uiManager.cpp b/examples/simple_secure_chat_ui/uiManager.cpp index ae801b0e4..b984039d2 100644 --- a/examples/simple_secure_chat_ui/uiManager.cpp +++ b/examples/simple_secure_chat_ui/uiManager.cpp @@ -437,6 +437,7 @@ void UIManager::handleContactClick(lv_event_t *e) msgstore_load_dm(currentContactPubKey); if (ui_ContactMessages) lv_obj_set_flex_flow(ui_ContactMessages, LV_FLEX_FLOW_COLUMN); + scrollPrivateChatToBottom(); // after layout is recalculated } void UIManager::addContactToUI(ContactInfo c)