Files
pipelines/android/app
alan 1c925d72f7 Remember sort options for the pipelines and runs lists
Add a per-list sort control to each top bar and persist the choice in
SharedPreferences so it survives restarts.

- ui/screens/ListSort.kt: PipelineSort and RunSort enums plus pure
  comparators with explicit tie-breaks, and sortPipelines/sortRuns.
  ServerOrder/NewestFirst remain the defaults; a still-executing or
  unparseable-timestamp run sorts last.
- ui/components/SortMenu.kt: the shared top-bar control, a distinct
  IconButton opening a Material 3 DropdownMenu of every option plus a
  divider and Reset, with the active choice checked.
- data/SettingsRepository.kt + ui/AppViewModel.kt: store the sort key
  per list as a StateFlow; fromStorage falls back to the default for a
  stale/unknown/blank value.
- ui/Format.kt: share parseInstant and durationSeconds so the printed
  duration and the sort key cannot disagree; PipelineLastRun.kt reuses
  the shared latest-run fold.
- PipelineListScreen.kt/RunHistoryScreen.kt wire the control and sort;
  groupRunsByDay preserves the comparator's order.
- ListSortTest.kt covers the comparators and storage fallback;
  RunGroupingTest.kt gains an explicit-order case.

Verified on this tree with :app:testDebugUnitTest (167 tests, 0
failures), assembleDebug, and emulator-5556 persistence, the sort
control, and Reset; captured in android/README.md.
2026-10-16 04:57:53 +01:00
..