-
Notifications
You must be signed in to change notification settings - Fork 6
feat: auto-update notification UI #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
michiosw
wants to merge
8
commits into
main
Choose a base branch
from
feat/auto-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
24e6272
feat: implement auto-update functionality with GitHub releases
michiosw f8ec22c
feat: implement auto-update notification UI
michiosw ebb3b16
fix: address code review feedback for auto-updater
michiosw 31fde64
fix: address additional code review feedback
michiosw 8d4a81f
feat(electron-app): add auto-updater support with enhanced security
michiosw e532686
fix(UpdateNotification): improve error handling and event listener cl…
michiosw f19820a
fix(update): improve type safety for release notes handling
michiosw fdfab37
refactor(update): address code review feedback
michiosw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| provider: github | ||
| owner: co-browser | ||
| repo: vibe | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import { ipcMain, app, BrowserWindow } from "electron"; | ||
| import { getAppUpdater } from "../../services"; | ||
| import { createLogger } from "@vibe/shared-types"; | ||
|
|
||
| const logger = createLogger("IPC:Update"); | ||
|
|
||
| /** | ||
| * Register update-related IPC handlers | ||
| */ | ||
| export function registerUpdateHandlers(): void { | ||
| // Check for updates | ||
| ipcMain.handle("app:check-for-update", async () => { | ||
| try { | ||
| logger.info("Checking for updates"); | ||
| const updater = getAppUpdater(); | ||
| if (!updater) { | ||
| logger.warn("AppUpdater not initialized"); | ||
| return { | ||
| currentVersion: app.getVersion(), | ||
| updateInfo: null, | ||
| }; | ||
| } | ||
| return await updater.checkForUpdates(); | ||
| } catch (error) { | ||
| logger.error("Failed to check for updates:", error); | ||
| throw error; | ||
| } | ||
| }); | ||
|
|
||
| // Show update dialog | ||
| ipcMain.handle("app:show-update-dialog", async _event => { | ||
| try { | ||
| const updater = getAppUpdater(); | ||
| if (!updater) { | ||
| logger.warn("AppUpdater not initialized"); | ||
| return; | ||
| } | ||
|
|
||
| // Get the focused window | ||
| const win = BrowserWindow.getFocusedWindow(); | ||
| if (!win) { | ||
| logger.warn("No window available for update dialog"); | ||
| return; | ||
| } | ||
|
|
||
| return await updater.showUpdateDialog(win); | ||
| } catch (error) { | ||
| logger.error("Failed to show update dialog:", error); | ||
| throw error; | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Forward update events to all windows | ||
| */ | ||
| /** | ||
| * Forward update events from auto-updater to all renderer processes | ||
| * This ensures all windows receive update notifications | ||
| */ | ||
| export function setupUpdateEventForwarding(): void { | ||
| const updater = getAppUpdater(); | ||
| if (!updater) { | ||
| logger.warn("AppUpdater not initialized for event forwarding"); | ||
| return; | ||
| } | ||
|
|
||
| // Forward all update events to renderer processes | ||
| const events = [ | ||
| "checking-for-update", | ||
| "update-available", | ||
| "update-not-available", | ||
| "download-progress", | ||
| "update-downloaded", | ||
| "error", | ||
| ]; | ||
|
|
||
| events.forEach(eventName => { | ||
| updater.autoUpdater.on(eventName as any, (...args: any[]) => { | ||
| logger.debug(`Update event: ${eventName}`, args); | ||
|
|
||
| // Send to all windows | ||
| const windows = BrowserWindow.getAllWindows(); | ||
| windows.forEach(window => { | ||
| if (!window.isDestroyed()) { | ||
| try { | ||
| window.webContents.send(`update-${eventName}`, ...args); | ||
| } catch (error) { | ||
| logger.error(`Failed to send update event to window: ${error}`); | ||
| } | ||
| } | ||
| }); | ||
| }); | ||
| }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.