Skip to content

feat(desktop): name the versions in the update dialogs - #323

Merged
quickbeard merged 1 commit into
mainfrom
updater-version-dialog
Aug 25, 2026
Merged

quickbeard merged 1 commit into
mainfrom
updater-version-dialog

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

Issue for this PR

Closes #

Type of change

  • New feature

What does this PR do?

Check for Updates... now names the versions. The menu item is asked precisely to answer "what am I on, and what would I move to", and every dialog left the first half out — You're up to date. with nothing to check it against, and a restart prompt naming the downloaded version but not the one it was replacing.

Every branch now carries a detail line with app.getVersion():

State Dialog
Up to date You're up to date. — CoDev 1.4.2 is the latest version.
Ready CoDev 1.5.0 downloaded. Restart now? — You're on 1.4.2. → Restart / Later
Available CoDev 1.5.0 is available. — You're on 1.4.2. Download it now? → Download / Later
Error Update check failed. — You're on CoDev 1.4.2.

Two things beyond the literal ask, both flagged for your call:

  • The available state gained a dialog. That is where a check stops once automatic downloading is off, and it fell through the status !== "ready" guard — so the menu item closed showing nothing at all. Leaving it silent would have contradicted the point of the change, since it is exactly the case where a new version exists to name. Its Download button calls controller.download() fire-and-forget; the renderer already surfaces the progress and the restart prompt.
  • The error dialog names the running version too. One string, and it is what you want in hand when a check fails.

Localization. These dialogs are built in the main process, so they were the last strings in the app no locale could reach. They now come from the app dictionaries via main/i18n.ts — the module the macOS menu bar already used, so menu-i18n.ts / menu-locale.ts are renamed i18n.ts / locale.ts now that they serve more than the menu. The translator gained placeholder interpolation through @solid-primitives/i18n's resolveTemplate (already a desktop dependency, and the same resolver the renderer uses). 15 updater.dialog.* keys in en/es/vi.

DIVERGENCES.md gets a row for the dialogs and the localized-menu row is updated for the renames; CHANGELOG.md gets an entry under Updates.

How did you verify your code works?

  • New packages/app/src/i18n/placeholders.test.ts asserts es and vi interpolate the same {{values}} as en — a dropped {{version}} renders as silence, not an error. Confirmed it fails by removing one; the repo has zero pre-existing drift.
  • Checked the translator against the real dictionaries in a scratch script: updater.dialog.ready.message with {version: "1.2.3"} renders Đã tải xuống CoDev 1.2.3. Khởi động lại ngay?, and a missing key returns undefined, which is what the ?? key fallback is for.
  • Cross-checked every dialog's placeholder against the params updater.ts passes ({{version}} vs {{current}}).
  • bun typecheck clean in both packages; bun test green (708 app, 159 desktop).
  • electron-vite build clean, dictionaries still code-split out of the main entry.

Not verified by driving the real dialogs: they need a live update feed with a newer release than the running build, which I cannot manufacture here. The dialog wiring itself is unchanged — same showMessageBox calls, same button indices, same install()/download() calls — only the strings and the added available branch are new.

Screenshots / recordings

None — see the note above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

"Check for Updates..." is asked precisely to answer "what am I on, and
what would I move to", and every dialog left the first half out: "You're
up to date." with nothing to check it against, and a restart prompt that
named the downloaded version but not the one it replaced.

Every branch now carries a detail line with app.getVersion(); the ready
dialog names both versions. The available state — where a check stops
once automatic downloading is off — gains a dialog of its own, having
previously fallen through the status !== "ready" guard so the menu item
closed showing nothing at all.

All the strings move into the app dictionaries and resolve through
main/i18n.ts, which the macOS menu bar already used: menu-i18n.ts and
menu-locale.ts are renamed i18n.ts and locale.ts now that they serve
more than the menu, and the translator gained placeholder interpolation
(@solid-primitives/i18n's resolveTemplate, already a desktop dep).

A new placeholders test asserts es and vi interpolate the same values as
en, since a dropped {{version}} renders as silence rather than an error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit b7dc90e into main Aug 25, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the updater-version-dialog branch August 25, 2026 03:47
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