Add debugging logs to WebViewer component

- Add console logs for component mounting/rendering
- Add console logs for visibility changes
- Add console logs for showing/hiding child windows
- This will help debug why child windows disappear during message sending
This commit is contained in:
spencrmartin
2025-11-12 14:31:24 -05:00
parent 2a73e791b2
commit ce82be999e
+5
View File
@@ -88,6 +88,8 @@ export function WebViewer({
const containerRef = useRef<HTMLDivElement>(null);
const updateBoundsTimeoutRef = useRef<NodeJS.Timeout | null>(null);
console.log(`[WebViewer-${childWindowId.current}] Component mounting/rendering`);
// WebViewer context for AI prompt injection
const webViewerContext = useWebViewerContextOptional();
@@ -521,9 +523,12 @@ export function WebViewer({
useEffect(() => {
if (!childWindowCreated) return;
console.log(`[WebViewer-${childWindowId.current}] Visibility changed to:`, isVisible);
if (isVisible) {
console.log(`[WebViewer-${childWindowId.current}] Showing child window`);
window.electron.showChildWebViewer(childWindowId.current);
} else {
console.log(`[WebViewer-${childWindowId.current}] Hiding child window`);
window.electron.hideChildWebViewer(childWindowId.current);
}
}, [isVisible, childWindowCreated]);