diff --git a/browser_tests/remoteWidgets.spec.ts b/browser_tests/remoteWidgets.spec.ts
index 285570fd9..972a8ffde 100644
--- a/browser_tests/remoteWidgets.spec.ts
+++ b/browser_tests/remoteWidgets.spec.ts
@@ -176,6 +176,23 @@ test.describe('Remote COMBO Widget', () => {
})
test.describe('Refresh Behavior', () => {
+ test('refresh button is visible in selection toolbar when node is selected', async ({
+ comfyPage
+ }) => {
+ await comfyPage.setSetting('Comfy.Canvas.SelectionToolbox', true)
+
+ const nodeName = 'Remote Widget Node'
+ await addRemoteWidgetNode(comfyPage, nodeName)
+ await waitForWidgetUpdate(comfyPage)
+
+ // Select remote widget node
+ await comfyPage.page.keyboard.press('Control+A')
+
+ await expect(
+ comfyPage.page.locator('.selection-toolbox .pi-refresh')
+ ).toBeVisible()
+ })
+
test('refreshes options when TTL expires', async ({ comfyPage }) => {
// Fulfill each request with a unique timestamp
await comfyPage.page.route(
diff --git a/browser_tests/selectionToolbox.spec.ts b/browser_tests/selectionToolbox.spec.ts
index db47f9bd1..6bd1a87e3 100644
--- a/browser_tests/selectionToolbox.spec.ts
+++ b/browser_tests/selectionToolbox.spec.ts
@@ -57,4 +57,16 @@ test.describe('Selection Toolbox', () => {
comfyPage.page.locator('.selection-overlay-container.show-border')
).not.toBeVisible()
})
+
+ test('displays refresh button in toolbox when all nodes are selected', async ({
+ comfyPage
+ }) => {
+ // Select all nodes
+ await comfyPage.page.focus('canvas')
+ await comfyPage.page.keyboard.press('Control+A')
+
+ await expect(
+ comfyPage.page.locator('.selection-toolbox .pi-refresh')
+ ).toBeVisible()
+ })
})
diff --git a/src/components/graph/SelectionToolbox.vue b/src/components/graph/SelectionToolbox.vue
index 9f2f3c39f..ead0fde8e 100644
--- a/src/components/graph/SelectionToolbox.vue
+++ b/src/components/graph/SelectionToolbox.vue
@@ -18,6 +18,13 @@
icon="pi pi-trash"
@click="() => commandStore.execute('Comfy.Canvas.DeleteSelectedItems')"
/>
+
@@ -25,9 +32,11 @@
import Button from 'primevue/button'
import Panel from 'primevue/panel'
+import { useRefreshableSelection } from '@/composables/useRefreshableSelection'
import { useCommandStore } from '@/stores/commandStore'
const commandStore = useCommandStore()
+const { isRefreshable, refreshSelected } = useRefreshableSelection()