Skip to content

Commit c42a070

Browse files
authored
fix: Fix session search behavior (#1357)
# Summary This PR fixes a few bugs in the session search page: 1. Clicking ENTER now triggers a form submission on the session page for lucene conditions (SQL conditions already worked) 2. Clicking ENTER now triggers a form submission on the session side panel for both lucene and SQL conditions 3. The WHERE condition in the search sidebar is now interpreted in the correct `whereLanguage` instead of assuming lucene. Partially reverts #863, but I confirmed that the page-level search does not filter the sidepanel spans after this change. This PR also fixes the same issue (ENTER now submits forms) on the dashboard and services page. #1208 introduced the issue by preventing the ENTER event from bubbling up to the form when using `AutocompleteInput` / `SearchInputV2`. Closes HDX-2816 Closes HDX-2817 https://github.com/user-attachments/assets/b91bdb0f-e241-43c2-9854-88fbe43daec7
1 parent 7bb7a87 commit c42a070

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

.changeset/light-timers-raise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperdx/app": patch
3+
---
4+
5+
fix: Fix session search behavior

packages/app/src/DBDashboardPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,7 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
10331033
placeholder="Search your events w/ Lucene ex. column:foo"
10341034
enableHotkey
10351035
data-testid="search-input"
1036+
onSubmit={onSubmit}
10361037
/>
10371038
)
10381039
}

packages/app/src/ServicesDashboardPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ function ServicesDashboardPage() {
995995
language="lucene"
996996
placeholder="Search your events w/ Lucene ex. column:foo"
997997
enableHotkey
998+
onSubmit={onSubmit}
998999
/>
9991000
}
10001001
/>

packages/app/src/SessionSubpanel.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export default function SessionSubpanel({
353353
select: commonSelect,
354354
from: traceSource.from,
355355
dateRange: [start, end],
356-
whereLanguage: 'lucene',
356+
whereLanguage,
357357
where: searchedQuery,
358358
timestampValueExpression: traceSource.timestampValueExpression,
359359
implicitColumnExpression: traceSource.implicitColumnExpression,
@@ -376,7 +376,7 @@ export default function SessionSubpanel({
376376
traceSource.connection,
377377
start,
378378
end,
379-
// whereLanguage,
379+
whereLanguage,
380380
searchedQuery,
381381
tab,
382382
highlightedEventsFilter,
@@ -402,7 +402,7 @@ export default function SessionSubpanel({
402402
select: commonSelect,
403403
from: traceSource.from,
404404
dateRange: [start, end],
405-
whereLanguage: 'lucene',
405+
whereLanguage,
406406
where: searchedQuery,
407407
timestampValueExpression: traceSource.timestampValueExpression,
408408
implicitColumnExpression: traceSource.implicitColumnExpression,
@@ -425,6 +425,7 @@ export default function SessionSubpanel({
425425
traceSource.connection,
426426
start,
427427
end,
428+
whereLanguage,
428429
searchedQuery,
429430
tab,
430431
highlightedEventsFilter,
@@ -495,6 +496,7 @@ export default function SessionSubpanel({
495496
language="sql"
496497
size="xs"
497498
enableHotkey
499+
onSubmit={handleSubmit(handleWhereSubmit)}
498500
/>
499501
) : (
500502
<SearchInputV2
@@ -505,6 +507,7 @@ export default function SessionSubpanel({
505507
size="xs"
506508
placeholder="Search your events w/ Lucene ex. column:foo"
507509
enableHotkey
510+
onSubmit={handleSubmit(handleWhereSubmit)}
508511
/>
509512
)}
510513
</form>

packages/app/src/SessionsPage.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ export default function SessionsPage() {
470470
<SearchInputV2
471471
tableConnection={tcFromSource(traceTrace)}
472472
control={control}
473+
onSubmit={onSubmit}
473474
name="where"
474475
onLanguageChange={lang =>
475476
setValue('whereLanguage', lang, {

0 commit comments

Comments
 (0)