From b3ab2959ae9003268c184ca1eb17ab6b2bc592f0 Mon Sep 17 00:00:00 2001 From: Collin Fingar Date: Fri, 9 Jan 2026 13:22:42 -0500 Subject: [PATCH] All saved queries now default open table view --- .../features/dashboard-scene/scene/UnconfiguredPanel.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx b/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx index 56ecb18e3cb..15ab2587058 100644 --- a/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx +++ b/public/app/features/dashboard-scene/scene/UnconfiguredPanel.tsx @@ -107,6 +107,9 @@ function UnconfiguredPanelComp(props: PanelProps) { // Set the query in the panel queryRunner.setState({ queries: [enrichedQuery] }); + // TODO: Update this to utilize viz suggestions + panel.changePluginType('table'); + // Update datasource if needed if (enrichedQuery.datasource?.uid) { const dsSettings = await getDataSourceSrv().get({ uid: enrichedQuery.datasource.uid }); @@ -115,7 +118,10 @@ function UnconfiguredPanelComp(props: PanelProps) { locationService.partial({ editPanel: props.id }); - queryRunner.runQueries(); + // This is needed to ensure the query runner is initialized before running queries + setTimeout(() => { + queryRunner.runQueries(); + }, 0); } catch (error) { console.error('Failed to set query from library:', error); }