Skip to content

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

Merged
kodiakhq[bot] merged 12 commits into
mainfrom
cursor/shareable-fullscreen-tile-2ffe
Dec 3, 2026
Merged

kodiakhq[bot] merged 12 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 state and tile rendering, but behavior is isolated behind new query params and covered by extensive e2e tests.

Reviewed by Cursor Bugbot for commit b6771dc. 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 3, 2026 3:45pm UTC
hyperdx-storybook Ready Ready Preview Dec 3, 2026 3:45pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b6771dc

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 3 — Standard

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

Why this tier:

  • Diff size: 273 production lines changed (Tier 2 max: < 250)

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

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

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

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.

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

2 posted as inline comment(s) on the changed lines. 1 listed below.

Findings outside the changed lines

  • 🟡 P2 packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts:821 — Live-mode test never exercises the new isLiveMode seed freeze → The test picks a fullscreen range and granularity before hiding the tab. Those go into fullscreenView URL params, which take precedence over fullscreenSeed (fullscreenView?.dateRange ?? fullscreenSeed?.dateRange). So the test passes even if isLiveMode is removed or replaced by isLive/isRefreshEnabled. Fix: add a case that opens fullscreen on a live dashboard without touching the fullscreen pickers. Then check that the picker range and granularity stay the same across setTabHidden(true/false) and a refresh tick.

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 • 501 passed • 1 skipped • 1132s

Status Count
✅ Passed 501
❌ Failed 0
⚠️ Flaky 11
⏭️ 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

✅ No critical issues found. No P0/P1 defects surfaced from the completed reviewers or from independent analysis of the diff. The change moves fullscreen-tile state into nuqs URL params; the adversarial surface (malformed fullscreenFrom/fullscreenTo, out-of-enum granularity, stale/unknown tile IDs) is guarded, and the previously-reported tab-hide reseed bug is correctly fixed via isLiveMode.

Verified independently:

  • fullscreenView rejects malformed ranges — Number.isFinite(from/to) plus from < to means NaN/Infinity/negative/inverted values fall back to the seed rather than producing an Invalid Date in a query (DBDashboardPage.tsx:2071).
  • The live-mode reseed fix holds: isLiveMode={isLive || isKioskMode} (DBDashboardPage.tsx:2676) is independent of tab visibility, unlike isRefreshEnabled, so the !isLiveMode reseed gate preserves picker values when the tab hides on a live dashboard.
  • revealTile's isKnownTab guard prevents the stale-tabId tab-switch loop; unknown tile IDs no-op.
  • Closing fullscreen (setFullscreenTileId(null)) clears all four params together.

🟡 P2 -- recommended

  • packages/app/tests/e2e/features/dashboard-fullscreen-url.spec.ts:88 -- The new spec exercises valid ranges and unknown tile IDs but never asserts the hasRange validation guard rejects malformed numeric params, which is the main defense for user-editable/shared URLs.
    • Fix: Add a case loading ?fullscreenTileId=tile-a&fullscreenFrom=NaN&fullscreenTo=5 (and from >= to) and assert the view opens on the fallback range with no invalid date.
  • packages/app/src/DBDashboardPage.tsx:637 -- Fullscreen range handling spreads across four coexisting state atoms (fullscreenSeed, fullscreenInputRange, fullscreenSearchedRange, plus the URL-derived fullscreenView) mutated by two stacked render-phase setState blocks whose invariants live only in comments, making the open/close/live/back-forward behavior hard to modify safely.
    • Fix: Extract the derivation into a dedicated hook (e.g. useFullscreenTileView(...)) that owns the seed/input/searched trackers and returns the resolved range, granularity, input text, and search handler.
    • maintainability
🔵 P3 nitpicks (3)
  • packages/app/src/DBDashboardPage.tsx:574 -- isLive and isLiveMode differ only by suffix but carry distinct semantics (pauses on hidden tab vs. stays true), a misuse hazard at read sites where the names give no hint.
    • Fix: Rename to intent-revealing names such as isAutoRefreshing and isLiveDashboard.
  • packages/app/src/DBDashboardPage.tsx:656 -- The fullscreenGranularity fallback casts SQLInterval to Granularity | 'auto', papering over the type gap between the zod string type and the enum; all current dashboard granularity strings happen to be enum members, so this is soundness-only.
    • Fix: Add a small toGranularity(sqlInterval): Granularity | undefined validator and flatten the nested ternary into named intermediates.
  • packages/app/src/DBDashboardPage.tsx:688 -- openFullscreen is now a useCallback that only forwards to onFullscreenChange(true), adding a memoized layer with no behavior after state moved to the parent.
    • Fix: Inline onClick={() => onFullscreenChange(true)} at the two call sites and drop the wrapper and its dependency-array entries.
    • maintainability

Reviewers (10 dispatched; 5 reported before synthesis): maintainability, project-standards, previous-comments, agent-native, learnings-researcher. Not yet reported at synthesis time: correctness, testing, kieran-typescript, julik-frontend-races, adversarial — the P2 test-gap and the P3 cast/naming items above were additionally confirmed by direct inspection of the diff.

Testing gaps:

  • No assertion that malformed/hand-edited fullscreenFrom/fullscreenTo (NaN, Infinity, from >= to) fall back safely rather than reaching a query.
  • Shared links carry the resolved absolute range but not the relative picker label ("Last 15 minutes"); functionally equivalent, cosmetic only.

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>
@github-actions github-actions Bot added review/tier-3 Standard — full human review required and removed review/tier-2 Low risk — AI review + quick human skim labels Dec 3, 2026
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
Comment thread packages/app/src/DBDashboardPage.tsx Resolved

@pulpdrew pulpdrew left a comment

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.

LGTM

@kodiakhq
kodiakhq Bot merged commit bf8b8cd into main Dec 3, 2026
30 of 31 checks passed
@kodiakhq
kodiakhq Bot deleted the cursor/shareable-fullscreen-tile-2ffe branch December 3, 2026 15:51

This branch was successfully deployed

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

Labels

automerge review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants