Model Loading Screen Appears on Every Refresh Instead of Only Initial Load
Description
The application currently displays the model loading screen on every page load or refresh, even after the ASR and punctuation models have already been successfully downloaded and cached locally in the browser.
This behavior results in repeated and unnecessary display of the loading interface, despite the models being available in local storage (e.g., IndexedDB). Consequently, users are prevented from directly accessing the main application interface and experience redundant loading states.
Steps to Reproduce
- Open the application for the first time
- Load the AI models using the provided option
- Refresh the page or revisit the application
- Observe that the loading screen is displayed again
Expected Behavior
-
The model loading screen should appear only during the first-time load
-
Once models are downloaded and cached locally:
- The application should skip the loading screen on subsequent visits
- The main interface (second screen) should be displayed immediately
-
Any required model initialization should occur in the background without blocking the UI
Actual Behavior
- The loading screen is displayed on every refresh or revisit
- No validation is performed to check if models are already available locally
- The UI remains blocked unnecessarily
Impact
- Degraded user experience due to repeated loading screens
- Increased perceived load time for returning users
- Inefficient use of local caching mechanisms
Proposed Solution
- Persist a flag (e.g.,
modelLoaded) inlocalStorageafter successful model load - On application startup, check this flag to determine whether to show the loading screen
- Optionally validate model presence in IndexedDB for robustness
- Render the main UI immediately if models are already available
- Perform model initialization in the background if required
Acceptance Criteria
-
Loading screen is shown only on first-time model download -
After successful model load, a persistent flag ( modelLoaded) is stored -
On page refresh/revisit, app skips loading screen if flag exists -
Main UI (second screen) is rendered immediately for returning users -
Models are not re-downloaded if already cached (IndexedDB) -
Model initialization (if needed) happens in background without blocking UI -
No regression in existing model loading functionality -
Works correctly across browser refresh, tab close, and reopen