feat: add updates downloading status and progress in UI and replace popups #3089
+416
−83
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.
First time contributor checklist:
Contributor checklist:
clearnet
branchyarn ready
run passes successfully (more about tests here)Description
Feature request: #1356
This PR introduces update indicator in left panel, which displays 3 states:
2024-04-30.05.31.00.mov
While in downloading state, circular component shows how much of file has been downloaded. Its spinning tells the user that app is actively working on update in background.
Additionally there is a tooltip verbally telling user exactly what this button means and what's gonna happen if they press it.
Why I think it's better than popups
While popups are great for capturing user's attention (this is important, since Session updates are also security patches), I think most of the time they just obstruct view and prevent user from doing some important things. Moreover, there is no way to delay update — to trigger update downloading you have to restart app or search in menus. And even if you do agree to update, as mentioned in #1356, you won't notice anything happens. My approach allows user to finish their tasks in conversations and then click download update button whenever they are ready. After that, the same applies to restart. Under the hood, it uses the same implementation with minor changes:
I removed update prompt popup and install prompt popup, but I didn't remove update error popup. Errors are somewhat extraordinary, so I think we can keep this popup.
I used electron-updater's
update-downloaded
anddownload-progress
events to track states and send them to renderer process.I've added appUpdates redux store reducer to store current status of this indicator's UI. Renderer and main processes communicate using ipcRenderer and webContents.send methods.
I've added
close
icon to Icons.tsx which is an X symbol that represents close, stop, delete, cancel actions.I've added 2 translation keys:
updateDownloadProgress
(withprogress
variable — '%' suffix is added automatically),updateDownloadedRestart