Repository navigation
Description
Problem (one or two sentences)
The Zoo Code view can stay blank after VS Code starts. The provider misses the webviewDidLaunch message, so it never sends state to the webview.
Context (who is affected and when)
This affects users who keep the Zoo Code view open when they close VS Code. At the next start, the view is visible, and VS Code resolves it during extension activation (onView:zoo-code.SidebarProvider). The same problem occurs after "Developer: Reload Window" while the view is open. If the user opens the view after startup is complete, the view loads correctly.
Reproduction steps
- Open the Zoo Code view. The sidebar and the secondary sidebar both show the problem.
- Keep the view open and close VS Code. As an alternative, run "Developer: Reload Window".
- Start VS Code.
- Look at the Zoo Code view.
Expected result
The view shows the welcome screen or the current task.
Actual result
The view stays blank. The output channel shows no error, and the watchdog does not start a recovery.
Variations tried (optional)
- "Zoo Code: Retry Interface Recovery" restores the view. The problem occurs again at the next start.
- If a different view in the same container is active when VS Code closes, the problem does not occur.
- Version 3.98.1 has the same code path.
App Version
3.98.2. Current main (ca43e69) has the same code. VS Code 1.148.0, Linux x64.
Relevant logs or errors (optional)
initializeWebviewView() assigns webview.html. Then it waits for getState(). Only after that does it call setWebviewMessageListener(). The webview posts webviewDidLaunch and the first webviewHeartbeat when App mounts. VS Code does not keep webview messages for a listener that is added later. On a cold start, getState() took about 2 seconds, and the webview mounted before the listener existed.
I attached a debugger to the extension host and read diagnosticsRecorder.snapshot():
| Time (UTC) | Event |
|---|---|
| 17:51:18.094 | view-resolved |
| about 17:51:19.07 | The webview mounts. This time is one heartbeat interval (30 seconds) before the first heartbeat that the provider received. |
| about 17:51:20.49 | initializeWebviewView() installs the message listener, after getState() completes. |
| 17:51:49.075 | The first webview-in event. It is a webviewHeartbeat. No webviewDidLaunch event arrives. |
After this, isViewLaunched stays false, so the provider never posts state. Heartbeats arrive every 30 seconds, so the watchdog sees a healthy webview and does not recover it.
I will open a PR that installs the message listener before the provider assigns the HTML.
Activity
Listen for webview messages before the view HTML loads
DiamondGo commentedon Nov 25, 2026
Claiming
Hydrate state before the webview HTML loads
Listen for webview messages before the view HTML loads (Zoo-Code-Org#…