Skip to content

feat: Support import/export for dashboard onClicks#2148

Open
pulpdrew wants to merge 1 commit intomainfrom
drew/dashboard-linking-import
Open

feat: Support import/export for dashboard onClicks#2148
pulpdrew wants to merge 1 commit intomainfrom
drew/dashboard-linking-import

Conversation

@pulpdrew
Copy link
Copy Markdown
Contributor

@pulpdrew pulpdrew commented Apr 22, 2026

Summary

This is the fourth in a series of PRs adding customizable on-click / linking behaviors to dashboard tables.

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: Dashboards with on-click behaviors that reference other dashboards or sources by ID can now be exported and imported.

Note: we do not currently support editing template-based mappings during import. Those are of course editable after importing.

Not included yet

Future PRs will add:

  • Passing templated filter values to the destination dashboard or search
  • 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.5.01.21.PM.mov

How to test locally or on Vercel

This can be tested in the preview environment

References

  • Linear Issue: Closes HDX-4091
  • 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 2:53am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: 2e4ef50

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

@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-linking-import branch from 50c116c to 15232c6 Compare April 23, 2026 20:56
@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-linking-import branch from 15232c6 to 2e4ef50 Compare April 27, 2026 02:50
@pulpdrew pulpdrew marked this pull request as ready for review April 27, 2026 02:50
@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

🟡 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: 4
  • Production lines changed: 477 (+ 574 in test files, excluded from tier calculation)
  • Branch: drew/dashboard-linking-import
  • 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

PR Review

✅ No critical issues found.

Notes (non-blocking):

  • ⚠️ useDashboards() added to DBDashboardPage.tsx to support export — this fetches all dashboards on every dashboard page load. With TanStack Query caching this is a one-time network hit per session, so not a hard problem, but worth confirming the cache TTL is acceptable for large workspaces with many dashboards.

  • ⚠️ onSubmit still has pre-existing non-null assertions (connection!.id, source!.id) that would throw at runtime if a user submits without selecting a mapping. Not introduced by this PR, but the new applyOnClick path silently drops unmapped onClicks — the asymmetry is a bit surprising. Consistent behavior (drop vs. throw) across all mapping types would be cleaner.

  • The convertOnClickTargetIdToName mutation pattern (delete config.onClick) is safe because tileConfig is from a structuredClone, but the function signature (config: SavedChartConfig) doesn't signal mutability. A pure return-based approach would be clearer.

Positives:

  • @ts-ignore@ts-expect-error upgrade is good hygiene.
  • E2E test coverage is thorough (propagation, drop behavior, search vs. dashboard onClick).
  • The "drop onClick if unmapped" behavior is well-documented and tested.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Test Results

All tests passed • 163 passed • 3 skipped • 1196s

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

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew pulpdrew requested a review from teeohhem April 27, 2026 04:15
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