Lists: keep loaded pages when returning from a detail screen !125

merged merged by cmc on 2026-09-22 21:54 UTC · krz/gitbay-ios:keep-pages into main

Discussion

cmc

Popping back from an issue, merge request or build detail re-ran the list's .task, and load() reloaded page one behind a spinner, dropping every page the user had scrolled in and the scroll position.

  • PagedListModel.needsLoad: true while loading or failed, false once a page or the empty state is on screen.
  • IssueListViewModel, MRListViewModel and BuildListViewModel gain loadIfNeeded(); each list's .task calls it. A failed or interrupted first load still retries on return.
  • Pull-to-refresh, filter changes and the reload after creating an item still call load().

A change made on a detail screen (closing an MR, relabelling an issue) now shows in the list after a pull-to-refresh rather than on return. No live UI flow pops back to one of these lists and checks its rows, so the live suite needed no change.

Unit tests: 488 passed on iOS 26.5 (7 new).