Skip to content

feat: Add a search input that searches within virtual elements#1598

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
fleon/hdx-2687
Jan 22, 2026
Merged

feat: Add a search input that searches within virtual elements#1598
kodiakhq[bot] merged 1 commit into
mainfrom
fleon/hdx-2687

Conversation

@fleon
Copy link
Copy Markdown
Contributor

@fleon fleon commented Jan 14, 2026

Add a separate search input triggered by Cmd+F that searches through all matches currently on the page, overriding the native browser search that only searches within visible rows.

Fixes HDX-2687

Video

CleanShot.2026-01-16.at.13.06.57.mp4

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jan 14, 2026

🦋 Changeset detected

Latest commit: ce1d488

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

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Minor
@hyperdx/api 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
Copy link
Copy Markdown

vercel Bot commented Jan 14, 2026

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

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 22, 2026 6:24pm

Request Review

@claude
Copy link
Copy Markdown

claude Bot commented Jan 14, 2026

PR Review

No critical issues found.

The implementation is well-structured with:

  • Proper React patterns (custom hook separation, memoization)
  • Good test coverage (~1900 lines of tests)
  • Safe text rendering (no XSS risk - React escapes text by default)
  • Debounced search to avoid performance issues
  • Proper accessibility attributes (ARIA labels, roles)

Minor observations (non-blocking):

Performance consideration → The search performs O(rows × columns) on every query change. For very large datasets (>10k rows), consider adding a max search limit or pagination warning.

📝 useEffect dependency array (line 477 in DBRowTable.tsx) → eslint-disable comment suggests potential dependency issue. The effect depends on tableSearch object properties but disables exhaustive-deps. Consider destructuring only needed properties at the hook call site.

Overall: Good to merge. The feature is well-implemented with comprehensive tests and follows React best practices.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 14, 2026

E2E Test Results

All tests passed • 59 passed • 4 skipped • 791s

Status Count
✅ Passed 59
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a custom search input feature that searches through virtualized table rows on the log search page, overriding the browser's native Ctrl/Cmd+F behavior that only searches visible content.

Changes:

  • Adds a custom hook to manage table search state, match tracking, and keyboard navigation
  • Creates UI components for a floating search input and visual match indicators
  • Integrates the search functionality into the DBRowTable component with highlighting and auto-scroll

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/app/src/hooks/useTableSearch.ts Custom hook managing search state, debouncing, match indices, and navigation callbacks
packages/app/src/hooks/__tests__/useTableSearch.test.tsx Comprehensive test suite for the useTableSearch hook covering initialization, search, navigation, and edge cases
packages/app/src/components/DBTable/__tests__/TableSearchInput.test.tsx Test suite for TableSearchInput and TableSearchMatchIndicator components including accessibility and keyboard shortcuts
packages/app/src/components/DBTable/TableSearchInput.tsx UI components for search input with keyboard shortcuts, match navigation, and scrollbar indicators
packages/app/src/components/DBRowTable.tsx Integration of search functionality with highlighting, auto-scroll, and state management
.changeset/eight-bobcats-press.md Changeset documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +3
import React from 'react';
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The test file references a renderWithMantine helper function (lines 177, 206, etc.) but it is not imported. This helper is used throughout the tests but is missing from the imports, which would cause test failures.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

renderWithMantine is a global function defined in packages/app/src/setupTests.tsx.

Comment on lines +916 to +918
onClick={() =>
setWrapLinesEnabled(prev => !prev)
}
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

This formatting change splits the onClick handler across multiple lines unnecessarily. The original single-line format was more concise and equally readable for this simple arrow function.

Suggested change
onClick={() =>
setWrapLinesEnabled(prev => !prev)
}
onClick={() => setWrapLinesEnabled(prev => !prev)}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was done by prettier

@fleon
Copy link
Copy Markdown
Contributor Author

fleon commented Jan 16, 2026

@dhable Could you please review? I've tried to keep the changes in existing files small, and abstracted most of the functionality into a separate component. The PR is large primarily because of unit tests, which were primarily written by Claude, but I've validated them all.

@claude
Copy link
Copy Markdown

claude Bot commented Jan 16, 2026

PR Review

Critical Issues

None found - the implementation looks solid.

Important Observations

✅ Security: No XSS vulnerabilities - text is properly escaped through React's JSX rendering

✅ Performance: Debouncing (300ms) and case-insensitive search are well-implemented

✅ Accessibility: Good ARIA labels and keyboard navigation (Cmd+F, Enter, Shift+Enter, Escape)

✅ Testing: Comprehensive test coverage with 1927 lines of tests across both components

Minor Considerations

⚠️ Performance at scale: The search iterates through ALL rows without pagination limits. With virtual scrolling, this could be slow on very large datasets (e.g., 10k+ rows). Consider:

  • Adding an early exit or max rows limit for search
  • Or showing a warning when searching large datasets

⚠️ Duplicate useEffect dependencies: Line 748 in DBRowTable.tsx has eslint-disable for exhaustive-deps. The dependency array looks complete, so this may be unnecessary.

Summary

This is a well-implemented feature with good test coverage, proper security, and accessibility. The only concern is performance on extremely large datasets, but this may be acceptable for the current use case. The eslint-disable comment should be reviewed to ensure it's necessary.

Recommendation: ✅ Approve with optional performance optimization for very large datasets.

@kodiakhq
Copy link
Copy Markdown
Contributor

kodiakhq Bot commented Jan 21, 2026

This PR currently has a merge conflict. Please resolve this and then re-add the automerge label.

@kodiakhq kodiakhq Bot removed the automerge label Jan 21, 2026
dhable
dhable previously approved these changes Jan 22, 2026
Add a separate search input triggered by Cmd+F that searches through all matches
currently on the page, overriding the native browser search that only searches within
visible rows.
@kodiakhq kodiakhq Bot merged commit 9f51920 into main Jan 22, 2026
12 of 13 checks passed
@kodiakhq kodiakhq Bot deleted the fleon/hdx-2687 branch January 22, 2026 18:24
@github-actions github-actions Bot mentioned this pull request Jan 28, 2026
knudtty pushed a commit that referenced this pull request Apr 16, 2026
Add a separate search input triggered by Cmd+F that searches through all matches currently on the page, overriding the native browser search that only searches within visible rows.

Fixes HDX-2687

### Video


https://github.com/user-attachments/assets/beaab78f-e96c-4698-86b7-a4ee3540db1b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants