Skip to content

Mount Columns and Sort on the search page - #3432

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

elizabetdev wants to merge 18 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.

The editors landed in #3431.

Screenshots were not captured.

Screenshots or video

Before After

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. 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

@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 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 783 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

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

To override this classification, remove the review/tier-3 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 107 in total (1.14%).
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

No inline comments. 1 P3 folded at the bottom. 1 unchanged from an earlier push (already inline above).

🔵 1 P3 — no action needed before merge
  • 🔵 P3 packages/app/src/__tests__/DBSearchPage.directTrace.test.tsx:466 — No test covers how the page wires Columns Apply to the sort → Both page suites stub ColumnsPopover/SortPopover as <div /> or stub their options. Nothing checks that applySelect passes select || defaultSelect and defaultOrderBy into orderByAfterRemovingSelectItems, or that it then submits. If that wiring broke (for example the defaultSelect fallback were dropped), the utils tests would still pass. Add a DBSearchPage test that calls the real ColumnsPopover onApply (or captures the props passed to a mock) and asserts the orderBy written to the form.

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 • 475 passed • 1 skipped • 1257s

Status Count
✅ Passed 475
❌ Failed 0
⚠️ Flaky 2
⏭️ 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

Scope: PR #3432 — moves SELECT/ORDER BY editing off the query form into Columns/Sort popovers mounted on the results-table toolbar (packages/app/src, packages/app/styles). Base 743c3c1a. Report-only.

Intent: On a results search, Columns and Sort sit on the table and edit those clauses; Event Deltas/Patterns hide them; narrow forms stack the where-clause above the time controls; removing a column drops a now-dangling sort on its alias.

✅ No critical issues found. The previously-flagged P1 "removed columns leave broken sorts" is genuinely fixed and well-tested: orderByAfterRemovingSelectItems strips bare, double-quoted, and backtick alias references (orderByWithoutAliases + sortKeyName), preserves aliases the new-or-default SELECT still defines (selectItemsWithRemovedAlias against select || defaultSelect), and falls back saved-sort → source-default correctly. utils.test.ts covers these paths including the backtick-comma and multi-alias cases. The prior P2 toolbar-overlap and silent-discard concerns are also addressed (wrapping toolbar, confirm-on-discard via useConfirm, Escape delegated to nested completion lists).

🟡 P2 — recommended

  • packages/app/src/DBSearchPage.tsx:2360 — The new page-level wiring that unit tests do not reach has no direct assertion: applyOrderBy triggering a search (onSubmit) and the controlsAboveTable toolbar rendering resultsClauseEditors above the table. The alias helpers are unit-tested and e2e specs changed, but the author notes DBSearchPage suites stub ColumnsPopover, leaving the Sort-apply and above-table mount paths unverified at any level.
    • Fix: Add one component/integration test asserting Sort Apply calls onApply/submits and that controlsAboveTable renders the toolbar row above the table.
🔵 P3 nitpicks (2)
  • packages/app/src/components/SearchResultsToolbar/ClausePopover.tsx:141 — If the popover unmounts while the discard-confirm is pending (e.g. switching analysisMode away from results sets resultsClauseEditors to null), the resolved .then calls setOpened on a stale instance and the dirty draft is dropped without the confirm resolving. Impact is low (React 18 tolerates the late setState; the dialog comes from a global provider).
    • Fix: Guard the .then with a mounted ref, or cancel the pending confirm on unmount.
  • packages/app/src/utils.ts:1349 — orderByAfterRemovingSelectItem (singular) is a thin one-argument wrapper over the plural variant; both are exported and separately tested, a small amount of surface area to keep in sync.
    • Fix: Consider collapsing callers onto the plural form, or keep the wrapper if the single-item call site reads clearer.

Review dimensions applied: correctness, adversarial, TypeScript, frontend-races, testing, maintainability, previous-comments, project-standards.

Testing gaps: No direct assertion for applyOrderBy→search submission or the controlsAboveTable above-table toolbar; both rely indirectly on e2e. Alias-stripping helpers and prior P1 regression are well covered in utils.test.ts.

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: a307dc2

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 18, 2026 4:58pm UTC
hyperdx-storybook Ready Ready Preview Nov 18, 2026 4:58pm 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>
Comment thread packages/app/src/DBSearchPage.tsx Outdated
// is shown as this default, so it has to follow the dropdown, the same way
// the sort default follows useDefaultOrderBy(inputSource).
const savedSelect =
savedSearchId &&

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 — Default SELECT is now worked out in two places that can disagree

