ADFA-5169 feat(pending): see and cancel queued content orders - #430
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
"None"), opening a minimal Pending downloads screen. The count refreshes on entry
and on return from the screen.
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.
org.iiab.controller.pending(domain / data / presentation),reusing
ContentType/PendingContent. The only low-level addition isZimWishlist.remove(key); Books and Kolibri already had per-item removal.Out of scope (by design)
ADFA-4893 download-contract family.
slice of.
Verification
PendingOrderTest).(
PendingOrdersRepositoryImplTest), including cancelling one ZIM and leaving theother (exercises the new
ZimWishlist.remove).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.