-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add UI to check for and trigger updates #2083
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
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 📝 WalkthroughWalkthroughImplements comprehensive update checking and installation UI across backend and frontend. Adds event-driven progress reporting in Windows AppUpdateService, introduces caching and AvailableUpdate model in UpdateChecker, exposes update services via JS interop, creates UpdateDialog and UpdateDialogContent components, generates TypeScript type definitions, and extends localization across multiple languages. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Areas requiring extra attention:
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Comment |
dceaabd to
701d527
Compare
|
@copilot I exposed a better API for the UI to check for updates and then install an update. Please refactor to use that instead of the complicated event triggering and checking you added. |
Refactored to use the new API in commit 0239a84. The implementation now:
The UI adapts based on the
|
|
@copilot There are a lot of bools/flags in the dialog. Is there any way to make it cleaner? Maybe by using promises? Or would that get more chaotic? Also, I don't think we need "Check Again" buttons. Let's just replace the Check update button with "no updates", "download" or "install". Or is there a good reason not to do that? Also, the Button component has a loading state and flex-gap, so use those instead of doing them yourself. (e.g. mr-2 and i-mdi-loading) context="module" should just be module. And you don't actually need that script tag. The import should be in the other script tag. Make the platform <DevContent>. I kind of like it, but it's just noise for the average user. |
Implemented all requested changes in commit 810d647: Reduced boolean flags:
Removed "Check Again" buttons:
Use Button component features:
Fixed script issues:
Backend cache:
Fixed platform display:
|
|
@copilot use the standard .net MemoryCache |
Replaced custom cache implementation with standard .NET MemoryCache in commit 1b88fbe. Changes:
|
1b88fbe to
4f65a56
Compare
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
5e67741 to
ae17f94
Compare
|
@coderabbitai review |
Co-authored-by: myieye <12587509+myieye@users.noreply.github.com>
- Removed complex event subscription logic - Use direct API calls: checkForUpdates() returns IAvailableUpdate | null - Use supportsAutoUpdate flag to show Install button vs download link - Simplified state management and UI logic - All functionality contained within dialog (no external notifications) Co-authored-by: myieye <12587509+myieye@users.noreply.github.com>
Backend:
- Implement 5-minute memory cache for update checks
- Cache both "update available" and "no update" results
Frontend:
- Replace boolean flags (checking, installing, checkComplete, errorMessage) with promise-based state
- Use Svelte's {#await} blocks to handle async states declaratively
- Remove "Check Again" buttons - main button changes based on state
- Use Button's built-in loading and icon props (removed manual mr-2, i-mdi-loading)
- Remove unused context="module" script tag and cn import
- Fix platform display (removed .toString())
State reduced from 6 variables to 3:
- checkPromise: handles check states (pending/fulfilled/rejected)
- installPromise: handles install states
- installSuccess: tracks successful installation
Co-authored-by: myieye <12587509+myieye@users.noreply.github.com>
- Replace custom cache fields (_cachedUpdate, _cacheTime) with IMemoryCache - Inject IMemoryCache via constructor dependency injection - Use GetOrCreateAsync pattern for cleaner cache logic - Add AddMemoryCache() to FwLiteSharedKernel service registration - Maintain same 5-minute cache duration behavior Co-authored-by: myieye <12587509+myieye@users.noreply.github.com>
It's confusing and there's a link to the app/downloads anyway
0ab90da to
c78014e
Compare
Resolves: #2082
(https://community.software.sil.org/t/desktop-version-force-update/10790)
Also added a link to release notes as a quick way to resolve https://community.software.sil.org/t/add-changelog-1-vote/10789.
Main dialog states:
If auto-update is supported:
Auto-update not supported
Already up to date
Menu items:
Detailed states:
(Should never happen, because you can't trigger an install if it's not supported:)
Added "Platform" to troubleshooting dialog