diff --git a/releases/vscode-deephaven-latest.vsix b/releases/vscode-deephaven-latest.vsix index 3b072d3d..b7ecd956 100644 Binary files a/releases/vscode-deephaven-latest.vsix and b/releases/vscode-deephaven-latest.vsix differ diff --git a/src/common/constants.ts b/src/common/constants.ts index 3d12faca..2a432104 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -1,6 +1,15 @@ import * as path from 'node:path'; import type { ConsoleType, VariableType } from '../types'; +/** + * This value is a little bit arbitrary, but it needs to be long enough to + * allow panels to update their `visible` property after an `onDidChangeTabs` + * event fires. If we find that we have trouble with lazy panels not loading on + * initial activation, we may need to increase this value. This seems to work + * on a slower VM being used for testing whereas 50ms did not. + */ +export const DEBOUNCE_TAB_UPDATE_MS = 100; + export const EXTENSION_ID = 'vscode-deephaven' as const; export const CONFIG_KEY = { diff --git a/src/controllers/PanelController.ts b/src/controllers/PanelController.ts index 74b39a57..00e82858 100644 --- a/src/controllers/PanelController.ts +++ b/src/controllers/PanelController.ts @@ -21,6 +21,7 @@ import { import { DhcService } from '../services'; import { CENSORED_TEXT, + DEBOUNCE_TAB_UPDATE_MS, DEEPHAVEN_POST_MSG, DH_PANEL_VIEW_TYPE, OPEN_VARIABLE_PANELS_CMD, @@ -74,7 +75,10 @@ export class PanelController extends ControllerBase { * Load any visible panels that are marked for pending initial load. Calls * to this method are debounced in case this is called multiple times before * the active tab state actually settles. e.g. tab change events may fire - * multiple times as tabs are removed, added, etc. + * multiple times as tabs are removed, added, etc. Also, on slower machines, + * there may be some latency between when `onDidChangeTabs` fires and + * `panel.visible` props are updated, so wait long enough to ensure they are + * current. */ private _debouncedRefreshVisiblePanelsPendingInitialLoad = (): void => { clearTimeout(this._debounceRefreshPanels); @@ -122,7 +126,8 @@ export class PanelController extends ControllerBase { this._onRefreshPanelsContent(url, [variable]); } }); - }, 50); + // See comment on `_debouncedRefreshVisiblePanelsPendingInitialLoad` + }, DEBOUNCE_TAB_UPDATE_MS); }; /**