From b05e280d6f0a0304574b37e99489dceaa753571e Mon Sep 17 00:00:00 2001 From: Elizabet Oliveira Date: Fri, 18 Sep 2026 11:44:14 +0200 Subject: [PATCH 1/2] fix(app): keep multi-line query fields visible when unfocused Grow SQL, Lucene, and PromQL fields in layout instead of collapsing to one line or floating an overlay. Shared editor heights keep the language switch flush with the input. Co-authored-by: Cursor --- .../multiline-search-bar-always-visible.md | 13 ++ .../src/components/HeatmapSettingsDrawer.tsx | 2 - .../components/PromQLEditor/PromQLEditor.tsx | 17 +- .../SQLEditor/SQLInlineEditor.module.scss | 60 ++---- .../components/SQLEditor/SQLInlineEditor.tsx | 48 ++--- .../SQLEditor/variableValidation.module.scss | 4 +- .../SearchInput/AutocompleteInput.module.scss | 60 +++--- .../SearchInput/AutocompleteInput.tsx | 36 ++-- .../components/SearchInput/SearchInputV2.tsx | 14 +- .../SearchInput/SearchWhereInput.module.scss | 76 +++---- .../SearchInput/SearchWhereInput.tsx | 44 ++-- .../__tests__/SearchWhereInput.test.tsx | 60 +++++- .../app/src/components/editorInputHeights.ts | 5 + .../e2e/components/ChartEditorComponent.ts | 62 ++---- .../e2e/components/SidePanelComponent.ts | 7 + .../e2e/components/WhereInputComponent.ts | 178 +++++++++++++++++ .../e2e/features/shared/multiline.spec.ts | 188 +++++++----------- .../app/tests/e2e/page-objects/SearchPage.ts | 102 ++++++++-- packages/app/tests/e2e/utils/locators.ts | 29 ++- .../app/tests/e2e/utils/multiline-input.ts | 152 ++++++++++++++ 20 files changed, 754 insertions(+), 403 deletions(-) create mode 100644 .changeset/multiline-search-bar-always-visible.md create mode 100644 packages/app/src/components/editorInputHeights.ts create mode 100644 packages/app/tests/e2e/components/WhereInputComponent.ts create mode 100644 packages/app/tests/e2e/utils/multiline-input.ts diff --git a/.changeset/multiline-search-bar-always-visible.md b/.changeset/multiline-search-bar-always-visible.md new file mode 100644 index 0000000000..7eaa144c79 --- /dev/null +++ b/.changeset/multiline-search-bar-always-visible.md @@ -0,0 +1,13 @@ +--- +'@hyperdx/app': patch +--- + +fix: keep a multi-line query visible when the field is not focused + +Multi-line SQL fields collapsed to a single line whenever they lost focus, so everything past the first line was hidden until you clicked back into them. Focusing one expanded it into a floating overlay that covered the content underneath — and in a container sized to its content, that overlay left the layout flow and shrank the field to a sliver one character wide. + +Any field that allows multiple lines now simply sizes to its content, focused or not, growing the layout rather than floating over it, up to 150px before it scrolls. That covers the search WHERE, SELECT and ORDER BY, the chart editor's SQL fields, and PromQL. Lucene search fields similarly grow up to four lines. Fields with `allowMultiline={false}` remain single-line in both SQL and Lucene. The focus overlay is gone rather than made optional, so there is no longer a separate expand-on-focus state to reason about. + +The language switch beside the search bar stretches to match, with no divider between it and the input. A Lucene bar at the default size also no longer overhangs that switch. The Lucene input reserved a 38px row while drawing a 36px box inside it, so the switch — sized to the 36px the SQL editor uses — stood 2px proud of the input. Both languages now take their height from one shared table, so the seam is flush and the bar does not change height when you switch. Only the default size was affected; the compact bar was already consistent at 30px. + +Focus recolors the whole control, including the language switch, without overriding an error or warning border. diff --git a/packages/app/src/components/HeatmapSettingsDrawer.tsx b/packages/app/src/components/HeatmapSettingsDrawer.tsx index 8bc07138cf..975f1701f3 100644 --- a/packages/app/src/components/HeatmapSettingsDrawer.tsx +++ b/packages/app/src/components/HeatmapSettingsDrawer.tsx @@ -97,7 +97,6 @@ export default function HeatmapSettingsDrawer({ size="xs" tooltipText="Controls the Y axis range and scale — defines the metric plotted vertically." placeholder="SQL expression" - language="sql" onSubmit={form.handleSubmit(onSubmit)} label="Value" error={form.formState.errors.value?.message} @@ -111,7 +110,6 @@ export default function HeatmapSettingsDrawer({ control={form.control} name="count" placeholder="SQL expression" - language="sql" size="xs" tooltipText="Controls the color intensity (Z axis) — shows how frequently or strongly each value occurs." onSubmit={form.handleSubmit(onSubmit)} diff --git a/packages/app/src/components/PromQLEditor/PromQLEditor.tsx b/packages/app/src/components/PromQLEditor/PromQLEditor.tsx index 453769e1fc..28cf3b98db 100644 --- a/packages/app/src/components/PromQLEditor/PromQLEditor.tsx +++ b/packages/app/src/components/PromQLEditor/PromQLEditor.tsx @@ -18,6 +18,7 @@ import CodeMirror, { tooltips, } from '@uiw/react-codemirror'; +import { EDITOR_INPUT_HEIGHTS } from '@/components/editorInputHeights'; import { createCodeMirrorStyleTheme, DEFAULT_CODE_MIRROR_BASIC_SETUP, @@ -197,36 +198,26 @@ export default function PromQLEditor({ } }, []); - const isExpanded = isFocused; const isVariableWarningOnly = variableIssues.errors.length === 0 && variableIssues.warnings.length > 0; - const baseHeight = 36; + const baseHeight = EDITOR_INPUT_HEIGHTS.sm; return (
- {isExpanded &&