From f049f3c52ee42c7410dffb999dc5a04ebb505391 Mon Sep 17 00:00:00 2001 From: Nick Strayer Date: Fri, 20 Dec 2024 09:50:52 -0500 Subject: [PATCH] Clean up and describe a bit better how we're reacting to changes. --- .../notebookCells/hooks/useWebviewMount.ts | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts b/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts index 747ac551add..8755bba6536 100644 --- a/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts +++ b/src/vs/workbench/contrib/positronNotebook/browser/notebookCells/hooks/useWebviewMount.ts @@ -132,17 +132,16 @@ export function useWebviewMount(webview: Promise) { // Listen for all editor and layout changes that might affect the webview const handleLayoutChange = () => updateWebviewLayout(false); editorChangeDisposable = Event.any( - editorService.onDidActiveEditorChange, - editorService.onDidVisibleEditorsChange, // Catches editor group changes - layoutService.onDidLayoutMainContainer, // Listen for main container layout changes - layoutService.onDidLayoutContainer, // Listen for any container layout changes - layoutService.onDidLayoutActiveContainer, // Listen for active container layout changes - layoutService.onDidChangePartVisibility, - layoutService.onDidChangeZenMode, - layoutService.onDidChangeWindowMaximized, - layoutService.onDidChangePanelAlignment, - layoutService.onDidChangePanelPosition, - layoutService.onDidChangeMainEditorCenteredLayout // Listen for main editor centered layout changes + editorService.onDidActiveEditorChange, // Active editor switched + editorService.onDidVisibleEditorsChange, // Editor groups/layout changed + layoutService.onDidLayoutMainContainer, // Main container resized/moved + layoutService.onDidLayoutContainer, // Any container resized/moved + layoutService.onDidLayoutActiveContainer, // Active container resized/moved + layoutService.onDidChangePartVisibility, // UI part shown/hidden + layoutService.onDidChangeWindowMaximized, // Window maximized/restored + layoutService.onDidChangePanelAlignment, // Panel alignment changed + layoutService.onDidChangePanelPosition, // Panel position changed + layoutService.onDidChangeMainEditorCenteredLayout // Editor centered mode toggled )(handleLayoutChange); // Create and setup resize observer for layout changes