fix: preserve model download progress across settings navigation#664
Open
xAlcahest wants to merge 1 commit intoOpenWhispr:mainfrom
Open
fix: preserve model download progress across settings navigation#664xAlcahest wants to merge 1 commit intoOpenWhispr:mainfrom
xAlcahest wants to merge 1 commit intoOpenWhispr:mainfrom
Conversation
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.
Summary
The download progress bar disappeared when switching between Speech-to-Text and Language Models tabs, or when navigating away from the AI Models section entirely. The download kept running in the main process but the UI lost track of it because all progress state was local to the component and the IPC listeners were torn down on unmount.
Two fixes, layered: tab containers now hide inactive content with
display: noneinstead of unmounting it, and the IPC listeners for download progress are registered once at module level with a persistent cache that the hook reads from on mount.Fixes #648
Changes
src/components/SettingsPage.tsx--SpeechToTextTabsandLlmsTabstoggle visibility instead of conditional rendering, so tab content stays mountedsrc/hooks/useModelDownload.ts-- moved IPC listener registration from per-componentuseEffectto a module-level singleton that writes to a persistent cache keyed by model type; the hook restores state from the cache on mount and registers a callback for live updates while mounted;downloadModelandcancelDownloadalso write to the cache so it stays in sync