Skip to content

Track the Update download in main and show it on the Dock/taskbar icon (#394) - #397

Merged
jtklein-agents merged 1 commit into
spec/393-update-download-progressfrom
394-track-the-update-download-in-main-and-show-it-on-the-dock-taskbar-icon
Nov 27, 2026
Merged

jtklein-agents merged 1 commit into
spec/393-update-download-progressfrom
394-track-the-update-download-in-main-and-show-it-on-the-dock-taskbar-icon

Conversation

@jtklein-agents

Copy link
Copy Markdown
Owner

Closes #394. Part of #393.

Summary

Main holds one UpdateDownload state (exported from src/common/rendererBridge.ts) and mirrors it on the main window's Dock/taskbar bar.

 Found Updates → Yes
+  state = connecting                bar 2 (skipped on Linux)
+  log "Update download started."
   downloadUpdate()
+    .catch(ignore)                  'error' listener reports it
+on download-progress
+  state = downloading | restarted   bar percent / 100   (restarted when percent drops; sticky)
 on update-downloaded
+  state = done                      bar -1
   Install Updates dialog (unchanged)
 on error
+  if state != idle: state = idle    bar -1
   error box (unchanged)
 src/main/index.ts
-  listenForUpdates( autoUpdater, dialog )
+  listenForUpdates( autoUpdater, dialog, () => mainWindow )
   createMainWindow
     mainWindow = win
+    applyUpdateDownloadBar( win )   # a reopened macOS window gets the bar back

Tests replaced (per CODING_STANDARDS.md overlapping tests):

  • "Yes downloads the update with no window, bar, or percent" → "Yes downloads the update and shows its progress on the icon"
  • "a finished download quits to install" → "a finished download clears the bar and quits to install"

The source scan "the shell opens no update progress window" drops its download-progress ban and keeps its electron-progressbar absence checks (ProgressBar is now matched as a whole word so setProgressBar passes).

Evidence

  • Before: emit('download-progress', 40%) → no bar call, no state.
    After: vitest run src/main/updates.test.ts → 13 passed, including:
Yes (darwin)         → bar 2, state connecting
progress 40          → bar 0.4, state downloading 40
progress 60, then 5  → state restarted 5; then 80 → restarted 80
Linux                → bar calls [[0.1]] only (no 2)
error mid-download   → [bar -1, error box], state idle
downloaded           → bar -1, state done
logs                 → [Update available., Update download started., Update downloaded]
rejected download    → no unhandledRejection
getter → null        → no throw, state advances
new window           → applyUpdateDownloadBar sets 0.7

Full suite: 71 files, 493 tests pass; lint and typecheck clean. Not run in the packaged app, so the Dock/taskbar bar is unseen on real hardware.

Merge Danger

Door: two-way

Blast Radius: updater

Only the Update download path changes; the dialogs, autoDownload, quitAndInstall and window close behaviour are untouched. Worst case is a wrong or stuck icon bar during an update.

🤖 Generated with Claude Code

#394)

Main holds an UpdateDownload state (idle, connecting, downloading,
restarted, done) and mirrors it on the window's progress bar. A reopened
main window gets the held bar back. downloadUpdate's rejection is
swallowed; the error listener reports it.

Replaces the tests "Yes downloads the update with no window, bar, or
percent" and "a finished download quits to install"; the source scan
drops its download-progress ban.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtklein-agents
jtklein-agents merged commit 5656c82 into spec/393-update-download-progress Nov 27, 2026
8 checks passed
@jtklein-agents
jtklein-agents deleted the 394-track-the-update-download-in-main-and-show-it-on-the-dock-taskbar-icon branch November 27, 2026 09:58
jtklein-agents added a commit that referenced this pull request Nov 27, 2026
AntonelliLab#528)

* Track the Update download in main and show it on the Dock/taskbar icon (#394) (#397)

Main holds an UpdateDownload state (idle, connecting, downloading,
restarted, done) and mirrors it on the window's progress bar. A reopened
main window gets the held bar back. downloadUpdate's rejection is
swallowed; the error listener reports it.

Replaces the tests "Yes downloads the update with no window, bar, or
percent" and "a finished download quits to install"; the source scan
drops its download-progress ban.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Show the Downloading update dialog from live progress events (#395) (#398)

Main sends each Update download state to the window's page on
UPDATE_DOWNLOAD. The page subscribes through rendererBridge.onUpdateDownload,
the store keeps the latest state, and UpdateDownloadDialog follows it
until the state returns to idle.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* Bring the Downloading update dialog back after a page reload or reopened window (#396) (#399)

A reloaded page or a window reopened from the Dock mid-download now
shows the dialog at once. rendererBridge.getUpdateDownload() invokes
GET_UPDATE_DOWNLOAD, which main answers from the held UpdateDownload
state; the run list seeds updateDownload from it next to the
onUpdateDownload subscription.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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