From 2bd7d5ddab1756d015a08766015b71e6cb1e8cb0 Mon Sep 17 00:00:00 2001 From: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com> Date: Thu, 13 Nov 2025 12:01:59 -0800 Subject: [PATCH] chore: add a nice UI message letting user know about focused query --- .../query/components/QueryEditorRow.tsx | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index c9a6d7d7157..8628a344eac 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -23,7 +23,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { Trans, t } from '@grafana/i18n'; import { getDataSourceSrv, renderLimitedComponents, reportInteraction, usePluginComponents } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; -import { Badge, ErrorBoundaryAlert, List } from '@grafana/ui'; +import { Badge, ErrorBoundaryAlert, List, Text } from '@grafana/ui'; import { OperationRowHelp } from 'app/core/components/QueryOperationRow/OperationRowHelp'; import { QueryOperationAction, @@ -562,12 +562,33 @@ export class QueryEditorRow extends PureComponent ); + const { queries } = this.props; + const hiddenQueriesCount = queries.length - 1; // Total queries minus the focused one + return (
+ {isFocused && ( +
+ + + Query {query.refId} is focused, {hiddenQueriesCount}{' '} + {hiddenQueriesCount === 1 ? ( + query is + ) : ( + all other queries are + )}{' '} + hidden from view. + + +
+ )} {queryLibraryRef && ( // Remove margins when focused to maximize space marginBottom: 0, }); + +const getFocusedBannerStyle = () => + css({ + marginBottom: '10px', + });