Skip to content

ADFA-5169 feat(pending): see and cancel queued content orders - #430

Merged
luisguzman-adfa merged 12 commits into
mainfrom
fix/ADFA-5169-pending-downloads
Aug 18, 2026
Merged

ADFA-5169 feat(pending): see and cancel queued content orders#430
luisguzman-adfa merged 12 commits into
mainfrom
fix/ADFA-5169-pending-downloads

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Closes state-spine finding 6 (dead control): a banked ZIM/Books/Courses order —
queued but not yet drained — was invisible when nothing was running and could not
be cancelled from anywhere in the UI.

What it adds

  • An always-visible "Pending downloads" row under Settings > System (a count, or
    "None"), opening a minimal Pending downloads screen. The count refreshes on entry
    and on return from the screen.
  • The screen lists each queued order by item (ZIM / Books / Courses) with its own
    delete, an empty state, and a link to the live index when a download is running.
    Cancel is manual only — nothing is cancelled or purged automatically.
  • New feature package org.iiab.controller.pending (domain / data / presentation),
    reusing ContentType / PendingContent. The only low-level addition is
    ZimWishlist.remove(key); Books and Kolibri already had per-item removal.

Out of scope (by design)

  • Maps and module orders keep their existing cancel paths.
  • Controls for downloads that are running (retry / pause / resume / cancel) — the
    ADFA-4893 download-contract family.
  • The durable task registry / history — a separate, deferred effort this is a first
    slice of.

Verification

  • Unit test for the display ordering (PendingOrderTest).
  • Instrumented test for the list + per-item cancel over real SharedPreferences
    (PendingOrdersRepositoryImplTest), including cancelling one ZIM and leaving the
    other (exercises the new ZimWishlist.remove).
  • Lint clean; seven new strings in all 33 locales.
  • UI validated on device. The durably-banked state is not reachable through normal
    UX (live "Get More" drains immediately; the wizard cannot reach Settings), so the
    design doc explains this and the validation approach:
    controller/docs/ADFA-5169-pending-downloads-design.md.

…ent orders

State-spine finding 6. A banked ZIM/Books/Courses order is invisible when
nothing runs and can't be cancelled. Design: a Settings entry to a minimal
"Pending downloads" screen that lists each queued order by item with a manual
Cancel — never auto-cancel; auto-purge stays limited to system-gone. Reuses
ContentType/PendingContent; adds ZimWishlist.remove. Layered feature package
org.iiab.controller.pending. Seed of the future task registry (index vivo /
registro), not the registry itself.
The pure-JVM core of the pending-orders feature (finding 6): PendingOrder
(type/id/name/bytes) with a stable DISPLAY_ORDER (group by content type, then
name, then id), and the PendingOrdersRepository port (list/cancel) the data
layer will implement. JVM unit test for the ordering. No Android, no wiring yet.
…hlists

PendingOrdersRepositoryImpl reads the ZIM/Books/Courses wishlists into
PendingOrders (sorted by DISPLAY_ORDER) and cancels one by removing it from its
wishlist. Adds ZimWishlist.remove(key) — Books and Kolibri already had per-item
removal. Maps and modules stay out of scope. Android/SharedPreferences; verified
by compile.
PendingOrdersFragment lists each queued order by item with its own Cancel, an
empty state, and a link to the live index when a download is running. It observes
PendingOrdersViewModel (+ UiState + hand-wired Factory) and reuses the settings
sub-screen chrome. Not reachable yet — the Settings entry lands in the next slice.
Four base strings added; their 33-locale translations come with the string slice,
so a lint MissingTranslation warning is expected until then.
An always-visible "Pending downloads" row under Settings > System, showing the
queued count or "None", opening PendingOrdersFragment as a sub-screen (bottom nav
stays). Makes finding 6 reachable. Three row strings added; their translations
land with the string slice.
… (debug only)

DebugSeedPendingReceiver (src/debug) seeds two ZIM, one Books and one Courses
banked order from adb so the Pending downloads screen can be validated without
arranging a deferred drain. Never ships in release; removed before merge.
An always-visible "Pending downloads" row under Settings > System, showing the
queued count or "None", opening PendingOrdersFragment as a sub-screen (bottom nav
stays). The count refreshes in onResume, so it is current on tab entry and on
return from the screen. Makes finding 6 reachable. Three row strings added; their
translations land with the string slice.
Homologates the cancel affordance with the maps (FqrController) and Kiwix
(KiwixManageController) per-row deletes: ic_delete_24 in the danger colour
instead of a "✕" glyph, so removing a queued order reads as a delete. No confirm
dialog — a queued order has nothing downloaded to lose yet.
…locales)

The seven new strings — the screen's title/empty/running/see-progress and the
Settings row's label/count/none — in all 33 locales, so lint MissingTranslation
passes.
…item cancel

PendingOrdersRepositoryImplTest (androidTest) validates finding 6 deterministically
with real SharedPreferences: the three content wishlists list as PendingOrders
grouped by type, the empty state, and per-item cancel — including cancelling one
ZIM and leaving the other, which exercises the new ZimWishlist.remove. The design
doc notes why this stands in for a banked state not reachable through normal UX.
Drops DebugSeedPendingReceiver and its debug-manifest entry, used to validate the
Pending downloads screen from adb. The instrumented test (PendingOrdersRepositoryImplTest)
now covers the mechanism, so the hook is no longer needed.
state-spine: finding 6 → closed (ADFA-5169); its state node S12 → resolved; the
"module sheet" dead control → resolved (ADFA-5104 made it honest); header note
refreshed to "all eight findings closed".
roadmap: ADFA-5158 marked landed (was "in flight"); verified every other ticket
card against Jira under epic 1028 — 5094 and the open cards remain open, the DONE
cards remain done.
@luisguzman-adfa
luisguzman-adfa merged commit 32aca86 into main Aug 18, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/ADFA-5169-pending-downloads branch August 18, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant