Repository navigation
Settings, System: one update state, derived in one place, that follows the updater - #318
Merged
Merged
Conversation
…s the updater The Version card showed contradictory states at once: "Checking v0.8.39" for a release whose change set was already prepared, "v0.8.37 needs your OK" for an older update the newer one had replaced, and "Review and apply" for a change set someone had already executed in the AWS console. lib/update-state.ts now maps the version route (and the preflight, for install checks that stop an update) to exactly one state: applying, preparing, waiting for your OK, checking the release, a check that stalled, a refused model, the last try that failed, the updater or an install check in the way, an update available, or the quiet states. The card renders only that state. - CloudFormation's execution status beats the stored status: a change set that is executing or executed is "Applying", never "Review and apply", and one applied in the AWS console says so. - With an older updater's payload, the newest prepared update wins over an older one left as pending. - A release check pending for more than 30 minutes reads as stalled, with its reason and Check again, never as "Checking" forever. - The page polls while something is happening (checking and preparing every 10 s, applying every 15 s, waiting for an OK every 30 s), so it moves from preparing to the OK to applying to done without a reload. - Each update shows its three steps (check the release, prepare the change, apply it) and where it is, instead of a made-up percentage. - History lists a replaced update as "Replaced". - Uninstall is one card: the data choice is a row, not a box with an undefined border token (it drew in the text colour), and the button reads "Open the uninstall guide", with an external-link icon and a note that nothing is deleted from here. Tests: update-state-derive.spec.ts feeds the derivation the observed payloads; update-states.spec.ts renders them, the poll transitions, the stalled check and the Uninstall card in dark mode.
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
The Version card showed contradictory states at the same time. On a live install running v0.8.32:
Now one function picks exactly one state, and the card renders only that state. The updater half is in the platform PR.
Research: how mature self-update UIs present this
From these, the page follows these principles:
Changes
src/lib/update-state.tsmaps the version route (and the preflight, for install checks that stop an update) to one state. The states are:border-borderandtext-text-secondary. Neither token exists, so the border was drawn in the text colour, which shows as a white outline in dark mode. The choice is now a row of the card, separated by the card's own dividers. The button reads Open the uninstall guide, with an external-link icon and the note "Opens the guide in a new tab. Nothing is deleted from here." Typing the install's name is still required to turn on "Delete everything".Verification
npm run lint,npm run typecheck,npm run check:openapiandnpm run buildall pass.e2e/update-state-derive.spec.ts, new, runs without a browser. It feeds the derivation the observed payloads:e2e/update-states.spec.ts, extended, renders:update-statesandupdate-state-derive: 41 passedselfhost,models-switch,hybrid,settings-pages,no-sideways-scrollandreadable-text: passed, except one models-switch test whose fixture had a check pending since October. That fixture now starts the check "just now" and the test passes.E2E_SHOTS_DIR.