Skip to content

feat(app): save a temporary dashboard with its content intact - #3729

Merged
kodiakhq[bot] merged 2 commits into
mainfrom
cursor/save-temporary-dashboard-08eb
Nov 19, 2026
Merged

kodiakhq[bot] merged 2 commits into
mainfrom
cursor/save-temporary-dashboard-08eb

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When viewing a temporary dashboard, the banner said "This is a temporary dashboard and can not be saved."

Users that built a dashboard and wanted to keep it had no way to save their work. Now, there is a button to save the temporary dashboard:

Screenshots or video

Screen.Recording.2026-11-19.at.2.22.02.PM.mov

How to test on Vercel preview

Make a temporary dashboard and then try saving it

References

Fixes HDX-6108

@pulpdrew
pulpdrew requested a review from a team as a code owner November 19, 2026 15:02
@vercel

vercel Bot commented Nov 19, 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 Nov 19, 2026 7:59pm UTC
hyperdx-storybook Ready Ready Preview Nov 19, 2026 7:59pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 00d1840

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

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

github-actions Bot commented Nov 19, 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: 2
  • Production lines changed: 154 (+ 88 in test files, excluded from tier calculation)
  • Branch: cursor/save-temporary-dashboard-08eb
  • Author: pulpdrew

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 19, 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 108 in total (1.13%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

Comment thread packages/app/src/DBDashboardPage.tsx Resolved
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
@github-actions

github-actions Bot commented Nov 19, 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.

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

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

Findings outside the changed lines

  • 🟡 P2 packages/app/tests/e2e/features/temporary-dashboard.spec.ts:380 — New save path has no test for the time range it saves or for stripped alerts → The e2e test checks the name, tiles, filters, query and filter value. It never checks the time range carried into savedDateRange, and nothing tests that withoutAlert removes tile alerts. Add unit tests for toViewDefaults covering an empty query (language should be null), a null range and null filter values. Also add a test showing that a tile with config.alert set reaches createDashboard.mutate with alert undefined, plus an e2e assertion on the time input after navigation.

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.

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. This is a self-contained, well-tested client-side feature (save a temporary dashboard with its content). No P0/P1 ship-blockers: no data corruption, auth, injection, or guaranteed happy-path crash. The items below are recommended improvements and nits.

🟡 P2 -- recommended

  • packages/app/src/DBDashboardPage.tsx:2949 -- onCreateDashboard builds the saved view from applied URL state (where, whereLanguage, searchedTimeRange), so a query or time edit typed in the input but not yet submitted is dropped when the user clicks Save and the page navigates away.
    • Fix: Persist the pending form/time draft (e.g. read getValues() / displayedTimeInputValue) into the saved defaults, or surface that unapplied edits are not saved.
    • correctness, adversarial
  • packages/app/src/DBDashboardPage.tsx:3413 -- the Save button sets loading={createDashboard.isPending || createDashboard.isSuccess}, and isSuccess never resets, so the button relies on router.push unmounting the page to leave the loading state and stays stuck if navigation is a no-op or fails.
    • Fix: Gate the disabled state on isPending alone, or use a local navigating flag cleared on unmount instead of latching on isSuccess.
    • julik-frontend-races, reliability, correctness
  • packages/app/tests/e2e/features/temporary-dashboard.spec.ts:165 -- the new save test asserts title, tile, filter, and saved query carry over but never sets or verifies a saved time range (savedDateRange), and the withoutAlert stripping path is only exercised with alert-free tiles, so regressions in either would pass.
    • Fix: Add a step selecting a non-default relative range before saving and asserting it on the saved dashboard, plus a unit test for withoutAlert and toViewDefaults.
    • testing, correctness, kieran-typescript
🔵 P3 nitpicks (3)
  • packages/app/src/DBDashboardPage.tsx:2958 -- the name is trimmed only for the empty-check fallback, so a padded name like " Report " is persisted with its surrounding whitespace.
    • Fix: Persist dashboard.name.trim() when the trimmed value is non-empty.
  • packages/app/src/DBDashboardPage.tsx:2267 -- handleSaveQuery destructures savedDateRange out and applies it only when truthy (preserving an existing saved range for absolute inputs), while onCreateDashboard spreads toViewDefaults wholesale; the divergence is unexplained at the call site.
    • Fix: Add a short comment at the destructure explaining the preserve-on-absolute-range intent so the two save paths read consistently.
  • packages/app/tests/e2e/page-objects/DashboardPage.ts:263 -- editDashboardName now reads whatever name is present and only asserts non-empty, so it no longer catches a regression in the default dashboard name.
    • Fix: Have flows that own a known default assert it explicitly rather than relying on the lenient helper.

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

Testing gaps: Save-button double-submit/disabled-on-click behavior is unverified. The createDashboard onError notification path has no test. Pre-existing, not introduced here: unsafe as SearchConditionLanguage casts remain at the form default (~DBDashboardPage.tsx:2144) and in onSubmit where the new toWhereLanguage helper could replace them; the shared ky client uses timeout: false, so the create POST can hang indefinitely while the button stays loading. Agent-native parity is adequate (an existing clickstack_save_dashboard MCP tool and external REST v2 cover dashboard creation), though neither exposes savedDateRange — a pre-existing gap.

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

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 474 passed • 1 skipped • 1062s

Status Count
✅ Passed 474
❌ Failed 0
⚠️ Flaky 8
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew
pulpdrew force-pushed the cursor/save-temporary-dashboard-08eb branch from a3d73bd to 7f111c3 Compare November 19, 2026 17:52
Comment thread packages/app/src/DBDashboardPage.tsx Resolved
const viewDefaults = toViewDefaults({
where,
whereLanguage: toWhereLanguage(whereLanguage),
rangeSeconds: (end.getTime() - start.getTime()) / 1000,

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 — Saving a temporary dashboard always stores a default time range, even an odd one from a zoomed or absolute view

rangeSeconds comes from searchedTimeRange, which is always set, so every dashboard saved from a temporary one gets a savedDateRange. With the new hasSavedDefaults, that makes the menu say 'Update Default Query & Filters' and show 'Remove' even when the user never set a default. It also turns a chart drag-zoom (say 7m12.3s) into a permanent default of 'last 432.3s'. Fix: save a range only when the displayed input is a relative preset (for example, check displayedTimeInputValue against RELATIVE_TIME_OPTIONS in components/TimePicker/utils.ts). Otherwise leave savedDateRange unset.

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

@kodiakhq
kodiakhq Bot merged commit a0732b1 into main Nov 19, 2026
28 checks passed
@kodiakhq
kodiakhq Bot deleted the cursor/save-temporary-dashboard-08eb branch November 19, 2026 20:02

This branch was successfully deployed

2 active deployments
Preview – hyperdx-storybook — 00d18409 Deployed Nov 19, 2026 by vercel[bot]
Preview – hyperdx-oss — 00d18409 Deployed Nov 19, 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-2 Low risk — AI review + quick human skim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants