Skip to content

Mount Columns and Sort on the search page - #3432

Open
elizabetdev wants to merge 27 commits into
mainfrom
elizabet/search-columns-sort
Open

elizabetdev wants to merge 27 commits into
mainfrom
elizabet/search-columns-sort

Conversation

@elizabetdev

@elizabetdev elizabetdev commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves SELECT and ORDER BY off the query form. On a results search, Columns and Sort sit on the results table and edit those clauses. Event Deltas and Event Patterns do not show them. On a form narrower than 900px, the where clause and the time controls each take a full row, with the where clause first. Columns and Sort wrap with the table actions instead of overlapping them.

On a saved search, Apply stores an empty clause when the draft matches the default. Save, Update, and tag changes now keep the saved SELECT and ORDER BY in that case, and the Update preview shows the same clauses that Update saves.

The popovers also handle Escape when focus is on the toolbar button or the page, and they ask before discarding unsaved edits. The Columns SQL suggestions are no longer covered by the Apply row. Sort field suggestions are not clipped by the scrolling rows. Cancel and Apply have the same width.

The editors landed in #3431.

Screenshots were not captured.

Screenshots or video

Screenshot 2026-11-19 at 16 39 30

How to reproduce

Starting point: yarn app:dev:local connected to the demo server, or the Vercel preview. Open a log search and run it.

On main:

  1. The query form has SELECT and ORDER BY fields.
  2. The results table has no Columns or Sort button.

On this branch:

  1. The query form has no SELECT or ORDER BY field. Group by is still there.
  2. Above the results table, Columns and Sort are next to the table controls.
  3. Click Columns. Fields lists the columns; SQL edits the SELECT clause. Reset, then Apply. A removed column is dropped from the sort when it is one of the sort fields.
  4. Click Sort. Fields lists sort fields with direction; SQL edits the ORDER BY clause. Apply runs the search.
  5. Save a search with a custom Columns and Sort. Open Columns and click Apply without changes, add a tag, then click Update. The preview and the saved search keep the custom columns and sort.
  6. Narrow the window below 900px. The where clause takes the first row and the time controls wrap onto the next. Columns and Sort wrap with the table controls; a multi-field summary shows only the count.

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Open /search, choose a log source, and run the search.
  2. Confirm the query form has no SELECT or ORDER BY field.
  3. Confirm Columns and Sort appear with the results table controls.
  4. Click Columns. Confirm Fields and SQL are shown, then click Cancel.
  5. Click Sort. Confirm Fields and SQL are shown, then click Cancel.
  6. Confirm Group by is still in the query form.

References


Note

Medium Risk
Touches saved-search persistence and URL/query semantics alongside a large search UI refactor; behavior is heavily tested but regressions around clause defaults are the main risk.

Overview
SELECT and ORDER BY move off the search form onto Columns and Sort popovers beside the results table (results mode only). The old inline SQL fields and mobile “Columns” toggle in the form are removed; the form row is simplified with responsive where/time layout via container queries.

Table UX gains a dedicated toolbar: DBRowTable accepts toolbarLeading and controlsAboveTable, hoisting wrap/CSV/SQL/settings (and row selection when enabled) above the scroll area as ActionIcons instead of header-only buttons.

Clause editing is richer: ClausePopover prompts before discarding dirty drafts (confirm modal z-index fix); Columns supports drag-reorder, inline expression edit, and immediate add on autocomplete pick; Sort uses fixed-position field lists. Shared helpers orderByAfterRemovingSelectItems / selectItemsWithRemovedAlias keep ORDER BY consistent when columns or aliases are removed or reset.

Saved searches no longer wipe stored SELECT/ORDER BY when the URL encodes empty clauses (“use default”); create/update, tag edits, and save-modal SQL preview all resolve effective select/orderBy from saved clauses before source defaults.

Reviewed by Cursor Bugbot for commit 6cdc2b2. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added the review/tier-4 Critical — deep review + domain expert sign-off label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Tier 4 — Critical

Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI.

Why this tier:

  • Large diff: 1021 production lines changed (threshold: 1000)

Review process: Deep review from a domain expert. Synchronous walkthrough may be required.
SLA: Schedule synchronous review within 2 business days.

Stats
  • Production files changed: 10
  • Production lines changed: 1021 (+ 1058 in test files, excluded from tier calculation)
  • Branch: elizabet/search-columns-sort
  • Author: elizabetdev

