diff --git a/controller/app/src/main/java/org/iiab/controller/redesign/ModuleActionSheet.java b/controller/app/src/main/java/org/iiab/controller/redesign/ModuleActionSheet.java index cc605ead5..8d7f9e4d9 100644 --- a/controller/app/src/main/java/org/iiab/controller/redesign/ModuleActionSheet.java +++ b/controller/app/src/main/java/org/iiab/controller/redesign/ModuleActionSheet.java @@ -68,12 +68,33 @@ public enum State { * one of them. Worse, it collapsed two orthogonal axes into one enum and then mapped LIVE * and STOPPED to the same colour to undo the collapse. Severity is a property of the row; * the class is a property of the operation. They are asked separately now. + * + *

{@link #CAUTION} was added afterwards, and it is not that collapse coming back. Install + * was teal, the same accent as Open, and that reads as "go ahead, this is a tap" for + * something that can hold the box for an hour and a half on a poor link. That is a warning + * about cost, which is severity — the axis colour is for. The class is still said in words, + * by {@link #noticeFor}, and the two channels answer different questions: the colour says be + * careful, the sentence says why. + * + *

It happens that every STOPPED operation we ship today is also a costly one, so the two + * axes agree on every row currently drawn. They are kept apart anyway, because the day a + * cheap STOPPED operation exists, {@code CAUTION} must not follow it — but note that nothing + * enforces that yet. {@code CAUTION} is chosen per row by hand, and until "this is expensive" + * is a property of the {@link Operation} rather than of the row, the separation lives in this + * paragraph and nowhere else. Do not derive it from {@code isLive()} to save the typing; that + * is the collapse, and it would be the third time. */ - private enum Emphasis { ACCENT, PLAIN, DESTRUCTIVE } + private enum Emphasis { ACCENT, PLAIN, CAUTION, DESTRUCTIVE } private static int colorOf(Emphasis e) { switch (e) { case ACCENT: return R.color.k2go_teal; + // Measured 3.30:1 against k2go_surface in light (teal is 6.47, dark amber is 6.68), + // which is under AA for body text on paper. Read on device and judged legible, so it + // stands; recorded because this token pins 24 sites at the same ratio and this is the + // first one where it carries a warning rather than a status. Revisit with real + // reports, or whenever colour tokens get a pass of their own. + case CAUTION: return R.color.k2go_amber_text; case DESTRUCTIVE: return R.color.k2go_clay; default: return R.color.k2go_ink; } @@ -181,7 +202,7 @@ public static void show(Activity act, String endpoint, String title, int iconRes String installLabel = act.getString( n > 1 ? R.string.k2go_sheet_install_sel : R.string.k2go_sheet_install); content.addView(row(ctx, R.drawable.ic_download_24, installLabel, - Emphasis.ACCENT, Operation.appInstall(key), false, v -> { dlg.dismiss(); if (sel) openMapsSetup(act); else openHub(act); })); + Emphasis.CAUTION, Operation.appInstall(key), false, v -> { dlg.dismiss(); if (sel) openMapsSetup(act); else openHub(act); })); content.addView(row(ctx, R.drawable.ic_close_24, act.getString(R.string.k2go_sheet_cancel), Emphasis.DESTRUCTIVE, null, false, v -> { if (sel) MapsWishlist.clear(ctx); @@ -197,8 +218,8 @@ public static void show(Activity act, String endpoint, String title, int iconRes // platform is installed, so neither Install nor Schedule is offered. // // A middle version offered Schedule here, on the grounds that it only writes a - // preference and leaving the state with nothing to do was harsh. Luis took that - // apart: Schedule is Install deferred. Withholding one and offering the other + // preference and leaving the state with nothing to do was harsh. That came apart + // on one point: Schedule is Install deferred. Withholding one and offering the other // grades the same wrong guess by when it hurts, not by whether it is wrong, and a // scheduled install for a platform that turns out to be installed still runs. // @@ -214,10 +235,10 @@ public static void show(Activity act, String endpoint, String title, int iconRes if (sel) { // maps: installing needs the content selector; route there (schedule lives in the wizard). content.addView(row(ctx, R.drawable.ic_download_24, act.getString(R.string.k2go_sheet_install), - Emphasis.ACCENT, Operation.appInstall(key), false, v -> { dlg.dismiss(); openMapsSetup(act); })); + Emphasis.CAUTION, Operation.appInstall(key), false, v -> { dlg.dismiss(); openMapsSetup(act); })); } else { content.addView(row(ctx, R.drawable.ic_download_24, act.getString(R.string.k2go_sheet_install), - Emphasis.ACCENT, Operation.appInstall(key), false, v -> { + Emphasis.CAUTION, Operation.appInstall(key), false, v -> { if (key != null) ModuleWishlist.add(ctx, key); dlg.dismiss(); openHub(act); diff --git a/controller/docs/ADR-5061-rest-vs-proot-operation-model.md b/controller/docs/ADR-5061-rest-vs-proot-operation-model.md index d8af78625..738d0527d 100644 --- a/controller/docs/ADR-5061-rest-vs-proot-operation-model.md +++ b/controller/docs/ADR-5061-rest-vs-proot-operation-model.md @@ -142,6 +142,54 @@ screen. Subtle, not in-your-face: the lights change, buttons appear or don't. `STOPPED → {colour: amber, navigable: false (gated to the index/card), backgroundAffordance: none, progress: full-screen index}`. Presentation reads these from the class; screens stop hand-picking. + **Amended, 11 Aug — colour is severity, not class.** The colour half of this decision was wrong + and the work proved it. `ModuleActionSheet` originally had a four-valued `Tone` carrying LIVE and + STOPPED exactly as written here; it collapsed two orthogonal axes into one enum and then mapped + both class values to the same colour to undo the collapse. What a user needs to be told about a + STOPPED operation is its *consequence*, and a consequence is a sentence — so the class is said in + words (`noticeFor` → "Your system pauses while this installs"), read from `op.isLive()`. + + Colour still does real work on that row, for a different reason. Install was teal, the same accent + as Open, which reads as "go ahead, this is a tap" for something that can hold the box for an hour + and a half. So Install is amber, as a warning about **cost** — severity, which is the axis colour + is for. The two agree on every row we ship today, because every STOPPED operation we have is also + an expensive one; they are kept apart so that a cheap STOPPED operation would not inherit the + warning. + + **And derive only where it can vary.** The other four class-expressing sites — the maps-landing + rebuild block and section header, the maps-confirm banner, the module-hub time note — stay literal + on purpose. Each is a single-purpose screen: the maps rebuild is always maps, the hub note is + always a module install. Their colour cannot drift because there is nothing to drift from, and + three of the four are static XML with no model object in scope; deriving a constant is indirection, + not a source of truth. `ModuleActionSheet` is the one surface where a LIVE row and a STOPPED row + are built by the same function and sit next to each other for the user to compare, and that is + where the rule is applied once instead of typed per row. + + **Two things accepted with open eyes, written down so they are not rediscovered as bugs.** + + *Amber now says two things on two surfaces.* On the Home cards amber is a status — "connecting", + "stopped". On this row it is a warning about cost. The contexts are far apart and the sheet draws + no status dots, so the collision was judged acceptable; but if colour tokens ever get unified, + this is the knot to untie first. + + *The two axes are separated only in prose.* Every STOPPED operation we ship is also an expensive + one, so `CAUTION` and `!op.isLive()` select the same rows in every screen currently drawn. Nothing + in the code keeps them apart — `CAUTION` is chosen per row by hand, exactly the shape the earlier + review condemned when the class was typed per row. It is deliberate: deriving from `isLive()` + would be the collapse a third time. The durable fix is for "this is expensive" to become a + property of `Operation`, next to `kind` and `executionClass`, and for the sheet to read it the way + it already reads the notice. Until then the distinction is a convention, and conventions do not + survive contributors who cannot see them. + + *And one measurement, recorded rather than acted on.* `k2go_amber_text` gives 3.30:1 against + `k2go_surface` in light mode, where teal gives 6.47:1 and the dark twin gives 6.68:1 — under AA + for body text. Read on device and judged legible, so it ships. It is noted because the token pins + 24 sites at that same ratio and this is the first one where it carries a warning rather than a + status; the fix, if reports say so, is the token's light value, not this row. + + The rest of the contract — navigable, background affordance, progress surface — is unchanged and + still reads from the class. + 4. **One dispatch point per operation** reads the class and selects mechanism + progress surface + gates. Kill the implicit per-surface derivation: replace the `SetupProgressActivity` key switch and the invisible version fork's *silent* fallback with an **explicit** resolver — and when the class @@ -1088,6 +1136,59 @@ most expensive by the third platform. A is B done safely over time. only the latter — so the three UI doors that do check `isHeld()` lose it between the door and the drain. Its own ticket. +13. [x] **Kolibri, both classes** (decision 6b). Closed by inspection, with no code of its own — + recording that is the point, because the item sat amber on a blocker that another change + had already removed. + + Seeding is LIVE and reaches the model twice over: `KolibriReadinessViewModel` resolves + `Operation.content("kolibri")` through the dispatcher, and the pickers ask `ContentDoor` + before they decide to bank or run. The install is STOPPED and reaches it through + `ModuleProvisioner` → `SystemDoor` → `Operation.appInstall("kolibri")`, which is item 12. + The roadmap note under this item — "the app install never reaches the model, + `Operation.appInstall` has one caller and it only picks an animation" — was true when it + was written and stopped being true one commit later. Corrected there. + + Not closed by this: the content drains still serialise themselves by hand + (`KolibriProvisioner.canDrainNow` checks pending proot work and other live streams). That + is a different question — stream against stream, not operation against box — and it is the + third bullet of the carried list, not this item. + +14. [x] **UX-contract tokens** (item 2d), closed by amending decision 3 rather than implementing it. + + The item had three different things inside it, which is why it stayed amber so long. + + *The colour rule.* Amended above: colour is the severity channel, the class is said in + words. Install now goes amber in `ModuleActionSheet` — a warning about cost, not about + class — through a new `Emphasis.CAUTION`. Open stays teal. The four static + class-expressing sites stay literal, and the ADR now says why instead of leaving the next + reader to wonder whether they were missed. + + *The animation.* Already delivered under ADFA-5074: `ProgressVisual.forOperation` returns + BUILD or DOWNLOAD from `op.isLive()`, and `ProgressVisuals` maps it. No colour in either, + correctly. + + *The terminal state.* Split out. It is not a token — it is instrumentation across three + services with three different starting points, and it kept this item amber for reasons + that had nothing to do with tokens. Its own card on the roadmap: "A finished run leaves no + evidence it happened". + +15. [ ] **Two items moved out of 5061 so it can close** — a follow-up card on the roadmap, joined + to the ticket by an arrow, because "out of scope" and "forgotten" look identical six months + later and only one of them is a decision. + + - **One shared answer to "is the platform there"** (item 10). Its visible face is already a + standalone card: module management treats silence as absence and offers to reinstall what + is installed. The plumbing and the defect are one pass. + - **Dashboard Rebuild, the REST/proot fork** (decision 5). Untouched since before this ADR + existed: an unreadable version silently takes the route that stops the box, and the LIVE + route is presented as if it were STOPPED. It is the sharpest mixing example in the app and + it was named as the first place to apply the model; it is also the only item here that + needs a version resolver rather than the facts. + + Everything else 5061 set out to do is delivered: the facts reader, the pure resolver, both + execution classes dispatching through it, the wizard booleans retired, selection surviving + process death, the UX contract settled, and Kolibri covered on both classes. + 11. [ ] **Small things the second review pass left standing.** None of them is worth a ticket on its own; they belong to whichever ticket next opens these files. diff --git a/controller/docs/operation-model-roadmap.svg b/controller/docs/operation-model-roadmap.svg index ca78442f5..7a42611b7 100644 --- a/controller/docs/operation-model-roadmap.svg +++ b/controller/docs/operation-model-roadmap.svg @@ -1,4 +1,4 @@ - + Operation model — ticket map and progress Which ticket owns what, what blocks what, and how far each has got. Update the class on each item dot as work lands: s-done, s-doing or s-todo. The canvas is deliberately not page-sized — grow it rather than dropping items. @@ -101,7 +101,7 @@ THE SPINE — everything else reads it - + 1 ADFA-5061 · Operation model One declared source of truth for @@ -113,19 +113,22 @@ Both classes dispatch through the model Retire the four *Wizard booleans Wizard selection survives being killed -UX contract tokens -5074 landed the animation and the progress surface; -colour tokens and the finished-card rate are left. -Apply to Kolibri (install vs seeding) -Seeding is the showcase. The app install never reaches -the model — Operation.appInstall has one caller, and it -only picks an animation. -One shared answer to "is the platform there" -Six probes, five answers, three staleness policies. -Dashboard Rebuild: the REST/proot fork -Untouched since before this ADR existed. An unreadable -version silently takes the route that stops the box, and -the LIVE route is presented as if it were STOPPED. +UX contract tokens +Colour is severity, not class — decision 3 amended, not +implemented. The finished-card rate split to its own card. +Apply to Kolibri (install vs seeding) +Both halves reach it: seeding through the dispatcher and +ContentDoor, the install through SystemDoor. The blocker +noted here was removed by that same change. + + +follow up + + +FOLLOW-UP — out of 5061 so it can close, not dropped +One shared answer to "is the platform there" +Its visible face is the module-management card below. +Dashboard Rebuild: the REST/proot fork @@ -133,7 +136,7 @@ SPLIT OUT ADFA-5094 · Kolibri topic display Should not depend on reaching Studio -over the internet. Low priority, real gap. +over the internet. Needs the box first. Task map learns the metadata-only import The box serves the tree it imported @@ -194,8 +197,6 @@ blocks - -needs the box first a SYSTEM op invalidates content state @@ -236,20 +237,36 @@ so the hub inherits what Home established and keeps it when the box goes down. PlatformEvidence still owes observedAtMs and a clear() on the destructive routes; both belong to this pass. Open question for the ticket: what the hub shows when nothing is known. - - - -CARRIED, NOT BLOCKING -Found in the last two days; recorded so they are met on purpose -The Books "downloads" link is the last fragment hosting itself. Needs an index that can be opened with nothing in flight. -No run-level disk budget. Ten places read free space by hand, so there is nowhere to put one. -The three live REST streams can still start together: one provisioner drains asynchronously, so the others see no session yet. -Books reports no transfer rate; the maps card cannot show "adding content" because its progress belongs to the module queue. -Sessions do not survive process death (ADFA-4874), so a download measured in hours has no durable record. + + + + + +NO TICKET YET +A finished run leaves no evidence it happened + +A LIVE run is meant to be left alone, so the user usually arrives after it ended and finds a bare "3 Done". The rate is dropped at completion +by design — rateSuffix is called only from the not-complete branch — and "838 MB · 32 MB/s · 4 min" is the only thing that tells a real +download from a no-op. Split out of the UX-contract item because it is not a token: it is instrumentation, in three services with three +different starting points, and pretending otherwise kept it amber on a card it did not belong to. +Courses can do it today (KolibriSeedState has bytes). ZIM has no clock at all. Books has neither bytes nor speed on its service. The only +start timestamp in main/ is KolibriSeedRepository.startedAtMs, private and unreachable from the row renderer. Also here: the maps card +cannot show "adding content", because its progress belongs to the module queue rather than to a content stream. -Order: 5061 first, 4954 alongside it (done), then 5074 (done), then 5062. 5074 came before 5062 because 5062 migrates the -SetupProgressActivity key switch — work thrown away if the hosting changed after it. -4758 can run whenever and reads better after 5061; do not close it as superseded, it is the one that can lose a user's content. -The canvas is not page-sized on purpose. Grow it when something new belongs here rather than dropping an item to make room. + + + +CARRIED, NOT BLOCKING +Found in the last two days; recorded so they are met on purpose + +The Books "downloads" link is the last fragment hosting itself. Needs an index that can be opened with nothing in flight. +No run-level disk budget. Ten places read free space by hand, so there is nowhere to put one. +The three live REST streams can still start together: one provisioner drains asynchronously, so the others see no session yet. +Sessions do not survive process death (ADFA-4874), so a download measured in hours has no durable record. + +Order: 5061 first, 4954 alongside it (done), then 5074 (done), then 5062. 5074 came before 5062 because 5062 migrates the +SetupProgressActivity key switch — work thrown away if the hosting changed after it. +4758 can run whenever and reads better after 5061; do not close it as superseded, it is the one that can lose a user's content. +The canvas is not page-sized on purpose. Grow it when something new belongs here rather than dropping an item to make room.