Skip to content

feat: Add Column toggle button to filter panel in DBSearchPage#1947

Merged
kodiakhq[bot] merged 4 commits intomainfrom
cursor/HDX-3770-column-from-filter-panel-fdf0
Mar 23, 2026
Merged

feat: Add Column toggle button to filter panel in DBSearchPage#1947
kodiakhq[bot] merged 4 commits intomainfrom
cursor/HDX-3770-column-from-filter-panel-fdf0

Conversation

@MikeShi42
Copy link
Copy Markdown
Contributor

Summary

Adds a column toggle button (+ / - icon) next to the "Show Distribution" button in each filter group header on the search page. Clicking the button adds or removes the filter's field from the SELECT statement, and the table reflects the change immediately.

Changes

  • FilterGroup (DBSearchPageFilters.tsx): Added onColumnToggle and isColumnDisplayed props. Renders an ActionIcon with IconPlus (add) or IconMinus (remove) between the distribution toggle and the pin field button.
  • NestedFilterGroup: Passes the new column toggle props through to child FilterGroup components.
  • DBSearchPage.tsx: Passes toggleColumn and displayedColumns to DBSearchPageFilters, reusing the existing toggleColumn callback that manages the SELECT form field.

Screenshots or video

Before After
Only distribution and pin buttons in filter header New +/- column button appears between distribution and pin buttons

How to test locally or on Vercel

  1. Navigate to the Search page
  2. Open the filter panel on the left side
  3. Find any filter group and hover over the header area — a + icon should appear next to the distribution chart icon
  4. Click the + icon — the field should be added to the SELECT input and appear as a column in the results table
  5. Click the - icon (now shown since the column is displayed) — the field should be removed from SELECT and the column disappears

References

  • Linear Issue: HDX-3770

Linear Issue: HDX-3770

Open in Web Open in Cursor 

Add a +/- icon button next to the show distribution button in each
FilterGroup header. Clicking the button adds or removes the filter's
field from the SELECT statement, reflecting immediately in the table.

- Add onColumnToggle and isColumnDisplayed props to FilterGroup
- Pass toggleColumn and displayedColumns from DBSearchPage through
  DBSearchPageFilters and NestedFilterGroup to each FilterGroup
- Show IconPlus when column is not displayed, IconMinus when it is
- Include tooltip (Add Column / Remove Column) for discoverability

Co-authored-by: Mike Shi <mike@hyperdx.io>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 19, 2026

🦋 Changeset detected

Latest commit: b1ae829

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 Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

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 Mar 19, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Mar 23, 2026 3:21pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

E2E Test Results

All tests passed • 91 passed • 3 skipped • 967s

Status Count
✅ Passed 91
❌ Failed 0
⚠️ Flaky 2
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

@MikeShi42 MikeShi42 marked this pull request as ready for review March 21, 2026 07:02
@MikeShi42 MikeShi42 requested review from a team and dhable and removed request for a team March 21, 2026 07:02
Co-authored-by: Mike Shi <mike@hyperdx.io>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 21, 2026

PR Review

✅ No critical issues found.

The implementation is clean and consistent with existing patterns:

  • ActionIcon styling (size="xs", variant="subtle", color="gray") matches the adjacent distribution and pin buttons exactly
  • Prop threading through NestedFilterGroupFilterGroup correctly wraps (column: string) => void into VoidFunction at the leaf level
  • isColumnDisplayed correctly defaults to falsy (shows +) when displayedColumns is undefined

One minor observation: the distributionKey JSDoc comment was silently dropped (// Optional key to use for distribution queries, defaults to name). Not blocking, but worth noting if it carried useful context for contributors.

@dhable
Copy link
Copy Markdown
Contributor

dhable commented Mar 23, 2026

@claude add a changeset

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 23, 2026

Claude finished @dhable's task in 37s —— View job


Changeset added

  • Gather context
  • Create changeset file (.changeset/hdx-3770-column-from-filter-panel.md)
  • Commit and push

Added a patch changeset for @hyperdx/app describing the column toggle button feature.

Co-authored-by: Dan Hable <dhable@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Knip - Unused Code Analysis

0 change in total issues (240 on main → 240 on PR)

Category main PR Diff
Unused files 9 9 0
Unused dependencies 14 14 0
Unused devDependencies 20 20 0
Unlisted dependencies 14 14 0
Unresolved imports 2 2 0
Unlisted binaries 2 2 0
Unused exports 132 132 0
Unused exported types 41 41 0
Unused enum members 2 2 0
Duplicate exports 4 4 0
What is this?

Knip finds unused files, dependencies, and exports in your codebase.
This comment compares the PR branch against main to detect regressions.

Run yarn knip locally to see full details.

@kodiakhq kodiakhq bot merged commit c9d1dda into main Mar 23, 2026
14 of 15 checks passed
@kodiakhq kodiakhq bot deleted the cursor/HDX-3770-column-from-filter-panel-fdf0 branch March 23, 2026 15:22
knudtty pushed a commit that referenced this pull request Apr 16, 2026
## Summary

Adds a column toggle button (+ / - icon) next to the "Show Distribution" button in each filter group header on the search page. Clicking the button adds or removes the filter's field from the `SELECT` statement, and the table reflects the change immediately.

### Changes

- **`FilterGroup`** (`DBSearchPageFilters.tsx`): Added `onColumnToggle` and `isColumnDisplayed` props. Renders an `ActionIcon` with `IconPlus` (add) or `IconMinus` (remove) between the distribution toggle and the pin field button.
- **`NestedFilterGroup`**: Passes the new column toggle props through to child `FilterGroup` components.
- **`DBSearchPage.tsx`**: Passes `toggleColumn` and `displayedColumns` to `DBSearchPageFilters`, reusing the existing `toggleColumn` callback that manages the `SELECT` form field.

### Screenshots or video

| Before | After |
| :----- | :---- |
| Only distribution and pin buttons in filter header | New +/- column button appears between distribution and pin buttons |

### How to test locally or on Vercel

1. Navigate to the Search page
2. Open the filter panel on the left side
3. Find any filter group and hover over the header area — a `+` icon should appear next to the distribution chart icon
4. Click the `+` icon — the field should be added to the `SELECT` input and appear as a column in the results table
5. Click the `-` icon (now shown since the column is displayed) — the field should be removed from `SELECT` and the column disappears

### References

- Linear Issue: HDX-3770



Linear Issue: [HDX-3770](https://linear.app/clickhouse/issue/HDX-3770/telstra-add-column-from-filter-panel-in-dbsearchpage)

<div><a href="https://cursor.com/agents/bc-11d702b5-a58e-485c-982f-61d990e45091"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-11d702b5-a58e-485c-982f-61d990e45091"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>



Co-authored-by: Cursor Agent <199161495+cursoragent@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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