diff --git a/frontend/src/components/WidgetConfigDialog.tsx b/frontend/src/components/WidgetConfigDialog.tsx index 574c1a3..0c6fa21 100644 --- a/frontend/src/components/WidgetConfigDialog.tsx +++ b/frontend/src/components/WidgetConfigDialog.tsx @@ -207,7 +207,12 @@ export function WidgetConfigDialog({ dashboardScope, editWidgetId, }: Props) { - const { data: instances = [] } = useWidgetInstances(serviceId); + // When editing a dashboard (no serviceId), scope to dashboard-only widgets + // (service_id IS NULL) so service-scoped widgets don't leak into the list. + const { data: instances = [] } = useWidgetInstances( + serviceId, + !serviceId && dashboardScope ? "dashboard" : undefined, + ); const { data: services = [] } = useServiceInstances(); const { data: tasks = [] } = useTasks(); const saveWidget = useSaveWidgetInstance();