savedSelect/sourceDefaultSelect repeat the saved-search guards and the Log/Trace defaultTableSelectExpression lookup from defaultSearchConfig (lines 1215-1238). The only difference is that this copy keys off inputSourceObj while the original keys off searchedSource. Table-header column removal (displayedColumns/toggleColumn, line 1837) and the Columns popover therefore start from different defaults until the debounced submit catches up. Fix: derive the default SELECT once (or have defaultSearchConfig.select follow the input source) and use that value in both places.

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

</>
);
};
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 copies toggleColumn's sort-pruning logic

The loop that calls orderByAfterRemovingSelectItem(item, getValues('orderBy'), defaultSearchConfig.orderBy) and then writes orderBy repeats toggleColumn (lines 1856-1866). The two paths that remove a column can drift apart. Fix: move 'set the select, prune the sort for removed items, submit' into one callback and call it from both places.

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

</>
);
};
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 — The page-level apply logic has no test

Both DBSearchPage suites mock ColumnsPopover, SortPopover and useClauseFieldOptions with stubs. Nothing checks that applying Columns writes select, drops removed aliases from orderBy (falling back to the default sort), and submits, or that Sort writes orderBy. Fix: add a page-level test with a real (or callback-capturing) ColumnsPopover that calls onApply with removed items, then assert the submitted orderBy.

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

Comment thread packages/app/src/utils.ts Resolved
// The SQL completion list overflows the editor onto these buttons.
// Fields mode uses an in-popover Autocomplete, which must stay above them.
style={
mode === 'sql'

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 — In SQL mode the button row covers the autocomplete list

Giving the Reset/Cancel/Apply row z-index: var(--mantine-z-index-max) in SQL mode puts it above the CodeMirror completion list. Suggestions that overflow onto that row are hidden and can't be clicked. The new e2e applyClause helper has to work around this. Fix: give the popover body enough room, or let the completion tooltip render above the footer (e.g. portal it or position it above the editor), instead of burying it.

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

Comment thread packages/app/src/DBSearchPage.tsx Resolved
@elizabetdev

Copy link
Copy Markdown
Member Author

The P1 in the summary above is fixed. Removing upper(Body) AS message now also drops a sort written as message DESC, not only "message" DESC. Backtick-quoted aliases are covered too. That landed in 977658f, and the review thread is resolved.

This summary still describes the October 26 review (db862a02).

The popovers had a fixed 440px width, so on a phone the dropdown ran past
the right edge and clipped Apply. Cap the width to the viewport and let
shift slide the dropdown left of the button when there is not enough room
on the right.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/app/src/DBSearchPage.tsx Resolved
Comment thread packages/app/src/DBSearchPage.tsx Resolved
Comment thread packages/app/src/DBSearchPage.tsx Outdated
inputSourceObj?.kind === SourceKind.Trace
? inputSourceObj.defaultTableSelectExpression
: undefined;
const defaultSelect = savedSelect ?? sourceDefaultSelect ?? '';

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 — defaultSelect re-implements the saved-search/source default from defaultSearchConfig.select

Lines 1215-1238 already gate on savedSearchId, savedSearch id, and source, then fall back to defaultTableSelectExpression. The copy differs only in using inputSourceObj instead of searchedSource, so there are now two hand-synced definitions of 'the default SELECT'. Fix: derive both from one helper that takes the source object, or add an inputSelect field to the defaultSearchConfig memo.

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

Comment thread packages/app/src/DBSearchPage.tsx Resolved
findByTestId does not take a hidden option in this Testing Library, so the
lint job's type check failed on the new assertion.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/app/src/DBSearchPage.tsx Outdated
inputSourceObj?.kind === SourceKind.Trace
? inputSourceObj.defaultTableSelectExpression
: undefined;
const defaultSelect = savedSelect ?? sourceDefaultSelect ?? '';

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 — Default SELECT is now worked out in two places that must stay in sync

savedSelect/sourceDefaultSelect repeat the saved-search checks (id match, source match) and the Log/Trace defaultTableSelectExpression fallback from defaultSearchConfig (DBSearchPage.tsx:1215-1238). The only difference is which source is used: inputSourceObj here, searchedSource there. Move this into one helper that takes the source, e.g. resolveDefaultSelect(savedSearch, savedSearchId, source), and call it from both places so a future change to the default rules updates both.

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

</>
);
};
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 copies toggleColumn's logic for dropping sorts on removed columns

