-
Notifications
You must be signed in to change notification settings - Fork 891
feat(desktop): replace auto-update dialog with in-app toast notification #508
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c1a614b
feat(desktop): replace auto-update dialog with in-app toast notification
Kitenite c4ec825
fix(desktop): improve update toast styling and add dev menu
Kitenite ed768e9
fix(desktop): link See changes to releases page
Kitenite 2b1c66f
refactor(desktop): implement status-based auto-update system
Kitenite 4ae4e5c
fix(desktop): stack update toast text above buttons
Kitenite 86aae87
fix(desktop): disable sonner toast hover animation
Kitenite ee837ae
fix(desktop): scope hover animation fix to update toast only
Kitenite 6c90eac
feat(desktop): add Later button to downloading toast state
Kitenite d66a0ea
fix(desktop): use X button for downloading, Later button for ready
Kitenite 79e3f96
fix(desktop): remove transition from X button hover
Kitenite 3d7341c
fix(desktop): lock update toast position to prevent hover animation
Kitenite a1e818d
refactor(desktop): move RELEASES_URL to shared constants
Kitenite b1cae4a
finish
Kitenite 3ed3eab
remove slop comments
Kitenite 20cdc02
fix lint
Kitenite 1d6bb98
chore: add co-author
Kitenite e316d37
fix(desktop): emit IDLE status when no updates available
Kitenite 9ba59da
fix(desktop): skip quitAndInstall in dev mode
Kitenite 4bfd942
feat(desktop): show error state in update toast
Kitenite 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { observable } from "@trpc/server/observable"; | ||
| import { | ||
| type AutoUpdateStatusEvent, | ||
| autoUpdateEmitter, | ||
| dismissUpdate, | ||
| getUpdateStatus, | ||
| installUpdate, | ||
| simulateDownloading, | ||
| simulateError, | ||
| simulateUpdateReady, | ||
| } from "main/lib/auto-updater"; | ||
| import { publicProcedure, router } from "../.."; | ||
|
|
||
| export const createAutoUpdateRouter = () => { | ||
| return router({ | ||
| subscribe: publicProcedure.subscription(() => { | ||
| return observable<AutoUpdateStatusEvent>((emit) => { | ||
| emit.next(getUpdateStatus()); | ||
|
|
||
| const onStatusChanged = (event: AutoUpdateStatusEvent) => { | ||
| emit.next(event); | ||
| }; | ||
|
|
||
| autoUpdateEmitter.on("status-changed", onStatusChanged); | ||
|
|
||
| return () => { | ||
| autoUpdateEmitter.off("status-changed", onStatusChanged); | ||
| }; | ||
| }); | ||
| }), | ||
|
|
||
| getStatus: publicProcedure.query(() => { | ||
| return getUpdateStatus(); | ||
| }), | ||
|
|
||
| install: publicProcedure.mutation(() => { | ||
| installUpdate(); | ||
| }), | ||
|
|
||
| dismiss: publicProcedure.mutation(() => { | ||
| dismissUpdate(); | ||
| }), | ||
|
|
||
| simulateReady: publicProcedure.mutation(() => { | ||
| simulateUpdateReady(); | ||
| }), | ||
|
|
||
| simulateDownloading: publicProcedure.mutation(() => { | ||
| simulateDownloading(); | ||
| }), | ||
|
|
||
| simulateError: publicProcedure.mutation(() => { | ||
| simulateError(); | ||
| }), | ||
| }); | ||
| }; |
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider version-specific dismissal tracking.
The
isDismissedboolean flag applies to any READY status, regardless of version. If a user dismisses update v1.0.0 and a newer v1.1.0 is downloaded before the next automatic check (4-hour interval), the notification for the newer version will be suppressed.While unlikely in production (updates rarely release within a 4-hour window), tracking dismissed versions in a
Set<string>would be more robust and ensure users are notified about each distinct version.🔎 Proposed refactor to track dismissed versions
Then remove the
isDismissed = falsereset lines from checkForUpdates (line 59), checkForUpdatesInteractive (line 85), and simulation functions (lines 117, 123).