Settings → Updates: scoped Reset + visible upgrade CTA + change diff link¶
Motivation¶
Three papercuts reported from the Settings panel:
- Reset looked broken. The footer
Resetbutton clears the browser-local preferences (localStorage["elb-prefs"]: theme, preview flags, telemetry / connection string). It worked, but it was shown on every section except Preview (showFooterActions = active !== "preview") — i.e. it appeared on Resources / Updates / AKS / … where there is nothing prefs-backed to reset (so it read as "the button does nothing"), and was hidden on the Preview section where it is most relevant. - No visible "update" button. Settings → Updates only rendered the
"Manage upgrade → Open" link when the persisted state row already had a
git_remote, and the actual start control lives on the separate/upgradepage. A new commit could be surfaced with no obvious way to act on it. - No way to see what changed. Neither surface showed which commits an update would bring in.
User-facing change¶
- Reset is now scoped to the sections it affects. The footer
Resetbutton appears only on Appearance, Preview, and Telemetry (theusePreferences/useTheme-backed sections). On the other sections it is hidden instead of appearing inert. Behaviour of the button itself is unchanged (still gated by the existing confirm dialog). - The self-upgrade link is always visible in Settings → Updates. When an
update is available (a newer release tag, or a new commit when the preview
channel is on) the row becomes a primary "Update now" call-to-action with
an up-arrow icon; otherwise it is the neutral "Manage upgrade → Open"
link. Both navigate to
/upgrade. - "What's new" / "View changes" link. When an update is available and the
remote is a GitHub repo, Settings → Updates shows a View changes link and
the
/upgrade"Start an upgrade" section shows View changes on GitHub — both open the GitHubcompare/<running>...<latest>view so the operator can read the exact commit range.
API / IaC diff summary¶
- No backend or IaC change. Reuses the existing
upgradeApityped client and the build-time__APP_COMMIT__stamp. - Frontend only:
web/src/api/upgrade.ts— new pure helpersgithubRepoBaseUrl()andgithubCompareUrl()(normalise a GitHub HTTPS/SSH.gitremote, strip credentials, and build the compare URL; returnnullfor non-GitHub or an empty/equal range).web/src/api/upgrade.test.ts— new unit tests for the helpers (13 cases).web/src/components/SettingsPanel.tsx—PREF_BACKED_SECTIONSgate for the footer Reset; "What's new" row; always-visible "Update now / Manage upgrade" row.web/src/pages/UpgradePage.tsx— "View changes on GitHub" link in the Start section.
Validation evidence¶
npx vitest run src/api/upgrade.test.ts— 13/13 passing.npx vitest run(full web suite) — 75 files / 695 tests passing.npx eslinton the four touched files — clean.npm run build— succeeds.- Diff audit: only the four intended
web/files are dirty.