fix: show loading view with retry instead of grey screen (#11931)#12263
Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
Draft
fix: show loading view with retry instead of grey screen (#11931)#12263roomote-v0[bot] wants to merge 1 commit intomainfrom
roomote-v0[bot] wants to merge 1 commit intomainfrom
Conversation
…ot hydrated Replace `return null` with a LoadingView component when the webview has not yet received its initial state from the extension host. This prevents users from seeing a blank grey panel (#11931). The LoadingView shows a spinner while waiting, automatically retries the webviewDidLaunch message up to 3 times (every 5 seconds), and displays a manual "Retry Connection" button after all retries are exhausted.
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.
Related GitHub Issue
Closes: #11931
Description
This PR attempts to address Issue #11931 (Grey Screen). Feedback and guidance are welcome.
Root cause: When
didHydrateStateisfalseinApp.tsx, the component returnednull, rendering absolutely nothing -- which appears as a blank grey panel. This can happen when:webviewDidLaunchmessage to be sent before the extension is ready to respondWhat changed: Inspired by the costrict fork (referenced in the issue), which solved this by showing a
LoadingViewinstead ofnull:LoadingViewcomponent (webview-ui/src/components/LoadingView.tsx) -- Shows a spinner with "Initializing..." text instead of a blank grey screen when the webview is waiting for state hydrationwebviewDidLaunchmessage (up to 3 retries)App.tsx--return nullreplaced withreturn <LoadingView />initializing,retry_connection, andconnection_failedkeys toen/common.jsonTest Procedure
webview-ui/src/components/__tests__/LoadingView.spec.tsx(5 tests, all passing)App.spec.tsxtests continue to pass (7 tests)Manual testing steps:
Pre-Submission Checklist
Documentation Updates
Additional Notes
The costrict fork (https://github.com/zgsm-ai/costrict) was referenced in the issue as having fixed this problem. Their approach was to show a branded
LoadingViewwith a spinner. This PR takes the same approach but adds automatic retry logic and a manual retry button for cases where the initial state message is lost entirely.Interactively review PR in Roo Code Cloud