From 834f047200b18bc16fa18a458c64b080fe7bb162 Mon Sep 17 00:00:00 2001 From: "torlando-agent[bot]" <281092095+torlando-agent[bot]@users.noreply.github.com> Date: Sun, 21 Jun 2026 03:11:14 -0400 Subject: [PATCH] address greptile: gather all before sort + re-add containers to focus group - AnnounceListScreen::tick(): drop the pre-sort 64-item gather cap so the sort always sees the true newest destinations (the path table is bounded by USTORE_DEFAULT_MAX_RECS=400 and items allocate in PSRAM, so the gather is bounded); only the render stays capped at MAX_DISPLAY. - tick() now re-adds the freshly rendered item containers to the focus group and focuses the first. The deferred gather meant show() (which adds widgets to the group) ran before the containers existed and lv_obj_clean dropped the old ones, so trackball navigation couldn't reach the list items. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5 --- lib/tdeck_ui/UI/LXMF/AnnounceListScreen.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/tdeck_ui/UI/LXMF/AnnounceListScreen.cpp b/lib/tdeck_ui/UI/LXMF/AnnounceListScreen.cpp index b41ef911..78f602ac 100644 --- a/lib/tdeck_ui/UI/LXMF/AnnounceListScreen.cpp +++ b/lib/tdeck_ui/UI/LXMF/AnnounceListScreen.cpp @@ -175,7 +175,10 @@ void AnnounceListScreen::tick() { item.display_name = parse_display_name(app_data); } items.push_back(item); - if (items.size() >= 64) break; // bound the gather + // No pre-sort cap: gather every matching lxmf.delivery destination so the + // sort below always sees the true newest. The path table is bounded by + // USTORE_DEFAULT_MAX_RECS (400) and these allocate in PSRAM, so the gather + // is bounded; only the render is capped (MAX_DISPLAY). } std::sort(items.begin(), items.end(), @@ -211,6 +214,21 @@ void AnnounceListScreen::tick() { count++; } } + + // Re-add the freshly created item containers to the focus group for trackball + // navigation. The gather is deferred to this main-loop tick, so show() (which + // adds widgets to the group) ran before these containers existed, and the + // lv_obj_clean above dropped the previous ones. The announces screen is current + // (UIManager gates this tick on it), so focusing the first item here is safe. + lv_group_t* group = LVGL::LVGLInit::get_default_group(); + if (group) { + for (lv_obj_t* container : _announce_containers) { + lv_group_add_obj(group, container); + } + if (!_announce_containers.empty()) { + lv_group_focus_obj(_announce_containers[0]); + } + } } void AnnounceListScreen::show_empty_state() {