Skip to content

ADFA-4910: Get More storage projection counts maps + adaptive size units - #276

Merged
luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-4910-getmore-storage
Jul 29, 2026
Merged

luisguzman-adfa merged 4 commits into
mainfrom
fix/ADFA-4910-getmore-storage

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

The Get More storage breakdown ("Used / System / Your picks / Free") read "Your picks 0.0" because picksGb() summed only ZIM (real bytes) plus a tiny books estimate — maps were never counted, and sub-GB picks rounded to 0.0.

  • Bank the maps selection's total size (from the maps catalog, already computed in MapsChooseFragment) into MapsWishlist, and add it to picksGb() so maps counts toward the projection.
  • Adaptive units in the legend: show KB / MB / GB by magnitude so small picks are visible. This switches the k2go_legend_your_picks placeholders from %.1f to %s across the base string and all 33 locales, so each value carries its own pre-formatted, unit-aware string (changing only the base type would crash non-English locales).
  • Books stay an estimate (~3 MB each): the Gutenberg catalog exposes no per-book size.

Verified: Java parses, XML valid, all locales keep 4 balanced %s placeholders.

'Your picks' summed only ZIM (real bytes) + a tiny books estimate, so a
maps-heavy selection still read 0.0 GB and small picks rounded to 0.0.

- Bank the maps selection's total size (from the catalog) into MapsWishlist
  and add it to picksGb() so maps counts toward the projection.
- Show KB/MB/GB adaptively in the legend so sub-GB picks are visible
  (switch the k2go_legend_your_picks placeholders from %.1f to %s across the
  base string and all locales to carry pre-formatted, unit-aware values).
- Books stay an estimate (the Gutenberg catalog exposes no per-book size).
Every size shown in the redesign UI now goes through ByteFormatter.humanGb
/ humanMb (adaptive KB/MB/GB, unit picked from the rounded value):
- Add humanGb(double)/humanMb(long) to the shared ByteFormatter util.
- Route the per-fragment gb()/fmt() helpers (Zim landing/category/confirm/
  preparing, Maps choose/confirm), GetMoreHub, WikiVariants and LibrarySize
  to it; drop the duplicated inline formatters and now-unused Locale imports.
- Convert the k2go_legend_sys_free legend (Step 1) to %s across the base
  string and all 33 locales, formatting via the shared util (matches the
  your_picks legend).
@luisguzman-adfa
luisguzman-adfa merged commit 290f2b3 into main Jul 29, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/ADFA-4910-getmore-storage branch July 29, 2026 01:42
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