Skip to content

feat(updater): badge acknowledges a check and drives the real auto-update - #326

Closed
chaitanyagiri wants to merge 2 commits into
mainfrom
feat/updater-check-acknowledgement
Closed

chaitanyagiri wants to merge 2 commits into
mainfrom
feat/updater-check-acknowledgement

Conversation

@chaitanyagiri

@chaitanyagiri chaitanyagiri commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

One coherent badge behaviour for 0.4.6, two parts:

1. A successful check is now visible (the acknowledgement)

On the latest release a manual check succeeded, found nothing, and settled silently to a grey latest chip. A working check and a dead click were indistinguishable, so the button read as broken. Now, after a manual no-update check, the badge flashes a positive popover ("You are on the latest version. vX is the newest release. Checked just now.") that auto-dismisses. It fires only for the manual no-update result (read back from the settled status), not for background 6h checks, and is role="status" aria-live="polite".

2. The badge does the real auto-update (Option B)

The badge only ever offered a manual download (a DMG + a drag-to-Applications card), never the native download/restart the Settings pane runs. So when 0.4.6 lands, clicking the badge would hand the user a DMG and they would rightly say auto-update still does not work. Now, when the native updater has staged an update, the badge drives the same path Settings does:

  • available → action download ("vX · update"): kick the native download.
  • downloaded → action restart ("vX · restart"): quit and install.
  • available-manual → action manual ("vX · download"): the notify-only fallback ONLY, where the native updater could not fetch it. The drag-to-Applications hover card now shows only in this case.

This is the last code change before the 0.4.6 freeze, and it is the behaviour the rc rehearsal exists to exercise; rehearsing without it would test the old badge, a build that never ships.

Tested vs rc-only (the reporting standard)

  • Verified now, without a real release: describeUpdate's mapping for every state (unit tests, all 17 green: available→download, downloaded→restart, available-manual→manual), the badge's click-wiring, the acknowledgement (2 tests green), and typecheck:web clean. In dev these states can also be driven visually through the existing update:simulate handler.
  • Only a real signed release can exercise (the rc, 0.4.6-rc.1 → 0.4.7-rc.1): downloadUpdate, quitAndInstall, and the Squirrel install itself, i.e. that clicking restart actually installs and relaunches. The unit tests prove the badge asks for the right action in each state; they cannot prove the native install, because 0.4.5 is the latest release and no update exists to drive it. Do not read the green here as covering the install path.

Scope

src/shared/updateState.ts, src/renderer/src/components/UpdateBadge.tsx, and test/update-state.test.cjs. Part of the frozen 0.4.6 set (#322, #324, #325, #326). The error-state download link and the menu item were cut to 0.5.0. Founder's merge.

The founder's actual complaint: he clicks the version badge and nothing
happens. It is working. On the latest release a manual check succeeds,
finds no update, and the badge settles back to a quiet grey "latest"
chip with no toast, no motion, no confirmation. A check that worked
perfectly and a click that never registered are indistinguishable, so a
working button reads as broken.

The through-line across this whole bug was silence on success. This
makes success speak: after a MANUAL check that finds no update, the badge
flashes a brief positive acknowledgement ("You are on the latest
version. vX is the newest release. Checked just now.") that auto-dismisses
after a few seconds. It fires only for the manual no-update result, read
back from the settled status; an available update is already loud on its
own (the chip changes), and background 6h checks stay silent as before.

Deliberately narrow: it does not touch the available/download/restart
paths, which cannot be exercised until there is a real update to find
(the 0.4.6-rc). Make success visible first, let the rc show the rest.

Source-string tests pin the wiring (no jsdom harness in this repo);
typecheck:web clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014dMe8Mm2eas1SwvUiu3XXr
@github-actions

Copy link
Copy Markdown
Contributor

🚫 This PR is missing its before/after evidence

Every pull request here has to show its work. Screenshots or a short screen recording, before the change and after it.

  • Before — no image or video under that heading
  • After — no image or video under that heading

How to fix it: edit the description, keep the ### Before and ### After headings from the template, and drag an image or video under each. GitHub uploads it inline. This check re-runs the moment you save.

A bug fix with no visible surface still needs it: show the failing behaviour, then the same steps passing. A terminal recording is fine.

Genuinely nothing to show — a CI tweak, a typo, a dependency bump? A maintainer can apply the no-visual-change label. Please don't ask unless it truly has no observable effect.

📖 CONTRIBUTING.md → Evidence is mandatory

… download (Option B)

The founder's actual complaint was that clicking the badge "does not
update" — because the badge only ever offered a manual download (a DMG
and a drag-to-Applications card), never the native download/restart the
Settings pane runs. When 0.4.6 lands he would click, get a DMG, and
rightly say auto-update still does not work.

Now, when the native updater has staged an update, the badge drives the
same path Settings does:
- `available`  -> action `download` ("vX · update"), kick the native download
- `downloaded` -> action `restart`  ("vX · restart"), quit and install
Manual download is demoted to the notify-only fallback only
(`available-manual`, where the native updater could not fetch it); the
hover card with drag-to-Applications steps now shows only in that case.
The success acknowledgement from this branch is unchanged.

This is the LAST code change before the 0.4.6 freeze, and it is the thing
the rc rehearsal is meant to exercise: rehearsing without it would test
the old badge behaviour, a build that never ships.

update-state tests updated (available -> download, downloaded -> restart);
all 17 green, badge acknowledgement tests green, typecheck:web clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014dMe8Mm2eas1SwvUiu3XXr
@chaitanyagiri chaitanyagiri changed the title feat(updater): acknowledge a successful check on the badge feat(updater): badge acknowledges a check and drives the real auto-update Aug 25, 2026
chaitanyagiri added a commit that referenced this pull request Aug 26, 2026
The section matcher ended `(?=\n#{1,6}\s|$)` under the 'm' flag. With 'm', `$`
matches at the end of EVERY line, and the capture group is lazy, so it stopped
at the blank line our own PR template puts after each heading. The captured
section body was therefore always the empty string, hasEvidence('') was always
false, and every PR failed with "Missing evidence: before and after" no matter
what was attached.

Confirmed red on #333, #329, #327 and #326 before this change. The check only
ever passed by accident, when evidence sat on the line immediately after the
heading with no blank line, and even then it saw only that one line.

Replace the multiline `$` with an absolute end-of-input assertion. The tests
read the regex out of the workflow file rather than restating it, so bringing
the multiline anchor back fails here instead of on a contributor's PR. Verified
by mutation: 4 of the 6 fail against the old regex.

This does NOT unblock #333 on its own. Its evidence is a console transcript and
EVIDENCE only matches an image or video, which the last test records so that
changing that policy has to be deliberate.
@chaitanyagiri

Copy link
Copy Markdown
Collaborator Author

Shipped in v0.4.6 as 1ca01b09 and 2096c1d3. The badge acknowledges a check and drives the real auto-update rather than a manual download. This is the change the release notes lead on with "updates install themselves". Closing.

pull Bot pushed a commit to codingwatching/munder-difflin that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant