feat(controller): rootfs projection via RootfsViewModel + offline gating#7
Merged
Merged
Conversation
Prepare InstallationPlanner so the projection UI can supply the OS rootfs size from the presentation layer. - Extract the projection math (maps + Kiwix) into a private computeProjection(). - Add a calculateProjectedSize(..., osSizeGb, ...) overload for the UI path. - Keep the legacy overload (resolveOsSizeGb) for the non-UI install flow, which only needs the resolved companion-data filename.
Continue the rootfs Clean Architecture slice (#6). The install storage projection now resolves the OS size through the presentation layer, and the install screen handles the offline state. The radial gauge is left untouched. - DeployFragment observes RootfsViewModel and feeds the resolved OS size (live, with offline fallback) into the projection instead of going through InstallationPlanner.resolveOsSizeGb(). - Offline: disable the install button ("No connection") with a snackbar on tap, show an "Estimated sizes (offline)" caption when the size is a fallback, and skip the live fetch via a new attemptLive flag on GetRootfsSizeUseCase / RootfsViewModel (avoids the ~6s timeout). Addresses the connectivity-gating tech-debt item. - Add strings (en + es), a unit test (skipsLiveWhenOffline), and update CLAUDE.md (design map + new "Working in parallel" section) and controller/docs/TECH_DEBT_PLAN.md.
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.
Summary
Continues the rootfs Clean Architecture slice (#6). Two related changes to the install screen's storage projection:
RootfsViewModel) instead of havingInstallationPlannerresolve it.The radial gauge (
MultiResourceGaugeView) and its segment math were intentionally left untouched.Changes
InstallationPlanner: extractedcomputeProjection(); added acalculateProjectedSize(..., osSizeGb, ...)overload for the UI path. Legacy overload retained for the non-UI install flow.DeployFragment: creates/observesRootfsViewModel;recalculateProjection()triggersload(tier, abi, attemptLive)andonRootfsSizeResolved()completes the projection. ThehasInternetflag gates the install button and the estimated caption.GetRootfsSizeUseCase/RootfsViewModel: newattemptLiveoverload (offline falls back directly, no network wait).txt_offline_estimatecaption (hidden by default).install_btn_no_connection,install_msg_no_connection,install_offline_estimated(en + es).GetRootfsSizeUseCaseTest.skipsLiveWhenOffline().CLAUDE.md) + progress log (TECH_DEBT_PLAN.md); added a "Working in parallel" coordination section toCLAUDE.md.Testing
./gradlew :app:testDebugUnitTest(domain/use-case JVM tests, incl. the new offline test)../gradlew :app:assembleDebug— compiles; verified on device.Notes
CLAUDE.md: domain pure JVM; presentation depends only on domain; dependencies wired by hand viaRootfsViewModelFactory. The gauge was left untouched.resolveOsSizeGbpath once the install flow no longer needs it.