To override this classification, remove the review/tier-4 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 108 in total (1.10%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

const knownColumns = new Set(columns.map(column => column.name));
// Field discovery is off for some teams, and `useAllFields` then returns
// [] rather than "still loading". Scalar columns are still known.
const keys =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 major — Columns and Sort pickers never offer Timestamp or other DateTime fields, nor whole Map/JSON columns

getSqlSourceKeys/getSqlSourceColumnKeys (packages/app/src/components/AdhocDashboardFilter/useAdhocFilterOptions.ts:63-88) belong to the ad hoc filter. They drop every key where isAdhocComparableDataType (common-utils/src/filters.ts:963, !/\bDateTime/) is false, and they skip non-scalar top-level columns. So Timestamp/TimestampTime, the most common sort fields, never show up under 'Add sort' or 'Search columns', and neither does a whole column such as LogAttributes. Build the clause options from all columns plus map/JSON subpaths without the DateTime filter. Add a hook test with a DateTime64 column. The popover tests pass a hardcoded fieldOptions=['Body','Timestamp'], so they cannot catch this.

Nothing blocks merge automatically, but a maintainer will expect this fixed if it is a real defect in code this PR changes. If it is about surrounding code, reply and say so instead of patching. Do not widen the PR. How to respond

isFieldMetadataDisabled || fields == null
? getSqlSourceColumnKeys(columns)
: getSqlSourceKeys(fields, columns);
return Array.from(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — Keys are quoted twice; the second toQuotedClickHouseKeyExpression pass and its knownColumns set can't change anything

getSqlSourceKeys and getSqlSourceColumnKeys already run every key through toQuotedKeys → toQuotedClickHouseKeyExpression (useAdhocFilterOptions.ts:54-57), and that function leaves already-quoted input alone. Drop the extra .map(...) and the knownColumns set, and just dedupe and sort the keys.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

2 finding(s): 🔴 0 P0/P1 · 🟡 1 P2 · 🔵 1 P3

1 posted as inline comment(s) on the changed lines. 1 unchanged from an earlier push (already inline above).


Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@elizabetdev
elizabetdev changed the base branch from main to elizabet/column-sort-editors October 21, 2026 15:59
@elizabetdev
elizabetdev added this pull request to stack #3433 October 21, 2026 16:00
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 476 passed • 1 skipped • 1151s

Status Count
✅ Passed 476
❌ Failed 0
⚠️ Flaky 15
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found.

The core risks this PR targets are handled well. The alias-aware sort cleanup (orderByWithoutAliases matching bare, double-quoted, and backtick-quoted aliases) resolves the prior "removed columns leave broken sorts" P1, and the saved-clause persistence fix (effectiveSelect/effectiveOrderBy and the handleUpdateTags fallback) resolves the "saved search loses columns/sort after a blank Apply" report. Both are backed by thorough unit coverage across every fallback branch. No P0/P1 happy-path break was found in the returned analysis or in a direct trace of the changed logic.

🟡 P2 — recommended

  • packages/app/src/DBSearchPage.tsx:1813 — handleUpdateTags falls back to savedSearch.select/savedSearch.orderBy unconditionally, without the savedSearch.source === current source guard that SaveSearchModal and defaultSelect both apply, so editing tags after switching to a different source can persist the previous source's clause under the new source id.
    • Fix: Gate the savedSearch.select/orderBy fallback on the same source-match condition used at the sibling sites, or route all four sites through one shared resolver.
    • maintainability
  • packages/app/src/DBSearchPage.tsx:558 — The "empty value means the saved clause (when the source matches) else the source default" rule is re-expressed at four sites with divergent endpoints (select falls through to the source default, orderBy stops at ''), which invites the clauses to drift apart as the code changes.
    • Fix: Extract a single resolveClause(urlValue, savedValue, sourceDefault, { sourceMatches }) helper and call it from the chart-config, SaveSearchModal, handleUpdateTags, and defaultSelect sites.
    • maintainability
🔵 P3 nitpicks (3)
  • packages/app/src/utils.ts:1313 — orderByWithoutAliases overloads its string | undefined return with three meanings (undefined = nothing dropped, '' = all dropped, string = some kept) that orderByAfterRemovingSelectItems must disambiguate twice, relying on comments.
    • Fix: Return a discriminated result such as { dropped: 'none' | 'all' | 'some'; value: string } so each caller branch reads an explicit field.
    • maintainability, kieran-typescript
  • packages/app/src/components/SearchResultsToolbar/ColumnsPopover.tsx:113 — pendingEdit re-implements the same "non-empty and differs from the current item" predicate that finishEdit uses, so the dirty check and the commit path can diverge if the rule changes.
    • Fix: Extract editChangesColumn(text, current): boolean and use it in both pendingEdit and finishEdit.
    • maintainability
  • packages/app/src/components/SearchResultsToolbar/SortPopover.tsx:116 — SortPopover's dirty omits typed-but-unpicked Add-field text, unlike ColumnsPopover which includes search.trim() !== '', so closing the Sort popover with uncommitted field text discards it without the discard prompt.
    • Fix: Include uncommitted Add-field text in SortPopover's dirty computation for parity, or confirm the asymmetry is intended since sort entries only commit via a valid field pick.
    • testing

Pre-existing (not blocking)

  • packages/app/src/components/DBRowTable.tsx:1106 — (header.column.columnDef.meta as any)?.column bypasses the table-meta type; untouched by this PR but adjacent to the refactored controls, so typing meta via a TanStack ColumnMeta module augmentation would make the .column access checked.

Reviewers (7): correctness-(did not return), adversarial-(did not return), julik-frontend-races-(did not return), kieran-typescript, testing, maintainability, project-standards, previous-comments, agent-native, learnings.

Testing gaps:

  • No integration test covers handleUpdateTags when the current source differs from savedSearch.source — the exact case the missing source-match guard (P2) would mishandle.
  • ClausePopover's EditorView.findFromDOM/completionStatus Escape branch in nestedListHandlesEscape is only exercisable via e2e; the parallel .cm-tooltip-autocomplete DOM path is unit-tested, so the user scenario is covered by a different mechanism.

Coverage note: The correctness, adversarial, and frontend-races reviewers had not returned before the report deadline, so async-timing edge cases (blur-vs-keydown double-commit in SortableColumn, the out-of-popover confirm confirmingRef guard, the global Escape listener lifecycle) are covered only by a direct trace plus the kieran-typescript and testing residual-risk notes, which flag these ref-coordinated flows as correct-but-fragile rather than broken. previous-comments independently verified all seven prior review threads are fully addressed with no regressions.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

Comment thread packages/app/src/DBSearchPage.tsx Resolved
Comment thread packages/app/src/DBSearchPage.tsx Resolved
</>
);
};
const applySelect = useCallback(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — applySelect repeats toggleColumn's logic for pruning ORDER BY

applySelect repeats toggleColumn's steps (lines 1838-1872): set select, read orderBy with getValues, call orderByAfterRemovingSelectItem with defaultSearchConfig.orderBy, then setValue('orderBy'). Move this into one helper, for example pruneOrderByForRemovedItems(items), and call it from both places, so a change to the pruning rule cannot reach only one of them.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6cdc2b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Minor
@hyperdx/api Minor
@hyperdx/otel-collector Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Nov 27, 2026 10:15am UTC
hyperdx-storybook Ready Ready Preview Nov 27, 2026 10:15am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect the search page and its results-table workflow.

Fix sort cleanup for removed aliases before merging.

Fix All in Claude CodeFindings

  1. P1 Removed columns leave broken sorts ▶

Summary

Moves SELECT and ORDER BY into Columns and Sort popovers above search results.

  • Search results put Columns and Sort beside the table.
  • Table actions stay above the results while the table scrolls.
  • Narrow search forms put WHERE above the time controls.

The earlier toolbar-overlap thread is addressed by wrapping the controls. elizabetdev kept the where field first to preserve reading order; Greptile agreed that this matches the updated description. Both supplied threads are unnumbered.

Reviews (6) · Last reviewed commit: "fix(app): keep the clause footer above t..." · Reviewed by Greptile

Base automatically changed from elizabet/column-sort-editors to main October 23, 2026 11:59
SELECT and ORDER BY move off the query form onto the results table, and the
where row wraps under the time controls on a narrow form.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jordan-simonovski
jordan-simonovski force-pushed the elizabet/search-columns-sort branch from 2096af9 to b5442e5 Compare October 23, 2026 11:59
@github-actions github-actions Bot added review/tier-3 Standard — full human review required and removed review/tier-4 Critical — deep review + domain expert sign-off labels Oct 23, 2026
Comment thread packages/app/src/DBSearchPage.tsx Resolved
);
};
const applySelect = useCallback(
(select: string, removedItems: string[]) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 minor — applySelect repeats the ORDER BY pruning that toggleColumn already does

Lines 2307-2316 copy the getValues('orderBy') → orderByAfterRemovingSelectItem(..., defaultSearchConfig.orderBy) → setValue('orderBy') sequence from toggleColumn at lines 1851-1860. Move it into one local helper, for example pruneOrderByForRemoved(items: string[]), and call it from both, so the two column-removal paths can't drift apart.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Columns, Sort, and the table actions move onto another line instead of
overlapping when the results panel is narrow.

Co-authored-by: Cursor <cursoragent@cursor.com>
Conflicts were in three test files:
- searchFilters.test.ts and filterSources.test.ts: both sides fixed the same
  lint warnings. Took main's version, so this PR no longer touches them.
- utils.test.ts: kept this PR's imports and dropped
  orderByStringToSortingState and sortingStateToOrderByString, which main
  removed from utils.ts in #3746.

Committed with --no-verify: the pre-commit oxlint check counts every line
merged from main as new and flagged 5 warnings in code this PR does not touch.
The inline edit field was a single-line input, so a long expression such
as a map key with an alias scrolled sideways and was hard to edit. Use an
auto-growing textarea in the same monospace font and wrapping as the row,
and place the caret at the end. Pasted line breaks are collapsed to spaces
because a column is a single expression.
Long column names such as LogAttributes['browser.resource_timing...'] were
clipped in the suggestion list, and the clipped part is the part that
tells similar names apart. Let options wrap and widen the dropdown, capped
to stay inside the popover.
The inline column edit only reached the popover draft on blur, but the
click-outside check runs on mousedown, before blur. A click outside the
popover during an edit therefore closed it with no prompt. Unadded search
text had the same gap.

The edit now lives in ColumnsPopover, so an edit with a changed value and
search text not yet added count as unsaved. Escape in the edit field still
cancels only that edit, as before.

Escape while the suggestion list is open also prompted once search text
counted as unsaved. The list is a sibling of its input, so the Escape check
missed it. The check now also looks for an open listbox in the same popover.
@brandon-pereira

Copy link
Copy Markdown
Member

LGTM - Ideally we should get a second review (cc @teeohhem) plus - can we make sure product is aligned (Mike or Alex) if not already?

@elizabetdev

Copy link
Copy Markdown
Member Author

Thanks, @brandon-pereira. Yes, @alex-fedotyev is aligned on this, and I’ve already shown it to Mike. I’ll wait for @teeohhem’s review.

@elizabetdev
elizabetdev requested review from teeohhem and a balanced review from Copilot and removed request for Copilot November 24, 2026 15:57
@teeohhem

teeohhem commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Found some bugs worth fixing here

1. A saved search can lose its columns and sort

If you click Apply on Columns or Sort without changing anything, the search stores an empty value, because the draft matches the default. On a saved search, that default is the saved search's own clause, so the URL ends up with select= and orderBy= empty. The page still shows the right columns. But adding a tag saves those empty values back to the saved search, and the custom columns and sort are gone.

Steps to reproduce

  1. Open a log search.
  2. In Columns → SQL, set Timestamp, Body and click Apply.
  3. In Sort → SQL, set Body DESC and click Apply.
  4. Click Save and name the search.
  5. On the saved search, open Columns and click Apply without changing anything. Do the same for Sort.
  6. Open the tags button and add a tag.
  7. Reload the page.

Expected: The saved search still shows Timestamp, Body sorted by Body DESC.

Actual: It shows the source's default columns and sort. The stored saved search now has select: "" and orderBy: "".

2. The Apply button covers SQL suggestions

In SQL mode, the Reset / Cancel / Apply row is raised above everything else. The suggestion list from the editor drops down over that row, and the buttons paint on top of it. Some suggestions are hidden, and clicking where one should be clicks Apply instead.

Steps to reproduce

  1. Open Columns and switch to SQL.
  2. Click at the end of the SELECT text and type , Ser.
  3. Look at the suggestion list.
image

Expected: The full list shows and every item can be clicked.

Actual: The Apply button sits on top of the second suggestion. Clicking there applies the clause instead of picking the suggestion.

3. Escape often doesn't close the popover

Escape only works when keyboard focus is inside the popover. Clicking the Columns button leaves focus on the button. Clicking a column's ✕ removes the row that held focus, so focus moves back to the page. In both cases Escape does nothing: it doesn't close the popover and it doesn't ask to discard.

Steps to reproduce

  1. Click Columns to open it.
  2. Press Escape. The popover stays open.
  3. Click the ✕ next to any column.
  4. Press Escape again. Nothing happens, and there's no "Discard unsaved changes?" prompt.

Expected: Escape closes the popover, or asks to discard first when there are unsaved edits.

Actual: Escape is ignored unless you've clicked into a field inside the popover first.

@teeohhem teeohhem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few issues i found while testing

- Save and tag updates keep the saved SELECT and ORDER BY when the URL
  holds an empty value from an unchanged Apply.
- The Update preview shows the same clauses that Update saves.
- Escape closes the Columns and Sort popovers when focus is on the
  toolbar button or the page, and asks first when there are unsaved edits.
- Columns SQL suggestions are no longer covered by the Apply row.
- Sort field suggestions are not clipped by the scrolling rows.
- Sort row remove button lines up with the row inputs.
- Cancel and Apply share one width.
@elizabetdev

Copy link
Copy Markdown
Member Author

Addressed the three issues in this review comment:

  1. Saved search lost its columns and sort. Adding a tag wrote the empty SELECT and ORDER BY from the URL back to the saved search. Tag updates now keep the saved clauses in that case. The Update preview also falls back to the saved clauses, so it shows what Update saves.
  2. Apply row covered SQL suggestions. Removed the footer's max z-index. The suggestion list now shows every item, and each one can be clicked.
  3. Escape did nothing outside the popover. Escape now closes the Columns and Sort popovers when focus is on the toolbar button or the page. If there are unsaved edits, it asks first.

Also in this push:

  • Sort field suggestions use a fixed position, so the scrolling rows no longer clip them.
  • The Sort remove button lines up with the row inputs.
  • Cancel and Apply share one width.

Tests cover each fix. The toolbar and search page suites pass. I have not checked these in a browser yet, so the layout changes need a visual check on the preview.

@github-actions github-actions Bot added review/tier-4 Critical — deep review + domain expert sign-off and removed review/tier-3 Standard — full human review required labels Nov 27, 2026
select: searchedConfig.select ?? '',
// An empty SELECT or ORDER BY in the URL means "the saved clause",
// so writing it back as-is would erase the saved one.
select: searchedConfig.select || savedSearch.select || '',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 P2 — Adding a tag can save the old source's SELECT/ORDER BY under a new source

Only fall back to savedSearch.select/orderBy when savedSearch.source === searchedConfig.source, the same check SaveSearchModalComponent uses (savedClauses, line ~554). Without it, this sequence breaks the saved search: open saved search on source A (select lower(Body) as x), switch the dropdown to source B (line ~1648 sets select/orderBy to '' and submits), then add a tag. The search is saved with source: B and source A's SELECT and ORDER BY. Better still, move the 'effective clause' resolution into one helper and call it from the tag handler, the Save/Update modal, and useSearchedConfigToChartConfig, so the three paths can't drift apart again.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6cdc2b2. Configure here.

inputSourceObj?.kind === SourceKind.Trace
? inputSourceObj.defaultTableSelectExpression
: undefined;
const defaultSelect = savedSelect ?? sourceDefaultSelect ?? '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty saved SELECT hides columns

Medium Severity

defaultSelect uses ??, so a saved search whose select is '' (use the source default) never falls through to sourceDefaultSelect. Columns then shows none while the table still runs the source default. Adding a column from that empty list replaces every default column.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6cdc2b2. Configure here.

searchedConfig.whereLanguage ?? getStoredLanguage() ?? 'lucene',
source: searchedConfig.source ?? '',
orderBy: searchedConfig.orderBy ?? '',
orderBy: searchedConfig.orderBy || savedSearch.orderBy || '',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tags restore clauses after source change

Medium Severity

handleUpdateTags treats a blank select or orderBy as “keep the saved clause” without checking that savedSearch.source still matches searchedConfig.source. After a source switch, empty clauses mean the new source default, so adding a tag writes the old source’s columns and sort onto the new source.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6cdc2b2. Configure here.

@elizabetdev
elizabetdev requested a review from teeohhem November 27, 2026 19:11

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — 6cdc2b29 Deployed Nov 27, 2026 by vercel[bot]
Preview – hyperdx-storybook — 6cdc2b29 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-4 Critical — deep review + domain expert sign-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants