Skip to content

Commit e0b66b7

Browse files
committed
feat(ClineProvider): adding simple diagnostics for grey screen debug
1 parent 494650b commit e0b66b7

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/core/webview/ClineProvider.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ export class ClineProvider
848848
const viewStateDisposable = webviewView.onDidChangeViewState(() => {
849849
if (this.view?.visible) {
850850
this.postMessageToWebview({ type: "action", action: "didBecomeVisible" })
851+
} else {
852+
this.logWebviewHiddenDiagnostics()
851853
}
852854
})
853855

@@ -857,6 +859,8 @@ export class ClineProvider
857859
const visibilityDisposable = webviewView.onDidChangeVisibility(() => {
858860
if (this.view?.visible) {
859861
this.postMessageToWebview({ type: "action", action: "didBecomeVisible" })
862+
} else {
863+
this.logWebviewHiddenDiagnostics()
860864
}
861865
})
862866

@@ -2913,6 +2917,21 @@ export class ClineProvider
29132917
return this.clineStack[this.clineStack.length - 1]
29142918
}
29152919

2920+
private logWebviewHiddenDiagnostics(): void {
2921+
const task = this.getCurrentTask()
2922+
if (!task || task.abort || task.abandoned) {
2923+
return
2924+
}
2925+
this.log(
2926+
`[Zoo Code] Webview became hidden during active task — possible gray-screen event.\n` +
2927+
` taskId: ${task.taskId}\n` +
2928+
` messageCount: ${task.clineMessages.length}\n` +
2929+
` stackDepth: ${this.clineStack.length}\n` +
2930+
` timestamp: ${new Date().toISOString()}\n` +
2931+
`If the panel appears gray, open the Zoo Code output channel (View → Output → Zoo-Code) and share this log with support@zoocode.dev`,
2932+
)
2933+
}
2934+
29162935
public getRecentTasks(): string[] {
29172936
if (this.recentTasksCache) {
29182937
return this.recentTasksCache

0 commit comments

Comments
 (0)