The getValues('orderBy') → orderByAfterRemovingSelectItem(..., defaultSearchConfig.orderBy) steps are the same ones toggleColumn already runs at DBSearchPage.tsx:1856-1866. Add a shared orderByAfterRemovingSelectItems(items, orderBy, default) in utils.ts and call it from both. Also skip the unconditional setValue('orderBy', ...) when the value did not change, as toggleColumn does.

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

</>
);
};
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 — No test covers the new page wiring (applySelect / applyOrderBy / defaultSelect)

Both DBSearchPage suites mock ColumnsPopover, SortPopover and useClauseFieldOptions as empty stubs, so none of the code this PR adds to the page runs: dropping sorts on removed columns, falling back to the default sort, and choosing defaultSelect when the dropdown source differs from the searched one. Add a page-level test that runs onApply with removed items and checks the submitted orderBy/select.

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

- Escape closed the popover and asked to discard a dirty SQL draft even
  when it was only meant to dismiss the completion list. Let CodeMirror
  take Escape while a completion is open.
- A saved search's sort is also the fallback sort, so removing an aliased
  column could restore the alias it just dropped. Strip removed aliases
  from the fallback too, and handle several removed items in one pass.
- The Columns and Sort elements were rebuilt on every page render, so each
  where keystroke handed the results table a new element and defeated its
  memo. Memoize them.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/app/src/utils.ts Resolved
…is empty

An empty form ORDER BY means "use the saved sort". The helper treated the
empty string as already clean, so removing an aliased column after
resetting Sort left the saved alias sort in the query and it failed on an
unknown identifier. Run the empty case through the same alias removal.

Co-authored-by: Cursor <cursoragent@cursor.com>
The popover handles Escape before the input does, so closing the column
or sort suggestions also closed the popover and dropped the text that had
not been added yet. Skip that close while the suggestion list is open.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/app/src/DBSearchPage.tsx Resolved
Changing an aliased column's expression or the case of AS (for example upper(Body) AS message to lower(Body) AS message) counted the old item as removed. The sort on the alias was then dropped even though the alias was still selected. Ignore a removed item whose alias is still in the new SELECT.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread packages/app/src/DBSearchPage.tsx Resolved
wrap="wrap"
// The SQL completion list overflows the editor onto these buttons.
// Fields mode uses an in-popover Autocomplete, which must stay above them.
style={

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 — SQL-mode footer at max z-index covers the completion entries it overlaps

The comment says the CodeMirror completion list spills onto the footer. Raising the Reset/Cancel/Apply row to --mantine-z-index-max puts those buttons on top of the list (.cm-tooltip is z-index 100 in the same dropdown stacking context). On a short Sort editor, completion entries under the buttons can't be seen or clicked. Keep the footer below the tooltip. If Apply has to stay clickable, use tooltips({ position: 'fixed', parent }) or reserve space under the editor instead of stacking the buttons over the list.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not changing this. Apply has to stay reachable when the completion list is open, so the footer stays above the list. Raising the .cm-tooltip above it would also cover the Reset/Cancel/Apply row. Left as is.

if (availableWidth > 0) {
elements.floating.style.maxWidth = `${availableWidth}px`;
}
if (availableHeight > 0) {

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 — maxHeight from the size middleware has no effect without overflow

Mantine's Popover.Dropdown sets no overflow. Content taller than availableHeight therefore spills past the capped box, and on a short viewport Apply still ends up off screen. Add overflowY: 'auto' to the dropdown, or to an inner scroll wrapper that excludes the footer, so the cap actually keeps Apply reachable.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not changing this. Adding overflow: auto to the dropdown clips the Fields autocomplete and the SQL completion list, which was the earlier overflow thread. The height cap keeps the popover inside the viewport; the list itself can still extend past the popover's box. Left as is.

Apply stores an empty SELECT when the draft matches the default. The alias check then read no aliases from the new SELECT and dropped a sort on an alias the default still defines. Check against the effective SELECT instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — a307dc27 Deployed Nov 18, 2026 by vercel[bot]
Preview – hyperdx-storybook — a307dc27 Deployed Nov 18, 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-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants