feat(desktop): add manual "Check for Updates" button in web settings#1123
feat(desktop): add manual "Check for Updates" button in web settings#1123AriajSarkar wants to merge 19 commits intopingdotgg:mainfrom
Conversation
Add checkForUpdate IPC channel so the web renderer can trigger an update check on demand. Surface a Check for Updates button in Settings > About (desktop only) with contextual labels and error handling. - Add DesktopUpdateCheckResult type and DesktopBridge.checkForUpdate() - Wire UPDATE_CHECK_CHANNEL in preload and main process IPC handler - Add canCheckForUpdate/getCheckForUpdateButtonLabel logic helpers - Add DesktopUpdateCheckSection component in settings About section - Guard IPC handler when updater is not configured (local/dev builds) - Add 15 unit tests for new logic functions Closes pingdotgg#1107
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…check # Conflicts: # apps/web/src/routes/_chat.settings.tsx
…check # Conflicts: # apps/desktop/src/main.ts # apps/web/src/routes/_chat.settings.tsx
2bd1d03 to
4e5586b
Compare
…rmation - Replace generic rocket icon with a downward arrow (`ArrowDownToLineIcon`) in the sidebar for better visual clarity. - Update sidebar icon colors to use a green/blue semantic palette instead of warning colors, and fix CSS class collisions that caused the icon to incorrectly render as white. - Add a confirmation dialog before triggering `installUpdate()` in both the sidebar and settings panel to warn users that the app will restart and tasks will be interrupted. Addresses UX feedback in pingdotgg#1204
…ion/status maps for button label with tooltip from getDesktopUpdateButtonTooltip
There was a problem hiding this comment.
🟠 High
The test expects getDesktopUpdateButtonTooltip to return "Up to date" for "idle" and "up-to-date" statuses, but the actual implementation returns "Update available" as the fallback for any unhandled status. The test will fail for these states.
- return "Update available";
+ return "Up to date";🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/web/src/components/desktopUpdate.logic.test.ts around line 79:
The test expects `getDesktopUpdateButtonTooltip` to return `"Up to date"` for `"idle"` and `"up-to-date"` statuses, but the actual implementation returns `"Update available"` as the fallback for any unhandled status. The test will fail for these states.
Evidence trail:
apps/web/src/components/desktopUpdate.logic.test.ts lines 258-262 (test expectations for "idle" and "up-to-date" statuses expecting "Up to date")
apps/web/src/components/desktopUpdate.logic.ts lines 58-79 (implementation showing default return of "Update available" for unhandled statuses)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| if (!state || state.status !== "error") return false; | ||
| return state.errorContext === "download" || state.errorContext === "install"; | ||
| } | ||
|
|
There was a problem hiding this comment.
Tooltip says "Update available" for up-to-date states
Medium Severity
getDesktopUpdateButtonTooltip has a fallback return of "Update available" that fires for idle and up-to-date statuses. Previously this was fine since the Sidebar only called it when an update was actually available. The new settings page calls it for all non-null states, so users who are up to date will see a misleading "Update available" tooltip. The new test also expects "Up to date" for these statuses, confirming the implementation wasn't updated to match the intended behavior.




What Changed
checkForUpdateIPC channel (DesktopUpdateCheckResulttype,DesktopBridge.checkForUpdate())UPDATE_CHECK_CHANNELin preload + main process handler (reuses existingcheckForUpdates()canCheckForUpdate/getCheckForUpdateButtonLabelpure logic helpersWhy
The desktop app checks for updates automatically and has a native menu "Check for Updates…", but there's no way to trigger a check from the web UI. Users may not discover the menu item. This adds a simple, focused entry point in Settings → About.
Closes #1107 (already closed)
UI Changes
Checklist
Local Test:
v0.0.10->v0.0.11Note
Add manual "Check for Updates" button to desktop web settings
DesktopUpdateCheckSectionto the Settings 'About' page (Electron only) with a button that checks, downloads, or installs updates depending on current state.checkForUpdate()method onwindow.desktopBridgevia a newdesktop:update-checkIPC channel in main.ts and preload.ts.canCheckForUpdatepredicate in desktopUpdate.logic.ts and a React Query definition in desktopUpdateReactQuery.ts to manage and cache update state.RocketIconwithArrowDownToLineIconin the sidebar update button and adds a confirmation dialog before installing an update.📊 Macroscope summarized a146f06. 3 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues
Note
Medium Risk
Adds a new desktop IPC surface and update-triggering flow from the web UI; while scoped, it touches the auto-update state machine/UX and could affect update behavior in packaged vs dev builds.
Overview
Adds a manual "Check for Updates" control to the Electron settings page, showing last-checked time, contextual button labels (check/download/install), and inline error messaging, while keeping the displayed update state live via
onUpdateState+ React Query cache updates.Exposes a new
desktop:update-checkIPC handler andDesktopBridge.checkForUpdate()(with newDesktopUpdateCheckResult) that triggerscheckForUpdates("web-ui")and safely returnschecked: falsewhen the updater isn’t configured.Polishes the existing sidebar update affordance by swapping the icon to
ArrowDownToLineIcon, adjusting status-based coloring, and adding an install confirmation prompt; adds unit coverage for the newcanCheckForUpdatehelper and tooltip behavior.Written by Cursor Bugbot for commit 5d49448. This will update automatically on new commits. Configure here.