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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UWZuYkHBRqNb6BZHV8sTG5
This commit is contained in:
torlando-agent[bot]
2026-06-21 03:11:14 -04:00
co-authored by Claude Opus 4.8
parent 142ff464e8
commit 834f047200
+19 -1
View File
@@ -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() {