Skip to content

Show update download progress in a dialog and on the Dock/taskbar icon - #528

Merged
jtklein merged 3 commits into
AntonelliLab:masterfrom
jtklein-agents:spec/393-update-download-progress
Nov 27, 2026
Merged

jtklein merged 3 commits into
AntonelliLab:masterfrom
jtklein-agents:spec/393-update-download-progress

Conversation

@jtklein-agents

Copy link
Copy Markdown
Contributor

Summary

After the user clicks Yes in Found Updates, the app used to show nothing until Install Updates appeared, which could take minutes. Now the main page shows a modal Downloading update dialog for the whole Update download, and the Dock/taskbar icon shows the same progress. The old progress window (electron-progressbar) needed Node in its window. This version keeps nodeIntegration off, context isolation on and sandbox on.

sequenceDiagram
    participant Updater as electron-updater
    participant Main as updates.ts (main)
    participant Page as RunList store
    participant Dialog as UpdateDownloadDialog
    Updater->>Main: download-progress / update-downloaded / error
    Main->>Main: hold UpdateDownload, setProgressBar on window
    Main->>Page: onUpdateDownload(state)
    Page->>Main: getUpdateDownload() on start (reload / reopened window)
    Page->>Dialog: updateDownload
    Note over Dialog: open while status ≠ idle
Loading
 Found Updates → Yes
+  state = connecting                  icon bar indeterminate (skipped on Linux)
   downloadUpdate()
+on download-progress
+  state = downloading | restarted     icon bar percent / 100   (restarted = differential fell back to full)
 on update-downloaded
+  state = done                        icon bar cleared
   Install Updates dialog (unchanged)
 on error
+  state = idle → dialog closes        icon bar cleared
   error box (unchanged)
State Bar Percent text Status line
connecting indeterminate Starting… Connecting to the update server…
downloading <100 determinate 42% RAxML-GUI will quit and install when the download finishes.
restarted <100 determinate 10% Retrying with the full download…
100 or done 100 100% Download complete. Preparing to install…

The dialog has no close button and no onClose, so Escape and backdrop clicks do nothing. That keeps the user from starting a run that would die when the app quits to install.

Plumbing: two new channels in src/constants/ipc.ts, onUpdateDownload / getUpdateDownload on RendererBridge with preload proofs, and listenForUpdates(autoUpdater, dialog, () => mainWindow).

Evidence

  • Before: emit('download-progress', 40%) → no icon bar call, no page event, no dialog.
    After: this branch merged onto current master (34050d8): yarn test 72 files, 497 tests pass (this includes the Electron preload launch), plus yarn lint and yarn typecheck. Main tests:
updates.test.ts
  Yes (darwin)          → bar 2, sends connecting
  progress 42, then 10  → sends downloading 42, restarted 10 (sticky)
  Linux                 → no indeterminate bar call
  error mid-download    → send idle, bar -1, error box (in that order)
  update-downloaded     → bar -1, sends done
  new window            → gets the held bar value back
updateDownload.test.tsx
  push each state       → title "Downloading update", percent, status line, no button
  Escape + backdrop     → still open
  push idle             → dialog gone
  page starts with getUpdateDownload → downloading 37 → dialog shows 37%

Not checked: a real update in a packaged build. Nobody has seen the dialog or the Dock/taskbar bar on real hardware.

Merge Danger

Door: two-way

The PR adds channels, bridge methods and a dialog. Nothing is removed or renamed, so a revert restores the old silent download.

Blast Radius: updater

  • This only shows during an Update download. If the state ever got stuck at a value other than idle, the dialog could not be dismissed until the app quits. update-downloaded and error both move the state on.
  • The new preload methods ship to every page. Older pages never call them.

🤖 Generated with Claude Code

jtklein-agents and others added 3 commits November 27, 2026 10:58
#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>
…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>
…ned 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>
@jtklein
jtklein merged commit 2dbadc8 into AntonelliLab:master Nov 27, 2026
10 checks passed
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.

2 participants