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
This commit is contained in:
Drew Davis 2025-11-13 09:28:03 -05:00 committed by GitHub
parent 7bb7a878de
commit c42a070a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
fix: Fix session search behavior

View file

@ -1033,6 +1033,7 @@ function DBDashboardPage({ presetConfig }: { presetConfig?: Dashboard }) {
placeholder="Search your events w/ Lucene ex. column:foo"
enableHotkey
data-testid="search-input"
onSubmit={onSubmit}
/>
)
}

View file

@ -995,6 +995,7 @@ function ServicesDashboardPage() {
language="lucene"
placeholder="Search your events w/ Lucene ex. column:foo"
enableHotkey
onSubmit={onSubmit}
/>
}
/>

View file

@ -353,7 +353,7 @@ export default function SessionSubpanel({
select: commonSelect,
from: traceSource.from,
dateRange: [start, end],
whereLanguage: 'lucene',
whereLanguage,
where: searchedQuery,
timestampValueExpression: traceSource.timestampValueExpression,
implicitColumnExpression: traceSource.implicitColumnExpression,
@ -376,7 +376,7 @@ export default function SessionSubpanel({
traceSource.connection,
start,
end,
// whereLanguage,
whereLanguage,
searchedQuery,
tab,
highlightedEventsFilter,
@ -402,7 +402,7 @@ export default function SessionSubpanel({
select: commonSelect,
from: traceSource.from,
dateRange: [start, end],
whereLanguage: 'lucene',
whereLanguage,
where: searchedQuery,
timestampValueExpression: traceSource.timestampValueExpression,
implicitColumnExpression: traceSource.implicitColumnExpression,
@ -425,6 +425,7 @@ export default function SessionSubpanel({
traceSource.connection,
start,
end,
whereLanguage,
searchedQuery,
tab,
highlightedEventsFilter,
@ -495,6 +496,7 @@ export default function SessionSubpanel({
language="sql"
size="xs"
enableHotkey
onSubmit={handleSubmit(handleWhereSubmit)}
/>
) : (
<SearchInputV2
@ -505,6 +507,7 @@ export default function SessionSubpanel({
size="xs"
placeholder="Search your events w/ Lucene ex. column:foo"
enableHotkey
onSubmit={handleSubmit(handleWhereSubmit)}
/>
)}
</form>

View file

@ -470,6 +470,7 @@ export default function SessionsPage() {
<SearchInputV2
tableConnection={tcFromSource(traceTrace)}
control={control}
onSubmit={onSubmit}
name="where"
onLanguageChange={lang =>
setValue('whereLanguage', lang, {