Skip to content

feat(app): shareable fullscreen dashboard tile via URL param - #3871

Open
MikeShi42 wants to merge 10 commits into
mainfrom
cursor/shareable-fullscreen-tile-2ffe
Open

MikeShi42 wants to merge 10 commits into
mainfrom
cursor/shareable-fullscreen-tile-2ffe

Conversation

@MikeShi42

@MikeShi42 MikeShi42 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

You could open a dashboard tile in fullscreen, but you couldn't share that view. The state lived in each tile's local React state. To share one panel, you had to build a separate dashboard that held only that panel.

The fullscreen tile now lives in a fullscreenTileId query param. It uses the same nuqs mechanism as the other dashboard URL state (highlightedTileId, activeTabs, collapsed, from/to, granularity, where).

  • Opening and closing: The toolbar button, the menu item and the f shortcut all set the param. Close, Esc and f clear it. Other params are left as they are.
  • Back/forward: The params use history: 'push', so back and forward step through fullscreen picker changes and open and close the view.
  • Shared links: A link opens straight into fullscreen, with the range and granularity the sender picked there.
  • Hidden tiles: If the linked tile is in a collapsed group or an inactive tab, the group is expanded or the tab is switched so the tile can mount. The modal renders inside the tile.
  • Unknown tile IDs: A tile ID that matches no tile shows the normal dashboard.

The range and granularity picked inside the fullscreen view are in the URL too, as fullscreenFrom, fullscreenTo and fullscreenGranularity, so a link reopens the exact window the sender was looking at. They are kept apart from the dashboard's own from/to and granularity: changing them refetches only the fullscreen tile, not every tile on the dashboard, and the dashboard's pickers don't change. Without them, the view starts from the dashboard's range and granularity and follows them if they change while it is open, except on a live dashboard, where it keeps the range it opened with (including while the browser tab is hidden). Closing the view clears all four fullscreen params.

Screenshots or video

The UI chrome is unchanged; what changed is the URL behavior. On main the same modal opens, but the URL never changes, so the view can't be linked.

Before After
On main, a ?fullscreenTileId=… link opens the normal dashboard Fullscreen tile opened from a link

Opening a link, closing, then back and reload (2x slowed e2e run, recorded before the fullscreen range params were added):
fullscreen-deep-link.mp4

Back/forward toggling:
fullscreen-back-forward.mp4

A link to a tile in a collapsed group and in an inactive tab:
fullscreen-collapsed-and-tab.mp4

How to reproduce

Starting point: yarn app:dev:local connected to the demo server, or the Vercel preview. Use any dashboard with at least one tile.

On main:

  1. Hover a tile and click the fullscreen icon ("View fullscreen (f)").
  2. The URL does not change. Copying it and opening it in a new tab shows the normal dashboard.

On this branch:

  1. Hover a tile and click the fullscreen icon. The URL gains fullscreenTileId=<tile id>, and from/to/granularity/where are unchanged.
  2. In the fullscreen view, pick "Last 15 minutes" and "1 Minute Granularity". The URL gains fullscreenFrom, fullscreenTo and fullscreenGranularity. The dashboard's own params stay the same.
  3. Copy the URL and open it in a new tab. The same tile opens in fullscreen with that range and granularity.
  4. Press Esc. The fullscreen params are removed. Press browser back to reopen the tile, and forward to close it.
  5. Change fullscreenTileId in the URL to a nonexistent value. The normal dashboard shows.

How to test on Vercel preview

Preview routes: /dashboards

Steps:

  1. Create a dashboard and add a tile.
  2. Hover the tile and click the "View fullscreen (f)" icon.
  3. Verify the URL contains fullscreenTileId= and the fullscreen view is open.
  4. In the fullscreen view, pick "1 Minute Granularity" from the granularity picker, then reload the page.
  5. Verify the same tile is open in fullscreen and its granularity picker shows "1 Minute Granularity".
  6. Press Escape and verify the URL no longer contains fullscreenTileId or fullscreenGranularity.

Tests

The new spec packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts seeds a dashboard through the API and covers:

  • A link opening the tile fullscreen with the URL's range and granularity, and surviving a reload.
  • Entering and exiting fullscreen (button, Esc, f) without dropping or changing other params. Changes in the fullscreen pickers don't touch them either.
  • The fullscreen range and granularity going only to the fullscreen params, surviving a reload of the link, and back stepping through them before closing.
  • Rapid sequences: a time change followed at once by opening fullscreen, and closing followed at once by a time change. Both end in the combined URL state.
  • Back/forward toggling.
  • Unknown tile IDs.
  • Tiles in collapsed groups and inactive tabs.
  • A live dashboard keeping the fullscreen picker values while the browser tab is hidden and shown again.

