Skip to content

Conversation

@aMayzner
Copy link
Member

Summary

Adds support for filtering data grid columns by selecting from distinct values. The feature adds "Filter equal to..." and "Filter not equal to..." menu items that fetch and display up to 100 distinct values from the current dataset. The menu includes a search box for columns with many values and respects existing filters/sorting.

Changes

  • Added optional getDistinctValues() method to DataGridDataSource interface
  • Implemented getDistinctValues() in both SQLDataSource and InMemoryDataSource
  • Created DistinctValuesFilterMenu component with search, loading states, and value caching
  • Extracted compareSqlValues() utility function for consistent sorting across datagrid codebase
  • Added caching layer to avoid re-fetching values for the same query state

@aMayzner aMayzner requested a review from a team as a code owner November 24, 2025 12:18
@aMayzner aMayzner enabled auto-merge (squash) November 24, 2025 12:18
@aMayzner aMayzner requested a review from stevegolton November 24, 2025 12:18
@github-actions
Copy link

github-actions bot commented Nov 24, 2025

🎨 Perfetto UI Build

✅ UI build is ready: https://storage.googleapis.com/perfetto-ci-artifacts/gh-19678478973-ui/ui/index.html

const MAX_DISPLAY_STRING_LENGTH = 50;
const SEARCH_BOX_THRESHOLD = 10;

interface DistinctValuesFilterMenuAttrs {
Copy link
Member

Choose a reason for hiding this comment

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

This is subjective but this component feels a bit too interested in its parent state. Maybe it would be better off as a render() function inside the main DataGrid component so you're having to do a lot of prop drilling.

@aMayzner aMayzner force-pushed the dev/mayzner/datagrid-distinct branch from 808f36f to 6161e51 Compare November 25, 2025 17:29
@aMayzner aMayzner requested a review from stevegolton November 25, 2025 17:42
@aMayzner aMayzner closed this Nov 28, 2025
auto-merge was automatically disabled November 28, 2025 18:17

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants