Repository navigation
ADFA-5339 feat(dashboard): the card's update-affordance rule and shared fetch - #518
Merged
Merged
Conversation
…ed fetch
The pure rule that turns an update-check outcome into a card state — primary action (Update vs
Rebuild), status pill, offline, version subtitle — plus the one place that fetches it
(cache → live → offline). Both the module-hub row and the detail card will consume these instead of
each re-implementing the logic, so the two surfaces can't drift. DashboardCardState is android-free
and unit-tested (7 cases); DashboardCardStatus is the thin glue over the existing /update-check +
UpdateStatusCache. No consumer yet — the UI wiring lands in the next commit.
ADFA-5339 feat(app): update-aware Dashboard card + cancel confirmation (Surfaces 1 & 5)
Wires both Dashboard-card surfaces to the shared rule/fetch. Surface 1: the primary action reads
"Update" when a newer REST-core build exists and "Rebuild" when up to date (de-emphasized), on the
module-hub row and the detail card; offline shows a "No connection" pill and no Update affordance;
the version target rides in the subtitle ("REST core · v1.2.7 → v1.3.0"), not the button. The action
is unchanged — it still routes through DashboardRebuild.confirmAndStart. Surface 5: the in-card
Cancel and the notification's Cancel both confirm ("Stop the update?") before signalling the server;
the notification can't host a dialog, so it routes through a transparent
DashboardCancelConfirmActivity.
Device-verified over 1.2.12 (== main): both cards show Rebuild (up to date), offline shows No
connection, and both Cancel paths raise the confirm dialog. UPDATE_AVAILABLE can't be shown on a box
that is already on main; it's covered by the resolver's unit tests.
New strings live in values/strings_5339.xml, temporarily translatable="false" so the strict
MissingTranslation lint passes while the 38-locale translations are pending; the l10n step migrates
them into strings.xml and deletes that file.
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.
The pure rule that turns an update-check outcome into a card state — primary action (Update vs Rebuild), status pill, offline, version subtitle — plus the one place that fetches it (cache → live → offline). Both the module-hub row and the detail card will consume these instead of each re-implementing the logic, so the two surfaces can't drift. DashboardCardState is android-free and unit-tested (7 cases); DashboardCardStatus is the thin glue over the existing /update-check + UpdateStatusCache. No consumer yet — the UI wiring lands in the next commit.
ADFA-5339 feat(app): update-aware Dashboard card + cancel confirmation (Surfaces 1 & 5)
Wires both Dashboard-card surfaces to the shared rule/fetch. Surface 1: the primary action reads "Update" when a newer REST-core build exists and "Rebuild" when up to date (de-emphasized), on the module-hub row and the detail card; offline shows a "No connection" pill and no Update affordance; the version target rides in the subtitle ("REST core · v1.2.7 → v1.3.0"), not the button. The action is unchanged — it still routes through DashboardRebuild.confirmAndStart. Surface 5: the in-card Cancel and the notification's Cancel both confirm ("Stop the update?") before signalling the server; the notification can't host a dialog, so it routes through a transparent DashboardCancelConfirmActivity.
Device-verified over 1.2.12 (== main): both cards show Rebuild (up to date), offline shows No connection, and both Cancel paths raise the confirm dialog. UPDATE_AVAILABLE can't be shown on a box that is already on main; it's covered by the resolver's unit tests.
New strings live in values/strings_5339.xml, temporarily translatable="false" so the strict MissingTranslation lint passes while the 38-locale translations are pending; the l10n step migrates them into strings.xml and deletes that file.