The spec (8 tests) passed 24 of 24 runs with --repeat-each 3 --retries 0. The existing fullscreen, granularity, heatmap, dashboard-container and temporary-dashboard e2e tests still pass.

References

  • Linear Issue: HDX-6236
  • Related PRs:
Open in Web Open in Cursor 

Fixes HDX-6236


Note

Medium Risk
Touches core dashboard URL and history behavior on a large page, but changes are scoped to fullscreen params and backed by extensive e2e tests.

Reviewed by Cursor Bugbot for commit ec8ab4d. Bugbot is set up for automated code reviews on this repo. Configure here.

cursoragent and others added 2 commits November 30, 2026 23:17
Store the fullscreen tile in a fullscreenTileId query param so a single
tile can be shared by link. Back/forward opens and closes it, and a link
to a tile in a collapsed group or inactive tab reveals the tile.

Co-authored-by: Mike Shi <mike@hyperdx.io>
Co-authored-by: Mike Shi <mike@hyperdx.io>
@MikeShi42
MikeShi42 requested a review from a team as a code owner November 30, 2026 23:18
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
hyperdx-oss Ready Ready Preview Dec 1, 2026 2:18pm UTC
hyperdx-storybook Ready Ready Preview Dec 1, 2026 2:18pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ec8ab4d

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

@github-actions github-actions Bot added the review/tier-2 Low risk — AI review + quick human skim label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

🔵 Tier 2 — Low Risk

Small, isolated change with no API route or data model modifications.

Why this tier:

  • Standard feature/fix — introduces new logic or modifies core functionality

Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns.
SLA: Resolve within 4 business hours.

Stats
  • Production files changed: 1
  • Production lines changed: 228 (+ 590 in test files, excluded from tier calculation)
  • Branch: cursor/shareable-fullscreen-tile-2ffe
  • Author: MikeShi42

