From 3a2de1f94da34d448ab6b91b8677ee66a27825f3 Mon Sep 17 00:00:00 2001 From: Satchel Baldwin Date: Tue, 2 Dec 2025 11:07:23 -0600 Subject: [PATCH 1/2] fix: refresh integrations on context change rather than session activity change so that editing is always synchronized to current active context --- beaker-vue/src/pages/IntegrationsInterface.vue | 15 +++++++++++++++ beaker-vue/src/pages/NextNotebookInterface.vue | 12 +++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/beaker-vue/src/pages/IntegrationsInterface.vue b/beaker-vue/src/pages/IntegrationsInterface.vue index f4b0dbbc..b88a661d 100644 --- a/beaker-vue/src/pages/IntegrationsInterface.vue +++ b/beaker-vue/src/pages/IntegrationsInterface.vue @@ -233,6 +233,21 @@ const fetchIntegrations = async () => { integrations.value.finishedInitialLoad = true; } +const activeContext = computed(() => { + const contextInfo = beakerSession?.value?.activeContext; + const kernelInfo = beakerSession?.value?.session.kernelInfo; + console.log(contextInfo, kernelInfo) + return { + ...contextInfo, + kernelInfo, + }; +}); + +watch(activeContext, async () => { + await fetchIntegrations(); +}); + + const modifySelectedIntegration = async (body: object, integrationId?: string) => { if (integrationId) { integrations.value.integrations[integrationId] = await updateIntegration( diff --git a/beaker-vue/src/pages/NextNotebookInterface.vue b/beaker-vue/src/pages/NextNotebookInterface.vue index b8f074a2..5351c243 100644 --- a/beaker-vue/src/pages/NextNotebookInterface.vue +++ b/beaker-vue/src/pages/NextNotebookInterface.vue @@ -360,7 +360,17 @@ type FilePreview = { } const previewedFile = ref(); -watch(beakerSession, async () => { +const activeContext = computed(() => { + const contextInfo = beakerSession?.value?.activeContext; + const kernelInfo = beakerSession?.value?.session.kernelInfo; + console.log(contextInfo, kernelInfo) + return { + ...contextInfo, + kernelInfo, + }; +}); + +watch(activeContext, async () => { integrations.value = await listIntegrations(sessionIdFromUrl); }); From 9cca43fe1a3abe47cf236e5ee04444991ca4b03b Mon Sep 17 00:00:00 2001 From: Satchel Baldwin Date: Tue, 2 Dec 2025 14:55:46 -0600 Subject: [PATCH 2/2] fix: avoid recreating computed ref --- beaker-vue/src/pages/IntegrationsInterface.vue | 18 ++++-------------- beaker-vue/src/pages/NextNotebookInterface.vue | 17 ++++------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/beaker-vue/src/pages/IntegrationsInterface.vue b/beaker-vue/src/pages/IntegrationsInterface.vue index b88a661d..f37bfea0 100644 --- a/beaker-vue/src/pages/IntegrationsInterface.vue +++ b/beaker-vue/src/pages/IntegrationsInterface.vue @@ -233,20 +233,10 @@ const fetchIntegrations = async () => { integrations.value.finishedInitialLoad = true; } -const activeContext = computed(() => { - const contextInfo = beakerSession?.value?.activeContext; - const kernelInfo = beakerSession?.value?.session.kernelInfo; - console.log(contextInfo, kernelInfo) - return { - ...contextInfo, - kernelInfo, - }; -}); - -watch(activeContext, async () => { - await fetchIntegrations(); -}); - +watch( + [() => beakerSession?.value?.activeContext, () => beakerSession?.value?.session.kernelInfo], + async () => await fetchIntegrations() +); const modifySelectedIntegration = async (body: object, integrationId?: string) => { if (integrationId) { diff --git a/beaker-vue/src/pages/NextNotebookInterface.vue b/beaker-vue/src/pages/NextNotebookInterface.vue index 5351c243..658d6004 100644 --- a/beaker-vue/src/pages/NextNotebookInterface.vue +++ b/beaker-vue/src/pages/NextNotebookInterface.vue @@ -360,19 +360,10 @@ type FilePreview = { } const previewedFile = ref(); -const activeContext = computed(() => { - const contextInfo = beakerSession?.value?.activeContext; - const kernelInfo = beakerSession?.value?.session.kernelInfo; - console.log(contextInfo, kernelInfo) - return { - ...contextInfo, - kernelInfo, - }; -}); - -watch(activeContext, async () => { - integrations.value = await listIntegrations(sessionIdFromUrl); -}); +watch( + [() => beakerSession?.value?.activeContext, () => beakerSession?.value?.session.kernelInfo], + async () => {integrations.value = await listIntegrations(sessionIdFromUrl)} +);