feat(updater): add update-now action to update-available toast - #742
Open
Raymond8196 wants to merge 1 commit into
Open
feat(updater): add update-now action to update-available toast#742Raymond8196 wants to merge 1 commit into
Raymond8196 wants to merge 1 commit into
Conversation
The update-available toast only notified users that a new version existed, with no way to act on it. Add a primary action button that launches the existing install flow (download -> confirm modal -> restart), reusing the same entry point as the sidebar update button so both paths stay consistent. Pre-commit hook ran. Total eslint: 0, total circular: 0
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
When users click "Check for updates" in Settings and a new version is available, the bottom-right toast only informs them that a new version exists ("Version X is ready to install.") with no way to act on it. Users must then hunt for the update entry point elsewhere (the sidebar update button), which is not discoverable — the toast that announced the update offers no path forward.
Solution
Add a primary
actionbutton ("Update now") to the update-available toast innotifyCheckSuccess(src/scaffold/AppUpdater/index.tsx). Clicking it calls the already-exportedinstallAvailableAppUpdate()— the same entry point the sidebar update button uses (SidebarUpdateButton.tsx), so both paths stay consistent.The button reuses the existing, Windows-aware install flow: download (with progress toast) → "Install and restart" confirmation modal → install + relaunch. The two-step download/confirm split is intentional (installing can terminate the app on Windows), so this change introduces no new platform behavior.
The
Messagecomponent already supported anactionfield (used elsewhere); this change simply populates it.Potential risks
@tauri-apps/plugin-updater, unchanged by this PR.closeOnClick: true(Message component default), so clicking it dismisses the toast and immediately starts the download — identical to the sidebar button but with an added auto-dismiss of the announcing toast. This is the intended UX.Verification
npx eslint src/scaffold/AppUpdater/index.tsx src/scaffold/AppUpdater/index.test.ts→ exit 0.pnpm vitest run src/scaffold/AppUpdater/index.test.ts:offers an update-now action on the available-update notice→ passes (asserts the toast carriesaction: { label: "Update now" }with a functiononClick).developbaseline (confirmed viagit stash+ baseline rerun): root cause is a test-infrastructure defect whereindex.test.tsstubs a partialwindow.localStoragethat poisons later tests'clearSkippedUpdateVersioncalls. This PR does not touch that path and the failure count is identical with/without these changes. Fixing the test infrastructure is a separate concern.