Repository navigation
[HDX-5307] Drop the search bar WHERE label and / keycap #3152
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
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,7 @@ | ||
| --- | ||
| '@hyperdx/app': patch | ||
| --- | ||
|
|
||
| fix: drop the search bar WHERE label and `/` keycap overlay | ||
|
|
||
| The `WHERE` label repeated the SQL placeholder, and the `/` hint clipped long queries. `/` and `s` still focus the input; the overlay is gone. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,13 +79,17 @@ describe('SearchWhereInput', () => { | |
|
|
||
| describe('Lucene Mode', () => { | ||
| it('renders Lucene input when whereLanguage is lucene', () => { | ||
| renderWithMantine(<TestWrapper defaultLanguage="lucene" />); | ||
| const { container } = renderWithMantine( | ||
| <TestWrapper defaultLanguage="lucene" />, | ||
| ); | ||
|
|
||
| // Lucene mode uses a textarea from AutocompleteInput | ||
| const input = screen.getByPlaceholderText( | ||
| /Search your events w\/ Lucene/i, | ||
| ); | ||
| expect(input).toBeInTheDocument(); | ||
| // `/` and `s` still focus the input; the overlay keycap is gone. | ||
| expect(container.querySelector('kbd')).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('allows typing in Lucene mode', async () => { | ||
|
|
@@ -135,10 +139,15 @@ describe('SearchWhereInput', () => { | |
| }); | ||
|
|
||
| describe('SQL Mode', () => { | ||
| it('renders SQL input with WHERE label when whereLanguage is sql', () => { | ||
| it('renders the SQL editor when whereLanguage is sql', () => { | ||
| renderWithMantine(<TestWrapper defaultLanguage="sql" />); | ||
|
|
||
| expect(screen.getByText('WHERE')).toBeInTheDocument(); | ||
| expect( | ||
| screen.getByRole('combobox', { name: 'Query language' }), | ||
|
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 — Rewritten SQL-mode test asserts nothing about the SQL editor it is named for The old assertion ( |
||
| ).toHaveValue('SQL'); | ||
| expect( | ||
| screen.queryByPlaceholderText(/Search your events w\/ Lucene/i), | ||
| ).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders SQL placeholder', () => { | ||
|
|
@@ -196,23 +205,6 @@ describe('SearchWhereInput', () => { | |
| ).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('hides label when showLabel is false', () => { | ||
| renderWithMantine( | ||
| <TestWrapper defaultLanguage="sql"> | ||
| {({ control }) => ( | ||
| <SearchWhereInput | ||
| tableConnection={mockTableConnection} | ||
| control={control} | ||
| name="where" | ||
| showLabel={false} | ||
| /> | ||
| )} | ||
| </TestWrapper>, | ||
| ); | ||
|
|
||
| expect(screen.queryByText('WHERE')).not.toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('uses custom placeholders when provided', () => { | ||
| renderWithMantine( | ||
| <TestWrapper defaultLanguage="lucene"> | ||
|
|
||
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 — No test pins the removal of the WHERE label, the PR's main change
The label only ever rendered in SQL mode (it was passed to
SQLInlineEditorControlled), and this diff deletes both tests that covered it (renders SQL input with WHERE labelandhides label when showLabel is false). The replacement asserts the language combobox readsSQLand that the Lucene placeholder is absent — both true whether or not aWHERElabel renders — so reintroducing the label leaves the suite green. Addexpect(screen.queryByText('WHERE')).not.toBeInTheDocument();to this SQL-mode test. (The newkbdassertion at line 92 lives in the Lucene block, and the keycap rendered in both languages, so it likewise wouldn't catch a SQL-only regression.)