Skip to content

feat: Add filter templating to custom dashboard on-click#2146

Open
pulpdrew wants to merge 4 commits intomainfrom
drew/dashboard-filter-linking
Open

feat: Add filter templating to custom dashboard on-click#2146
pulpdrew wants to merge 4 commits intomainfrom
drew/dashboard-filter-linking

Conversation

@pulpdrew
Copy link
Copy Markdown
Contributor

@pulpdrew pulpdrew commented Apr 22, 2026

Summary

This is the third in a series of PRs adding customizable on-click / linking behaviors to dashboard tables. This PR extends the custom dashboard table onClick behavior from #2140.

This feature is behind the NEXT_PUBLIC_IS_DASHBOARD_LINKING_ENABLED, which has been enabled in the preview environment and for local development.

Scope

In this PR:

  • Links can now include templated filter values, to set filters on the target dashboard or search page.
  • The dashboard page now has a warning banner when the URL contains a filter expression which is ignored because there is no corresponding filter defined on the dashboard.

Not included yet

Future PRs will add:

  • Update dashboard import to support link source and dashboard ID mappings
  • Updates to the external API to support the new onClick fields
  • Updates to the MCP prompts to support generating dashboards with custom links
  • Updates to the import flow to support importing bundles of linked dashboards at once
  • Support for linking on other visualization types

Screenshots or video

Screen.Recording.2026-04-23.at.4.58.18.PM.mov

How to test locally or on Vercel

This can be tested in the preview environment

References

  • Linear Issue: Closes HDX-4065
  • Related PRs:

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

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

Project Deployment Actions Updated (UTC)
hyperdx-oss Ready Ready Preview, Comment Apr 27, 2026 4:06am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: d806f59

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

This PR includes changesets to release 4 packages
Name Type
@hyperdx/common-utils Patch
@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

enableMapSet();

describe('searchFilters', () => {
describe('filtersToQuery', () => {
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.

filtersToQuery and its tests have been moved to common-utils

@pulpdrew pulpdrew force-pushed the drew/dashboard-dashboard-linking branch 3 times, most recently from 8902ef4 to 7f746b7 Compare April 23, 2026 18:23
@pulpdrew pulpdrew force-pushed the drew/dashboard-filter-linking branch from ca2be83 to de0c501 Compare April 23, 2026 20:40
@pulpdrew pulpdrew changed the base branch from drew/dashboard-dashboard-linking to main April 27, 2026 02:34
@pulpdrew pulpdrew force-pushed the drew/dashboard-filter-linking branch from de0c501 to 226d4ff Compare April 27, 2026 02:48
@pulpdrew pulpdrew marked this pull request as ready for review April 27, 2026 02:48
@github-actions github-actions Bot added the review/tier-3 Standard — full human review required label Apr 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

🟡 Tier 3 — Standard

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

Why this tier:

  • Cross-layer change: touches frontend (packages/app) + shared utils (packages/common-utils)

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

Stats
  • Production files changed: 12
  • Production lines changed: 481 (+ 879 in test files, excluded from tier calculation)
  • Branch: drew/dashboard-filter-linking
  • Author: pulpdrew

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
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

PR Review

  • ⚠️ OnClickFilterTemplateSchema sets template: z.string().min(1) but handleTargetChange auto-populates rows with template: '' and FilterTemplateList.append also initializes with template: ''. Zod will block form submission, but validation errors may not surface per-field until the user tries to submit — consider triggering validation on the auto-populated rows or using z.string() (allow empty) and validating only on submit with a custom check.

  • ⚠️ handleTargetChange only auto-populates filter rows from the target dashboard when allTemplatesEmpty. If the user fills one template and then changes the target dashboard, no auto-population occurs — they're left with stale expression names from the previous target but no indication to update them. This could silently misconfigure filters with mismatched expressions. Consider clearing/repopulating whenever the target changes (with a confirmation prompt if templates are non-empty), or at minimum document this behavior in the UI.

  • filtersToQuery correctly escapes single quotes in filter values. Column expression values are trusted (dashboard-author-set), which is consistent with the existing WHERE template trust model — not a new concern.

  • ignoredFilterExpressions banner latch (intentional eslint-disable on the useEffect dep array) is well-documented and correctly prevents flash during dashboard navigation.

  • ✅ Clean refactor of FilterState/filtersToQuery to common-utils with full test migration. Unit + E2E coverage is solid.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

E2E Test Results

All tests passed • 162 passed • 3 skipped • 1283s

Status Count
✅ Passed 162
❌ Failed 0
⚠️ Flaky 4
⏭️ Skipped 3

Tests ran across 4 shards in parallel.

View full report →

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.

1 participant