fix: use WEBVIEW_READY message instead of setTimeout#398
Merged
breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom Jan 7, 2026
fix/issue-396-webview-readybreaking-brake/cc-wf-studio:fix/issue-396-webview-readyCopy head branch name to clipboard
Merged
fix: use WEBVIEW_READY message instead of setTimeout#398breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom fix/issue-396-webview-readybreaking-brake/cc-wf-studio:fix/issue-396-webview-readyCopy head branch name to clipboard
breaking-brake merged 2 commits intomainbreaking-brake/cc-wf-studio:mainfrom
fix/issue-396-webview-readybreaking-brake/cc-wf-studio:fix/issue-396-webview-readyCopy head branch name to clipboard
Conversation
- Added WEBVIEW_READY message sent after React initialization - Extension Host waits for this message before sending INITIAL_STATE - Fixes #396: blank page when Webview loads slowly
- Added Spinner component for reusable loading indicator - Show spinner while waiting for INITIAL_STATE message 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Merged
braking-brake-semantic-release Bot
pushed a commit
that referenced
this pull request
Jan 7, 2026
## [3.12.9](v3.12.8...v3.12.9) (2026-01-07) ### Bug Fixes * resolve ConfirmDialog z-index issue in SubAgentFlowDialog ([#399](#399)) ([637c2fc](637c2fc)) * use WEBVIEW_READY message instead of setTimeout ([#398](#398)) ([f72f4b2](f72f4b2)) ### Improvements * add resizable width to AI editing panel ([#397](#397)) ([14918d2](14918d2))
|
🎉 This PR is included in version 3.12.9 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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 the Webview loads slowly (taking more than 500ms), the
INITIAL_STATEmessage is sent before the Webview is ready to receive it, resulting in a blank page.Current Behavior
INITIAL_STATEafter a fixed 500ms delayExpected Behavior
INITIAL_STATEis sent only after Webview is fully initializedSolution
Replace the unreliable
setTimeout(500ms)approach with an explicitWEBVIEW_READYmessage pattern, and show a loading spinner while waiting.Changes
File:
src/webview/src/main.tsxvscode.postMessage({ type: 'WEBVIEW_READY' })after React render completesFile:
src/shared/types/messages.tsWEBVIEW_READYmessage type toWebviewMessageunionFile:
src/extension/commands/open-editor.tssetTimeoutwith message handler forWEBVIEW_READYINITIAL_STATEFile:
src/webview/src/components/common/Spinner.tsx(NEW)File:
src/webview/src/App.tsxINITIAL_STATEmessageImpact
Testing
npm run format && npm run lint && npm run check)npm run build)Notes