Repository navigation
[HDX-5307] Keep multi-line query fields visible when unfocused #3132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
97b08c1
b3c436a
23991d1
c1ab5ef
8747452
111a4da
6196b1b
153905d
b0a1984
7ff897b
f8e682a
3ee2a29
9d17df7
129ce68
a8bb1c6
010a925
e054676
87af1ce
0739c26
5d938d5
cbb3de2
9bd39ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| '@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. | ||
|
|
||
| Toolbar controls beside a growing search bar stay aligned with its first line (date picker, live tail, Run, and the Kubernetes filter row). Focus now recolors the whole control, including the language switch, without overriding an error or warning border. | ||
|
|
||
| The bar also drops its `WHERE` label. It repeated what the placeholder already says — "SQL WHERE clause (ex. column = 'foo')" — while taking horizontal room the query itself can use, which matters more now that a long query wraps rather than being cut off. Most places that embed this input already hid the label and labelled it themselves from the outside, so the option to show it is gone rather than merely defaulted off. | ||
|
|
||
| The `/` keycap that sat inside the bar is gone too. `/` and `s` still focus the input; only the overlay is removed so a long query is not clipped by a hint that is already documented in the keyboard shortcuts modal. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ import { | |
| } from '@tabler/icons-react'; | ||
|
|
||
| import { ChartEditorFormState } from '@/components/ChartEditor/types'; | ||
| import { EDITOR_INPUT_HEIGHTS } from '@/components/editorInputHeights'; | ||
| import { SQLInlineEditorControlled } from '@/components/SQLEditor/SQLInlineEditor'; | ||
| import { TimePicker } from '@/components/TimePicker'; | ||
| import { IS_LOCAL_MODE } from '@/config'; | ||
|
|
@@ -154,9 +155,11 @@ export function ChartActionBar({ | |
| </Button> | ||
| )} | ||
| </Flex> | ||
| <Flex gap="sm" mb="sm" align="center" justify="end"> | ||
| <Flex gap="sm" mb="sm" align="flex-start" justify="end"> | ||
|
elizabetdev marked this conversation as resolved.
Resolved
|
||
| {filtersToggle != null && tabQueriesData(activeTab) && ( | ||
| <DashboardFiltersToggle {...filtersToggle} /> | ||
| <Flex h={EDITOR_INPUT_HEIGHTS.sm} align="center"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — The editor's base height is re-asserted by hand at nine call sites
|
||
| <DashboardFiltersToggle {...filtersToggle} /> | ||
| </Flex> | ||
| )} | ||
| {(activeTab === 'table' || | ||
| activeTab === 'pie' || | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ import { | |
| SavedChartConfigWithSelectArray, | ||
| } from '@/components/ChartEditor/types'; | ||
| import { isFormulaSourceKind } from '@/components/ChartEditor/utils'; | ||
| import { EDITOR_INPUT_HEIGHTS } from '@/components/editorInputHeights'; | ||
| import { | ||
| CheckBoxControlled, | ||
| TextInputControlled, | ||
|
|
@@ -511,15 +512,19 @@ export function ChartSeriesEditor({ | |
| )} | ||
| {(showWhere || showGroupBy || showHaving) && ( | ||
| <div | ||
| className="flex-grow-1 gap-2 align-items-center" | ||
| className="flex-grow-1 gap-2" | ||
| style={{ | ||
| display: 'grid', | ||
| gridTemplateColumns: 'auto 1fr auto 1fr', | ||
| // Labels stay level with each editor's first line as it grows | ||
| alignItems: 'start', | ||
| }} | ||
| > | ||
| {showWhere && ( | ||
| <> | ||
| <Text size="sm">Where</Text> | ||
| <Flex h={EDITOR_INPUT_HEIGHTS.sm} align="center"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 minor — The same "centre this control on the editor's first line" wrapper is now hand-rolled at |
||
| <Text size="sm">Where</Text> | ||
| </Flex> | ||
| <div | ||
| style={{ | ||
| gridColumn: | ||
|
|
@@ -533,7 +538,6 @@ export function ChartSeriesEditor({ | |
| control={control} | ||
| name={`${namePrefix}aggCondition`} | ||
| onSubmit={onSubmit} | ||
| showLabel={false} | ||
| additionalSuggestions={attributeSuggestions} | ||
| data-testid="series-where-input" | ||
| enableVariables | ||
|
|
@@ -543,9 +547,11 @@ export function ChartSeriesEditor({ | |
| )} | ||
| {showGroupBy && ( | ||
| <> | ||
| <Text size="sm" style={{ whiteSpace: 'nowrap' }}> | ||
| Group By | ||
| </Text> | ||
| <Flex h={EDITOR_INPUT_HEIGHTS.sm} align="center"> | ||
| <Text size="sm" style={{ whiteSpace: 'nowrap' }}> | ||
| Group By | ||
| </Text> | ||
| </Flex> | ||
| <div | ||
| style={{ | ||
| minWidth: 200, | ||
|
|
@@ -567,9 +573,11 @@ export function ChartSeriesEditor({ | |
| </div> | ||
| {showHaving && ( | ||
| <> | ||
| <Text size="sm" style={{ whiteSpace: 'nowrap' }}> | ||
| Having | ||
| </Text> | ||
| <Flex h={EDITOR_INPUT_HEIGHTS.sm} align="center"> | ||
| <Text size="sm" style={{ whiteSpace: 'nowrap' }}> | ||
| Having | ||
| </Text> | ||
| </Flex> | ||
| <div style={{ minWidth: 300, maxWidth: '100%' }}> | ||
| <SQLInlineEditorControlled | ||
| tableConnection={tableConnection} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔵 minor —
align="flex-start"top-aligns the 34px ActionIcons against 36px toolbar controlsMantine
Groupdefaults toalign="center", which was centering the twosize="lg"ActionIcons (34px, lines 385 and 400) against the 36pxSearchWhereInput/TimePicker/Runbutton. Withflex-startthey now sit flush to the top and 2px short at the bottom — the same 2px seam this PR removes elsewhere.KubernetesFilters.tsx:325has the same shape (28pxFilterLinkToggleActionIcon vs 30pxsize="xs"selects). Wrap the shorter controls the wayChartActionBar.tsx:160already does in this diff:<Flex h={EDITOR_INPUT_HEIGHTS.sm} align="center">…</Flex>(.xsfor the Kubernetes row).