To override this classification, remove the review/tier-2 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 109 in total (1.10%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 P0/P1 in code this PR adds or changes: fix before asking for review.
  • 🟡 P2 in code this PR changes: your call. Fix if small, otherwise reply.
  • 🔵 P3 is collapsed at the bottom: nobody needs to act on it before merge.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    priority. Reply with one sentence; if it is P0, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

4 finding(s): 🔴 0 P0/P1 · 🟡 1 P2 · 🔵 3 P3

No inline comments. 3 P3 folded at the bottom. 1 unchanged from an earlier push (already inline above).

🔵 3 P3 — no action needed before merge
  • 🔵 P3 packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts:769 — Live-mode test never exercises the isLiveMode seed freeze it is meant to guard → The test picks both 'Last 15 minutes' and '1 Minute Granularity', so fullscreenView.dateRange and .granularity come from the URL and take precedence over fullscreenSeed. Deleting the !isLiveMode condition in Tile (DBDashboardPage.tsx:646) would not fail this test. Add a case that opens fullscreen on a live dashboard without changing the pickers, hides and shows the tab, and asserts the seeded range text and the 'auto' granularity are unchanged.
  • 🔵 P3 packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts:658 — Reload step checks the restored range only by its absence (not.toHaveValue) → not.toHaveValue(dashboardRangeText) passes for any range other than the dashboard's, including a wrong or shifted one. Assert the picker text equals the range text captured before the reload, or check that it matches fullscreenFrom/fullscreenTo.
  • 🔵 P3 packages/app/tests/e2e/page-objects/DashboardPage.ts:2565 — New page-object helpers duplicate existing ones → changeFullscreenGranularity repeats changeGranularity (DashboardPage.ts:251) with only a different picker locator plus a visible filter. getTileById repeats the inline dashboard-tile-${tileId} locator in openTileActionsMenuById (line 678). Give changeGranularity a picker-locator parameter (and the visible filter), and have openTileActionsMenuById call getTileById.

Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4e3f7be. Configure here.

Comment thread packages/app/src/DBDashboardPage.tsx Resolved
…s hidden

Co-authored-by: Mike Shi <mike@hyperdx.io>
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 495 passed • 1 skipped • 1141s

Status Count
✅ Passed 495
❌ Failed 0
⚠️ Flaky 10
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

// The fullscreen view renders inside its tile, so a ?fullscreenTileId link
// must activate the tile's tab and expand its group for the tile to mount.
// A tile ID that matches no tile leaves the dashboard as it is.
useEffect(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 P2 — The new tile-reveal effect repeats the existing highlightedTileId tab-switch effect

The effect at DBDashboardPage.tsx:2451 already finds the tile, looks up its container and calls setUrlActiveTabs when getActiveTabId(container) !== tile.tabId. This new effect repeats that and also expands collapsed groups. Move it into one helper, e.g. revealTile(tileId), and call it from both effects. That way a ?highlightedTileId link to a tile in a collapsed group also gets expanded, and the two copies can't drift apart.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Leaving this out of this PR. A shared revealTile would also change how ?highlightedTileId links behave (they would start expanding collapsed groups), so it fits better as a separate follow-up than inside the fullscreen change.

dateRange: [Date, Date];
granularity: SQLInterval | undefined;
} | null>(null);
if (!isFullscreen && fullscreenSeed != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 P2 — The new reseed rules are untested: following the dashboard range while open, and the live-mode exception

No spec changes the dashboard range or granularity while fullscreen is open (for example, back across a time-range change), and none runs in live mode or with the tab hidden. Commit b8cd7b5 fixes exactly that case. Add an e2e case for back/forward across a range change with the tile open. Add another that turns on live mode, changes the fullscreen picker, and checks the picker survives a refresh.

Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Added the live-mode case in f68ae78. It turns on live mode, changes both fullscreen pickers, then hides and re-shows the tab, and checks the picker values are kept. It fails on the commit before b8cd7b5 and passes now. I haven't added the back/forward case: while fullscreen is open the modal covers the dashboard's own pickers, so no history entry can hold the tile open across a dashboard range change. The reseed-after-mount path is covered by "a link with the param opens that tile fullscreen with the URL time range and granularity".

…idden tab

Co-authored-by: Mike Shi <mike@hyperdx.io>
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

Scope: packages/app/src/DBDashboardPage.tsx (only production file) plus the new e2e spec, page-object helpers, and changeset. Reviewed against merge-base e7bf95e (the provided base 73ec0d5 had diverged and pulled in unrelated org-API-key changes, which were excluded from scope).

Intent: Make a dashboard's fullscreen-tile view shareable by lifting it into nuqs URL params (fullscreenTileId, fullscreenFrom/fullscreenTo/fullscreenGranularity), kept separate from the dashboard's own range/granularity so only the fullscreen tile refetches.

The implementation is careful: the seed reseed is safe because searchedTimeRange is memoized and live dashboards are gated by isLiveMode; hasRange guards NaN and from<to; close clears all four params. All prior review comments (the isLiveMode reseed fix, URL-backed range/granularity, stale-tabId guard, stable module-level key map, unapplied-text reset) are resolved in the current code.

✅ No critical issues found. No P0/P1 defects. P2 items below are worth addressing before merge; none block.

🟡 P2 — recommended

  • packages/app/src/DBDashboardPage.tsx:654 — fullscreenGranularity and FullscreenTileView.granularity are typed Granularity | 'auto' and reached via as Granularity | undefined, but the real seed value is SQLInterval | undefined; a valid custom interval that is not a Granularity enum member renders blank in the fullscreen granularity picker.
    • Fix: Type both as SQLInterval | 'auto' (as the dashboard's own granularity state already is) and drop the casts, widening GranularityPicker's value/onChange to match.
    • kieran-typescript, correctness
  • packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts — the new validation branches (hasRange rejecting non-finite / from>=to, parseAsStringEnum dropping an invalid granularity) are the point of the hardening yet every test feeds only well-formed values, so no rejection path is exercised.
    • Fix: Add deep-link cases with fullscreenFrom/fullscreenTo non-numeric, from>=to, and an invalid fullscreenGranularity, asserting the tile still opens and pickers fall back to the dashboard seed.
    • testing, correctness, adversarial
  • packages/app/src/DBDashboardPage.tsx:2064 — setFullscreenState is configured history: 'push', so every in-view brush-zoom, time search, and granularity change pushes a browser-history entry; after a dozen exploratory tweaks the Back button steps through each instead of closing fullscreen.
    • Fix: Use history: 'replace' for in-view range/granularity updates and reserve push for open/close transitions.
    • adversarial
🔵 P3 nitpicks (8)
  • packages/app/src/DBDashboardPage.tsx:2884 — the deep-link reveal effect, unlike the sibling highlightedTileId effect, has no per-id ref guard, so it re-asserts the tile's tab and group expansion whenever containers/getActiveTabId change while fullscreenTileId lingers.
    • Fix: Track the last-handled fullscreenTileId in a ref so the reveal fires once per transition.
    • correctness, julik-frontend-races
  • packages/app/src/DBDashboardPage.tsx:2067 — hasRange checks finiteness and from<to but not Date validity, so out-of-bounds millisecond values (beyond ±8.64e15) pass and produce Invalid Date that flows into the chart query.
    • Fix: Add a validity/in-bounds check to hasRange so malformed magnitudes fall back to the seed.
  • packages/app/src/DBDashboardPage.tsx:2094 — a zero-width or invalid fullscreen brush selection writes fullscreenFrom==fullscreenTo params that the read path then rejects, leaving orphaned URL params.
    • Fix: Apply the same validity guard before writing the range in setFullscreenView.
  • packages/app/src/DBDashboardPage.tsx:506 — because neither Tile nor DashboardContainerRow is React.memo'd, moving fullscreen view state to page-level URL state re-renders the whole tile grid on each fullscreen picker change (previously a single-tile re-render); refetch is still correctly avoided.
    • Fix: Wrap Tile in React.memo so only the fullscreen tile reconciles.
    • performance
  • packages/app/src/DBDashboardPage.tsx:497 — the four fullscreen param keys are enumerated in fullscreenQueryStateMap, again in setFullscreenTileId's null-reset object, and a third time in the e2e page object; adding or renaming a param silently desyncs them.
    • Fix: Derive the reset from Object.keys(fullscreenQueryStateMap) and export the key list for the test.
    • maintainability
  • packages/app/src/DBDashboardPage.tsx:2891 — a deep link to a tile whose tabId references a deleted tab is correctly prevented from looping, but the tile then never mounts, leaving fullscreenTileId set with no visible fullscreen and no feedback.
    • Fix: Clear fullscreenTileId or surface a "tile unavailable" notice when the target tile's tab is unresolvable.
    • adversarial
  • packages/app/src/DBDashboardPage.tsx:2669 — the adjacent isLive and isLiveMode props gate different behavior (only isLiveMode suppresses the seed re-sync) but the names do not convey the distinction, inviting future conflation.
    • Fix: Rename toward intent, e.g. isRefreshing / isLiveModeEnabled.
    • maintainability
  • packages/app/src/DBDashboardPage.tsx:676 — the input-range block reads fullscreenSearchedRange after calling its setter with null in the same render, deliberately relying on the pre-reset closure value; correct under React semantics but an unmarked trap for the next editor.
    • Fix: Compute the "keep user text?" decision into a const before the setters run, or add a comment noting the read sees the pre-reset value.
    • maintainability

Pre-existing (not introduced by this PR, excluded from verdict)

  • packages/app/src/DBDashboardPage.tsx — the file is ~3918 lines, well past the project's 300-line component guideline; this diff grows the already-large Tile rather than extracting the fullscreen logic into a hook. Out of scope here, but a natural future extraction target.

Reviewers (11): correctness, adversarial, julik-frontend-races, kieran-typescript, testing, maintainability, performance, previous-comments, project-standards, agent-native, learnings.

Testing gaps:

  • Malformed/adversarial fullscreen params (NaN, from>=to, out-of-Date-range magnitudes, invalid granularity enum) are unexercised.
  • No coverage for partial-param links (range-only or granularity-only) resolving the missing half from the dashboard seed.
  • Live-mode freeze is tested only via tab hide/show, not via an actual refresh tick moving the dashboard range while fullscreen is open.
  • No assertion on history-entry count after repeated in-fullscreen picker changes, nor that a single Back returns to the dashboard.
  • No coverage for a non-enum SQLInterval granularity round-tripping through the fullscreen picker.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@pulpdrew

pulpdrew commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

The fullscreen view also has its own time range and granularity, independent from the dashboard's. Should we put those values in the URL as well so that if a user changes those and shares the link, the link also carry the updated time range and granularity?

cursoragent and others added 2 commits December 1, 2026 13:37
…he URL

The fullscreen view's pickers now write fullscreenFrom, fullscreenTo and
fullscreenGranularity instead of local state. They stay separate from the
dashboard's from/to and granularity, so changing them refetches only the
fullscreen tile.

Co-authored-by: Mike Shi <mike@hyperdx.io>
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
@cursor

cursor Bot commented Dec 1, 2026

Copy link
Copy Markdown

@pulpdrew Yes, done in da0203c. The fullscreen pickers now write fullscreenFrom, fullscreenTo and fullscreenGranularity, so a shared link reopens the tile with the range and granularity the sender picked there. Closing fullscreen clears them along with fullscreenTileId.

They're separate from the dashboard's from/to/granularity on purpose. Writing to those would refetch every tile that has already loaded: the visibility gate only delays a tile's first load, and the grid stays mounted behind the modal. With separate params, only the fullscreen tile queries. The changes are pushed, so back steps through them before closing the view. There's a new e2e test for the round trip through a reload and back.

Comment thread packages/app/src/DBDashboardPage.tsx Resolved
…er exists

Co-authored-by: Mike Shi <mike@hyperdx.io>
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
…reen view

Co-authored-by: Mike Shi <mike@hyperdx.io>
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
Co-authored-by: Mike Shi <mike@hyperdx.io>

This branch was successfully deployed

2 active deployments
Preview – hyperdx-storybook — ec8ab4df Deployed Dec 1, 2026 by vercel[bot]
Preview – hyperdx-oss — ec8ab4df Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/tier-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants