Skip to content

[DO NOT MERGE] feat(app): refresh chart explorer UI and clarify AI assistant controls - #3864

Open
elizabetdev wants to merge 25 commits into
mainfrom
elizabet/hdx-6227-chart-explorer-ui
Open

elizabetdev wants to merge 25 commits into
mainfrom
elizabet/hdx-6227-chart-explorer-ui

Conversation

@elizabetdev

@elizabetdev elizabetdev commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Refreshes the chart explorer and chart editor UI (HDX-6227). The explorer had too many rows of controls, no clear way to save a chart, and an AI assistant whose placement and scope were unclear. The changes group the controls by what they do:

  • AI assistant opens in a resizable right-hand panel, and its last change can be undone.
  • Save to dashboard is a labeled button. Explorer charts have no name field and are named automatically on save, since there was nowhere to keep the name otherwise.
  • Chart type is a select, replacing the tab strip. Markdown is no longer offered in the explorer (dashboard tiles keep it).
  • Header is one row in every mode: the Builder/SQL/PromQL switch comes first, then that mode's source controls (data source; connection and source; PromQL data source), with chart type and save actions on the right. The mode switch decides which source controls apply, so it leads.
  • Series each sit in a card with a swatch and accent bar in the color the chart draws that line. The color is read back from the rendered chart, because colors are assigned after sorting by series key and the editor order doesn't predict them. Grouped charts color per group, so their cards show no color. Table cards show the pinned column color.
  • Display Settings docks in the same right-hand panel as the alert editor, so the preview stays in view while settings change. Only one of the two is open at a time. Opening Display Settings hides an open alert without discarding its edits.
  • Series display settings (number format) open in a popover, and the "Where" and "Data Source" labels are gone.

The commits are separable by item if you'd rather review them one at a time.

Screenshots or video

Same screen, data (e2e seed data), viewport and theme. Before is the merge base on main.

Explorer, two series (series B filtered to SeverityText:error)

Before After
Before: explorer After: explorer

Display Settings

Before After
Before: display settings drawer After: display settings panel

SQL mode

Before After
Before: SQL header After: SQL header

PromQL mode

Before After
Before: PromQL header After: PromQL header

The AI assistant panel is not shown: it needs an AI-enabled deployment, and I haven't verified it in a browser (see below).

The images live on the elizabet/hdx-6227-pr-screenshots branch. Delete it after this merges.

How to reproduce

Starting point: yarn app:dev:local, then onboarding → "Connect to Demo Server" and open Chart explorer. PromQL mode needs NEXT_PUBLIC_ENABLE_PROMQL=true.

On main:

  1. Open Chart explorer. Chart type is a tab strip below a "Chart Name" field, and the AI assistant is a collapsible row above everything.
  2. Click Add Series and run. Series are plain rows separated by dividers, with nothing to tell which line is which.
  3. Click Display Settings. A drawer covers the page.
  4. Switch between Builder, SQL and PromQL. The data source, and connection and source, move around the page.

On this branch:

  1. Open Chart explorer. Builder/SQL/PromQL, the data source, chart type and the AI assistant are on one row.
  2. Click Add Series, add a filter to the second series and run. Each series card has a swatch and left bar in its line's color.
  3. Click Display Settings. It opens in a side panel and the chart stays visible. Click Add alert: the panel switches to the alert.
  4. Switch between Builder, SQL and PromQL. The mode switch stays first and the matching source controls follow it.

How to test on Vercel preview

Preview routes: /chart

Steps:

  1. Open /chart and click Add Series.
  2. Run the chart and confirm each series card shows a color swatch matching its line.
  3. Click Display Settings and confirm it opens in a right-hand panel, not a drawer over the page.
  4. Click SQL, then PromQL, and confirm the Builder/SQL/PromQL switch stays in the same place with the source controls next to it.

Testing

  • tsc, oxlint and oxfmt are clean for packages/app. I did not run the full make ci-lint or make ci-unit.
  • Jest for packages/app/src/components passes (3,307 tests), including new unit tests for the series color mapping and the chart type select.
  • New Playwright test: each series card's color equals its chart line's color. Existing specs that drive Display Settings, source variables, source filtering, SQL filters and PromQL pass.
  • Flaky, passed on retry: clock-dependent chart-explorer bar tests, the metric table formula sort test, and a few dashboard filter tests with raw SQL tiles.

Known gaps

  • The AI assistant panel has not been checked in a browser, since it needs an AI-enabled deployment.
  • The assistant panel still triggers submit with setTimeout(() => submitRef.current(), 100).
  • Undo of an assistant change overwrites any edits made after it.
  • With a side panel open, the editor narrows and the series filter box gets tight. The alert panel already does this.
  • ChartDisplaySettingsDrawer is no longer a drawer. I kept the name to avoid touching about 100 test call sites.

References


Note

Medium Risk
Large UI refactor across chart explorer, editor, and alert side panel touches shared form plumbing and save/dashboard naming; behavior is mostly presentation but regressions could affect chart runs, saves, and panel state.

Overview
Refreshes Chart Explorer around a sticky two-row PageLayout header: mode/source controls, labeled Save to dashboard, and the AI assistant as a sparkles popover (hotkey A) with post-generation undo via extracted ChartAssistantPopover. The explorer hides the chart name field; saving to a dashboard now applies getDefaultChartName from the first series and group-by.

The chart editor toolbar can be hoisted into the page header through EditTimeChartForm toolbarTargets (portals for leading, chart type, save, and time/granularity/Run). Chart type moves from tabs to an icon ChartTypeSwitcher; Markdown is omitted outside dashboard tiles.

Series and formulas use SeriesCard accents fed by colors reported from DBTimeChart (TimeChartSeriesColors / getSeriesChartColors). Per-series number format uses a popover instead of a drawer. Display settings render in the alert panel’s right slot (AlertPanelLayout sidePanel) rather than a Mantine drawer, with mutual exclusivity vs the alert editor.

Supporting cleanup: shared ChartDataSource / ChartRawSqlSource, DisplaySettingsButton, renamed live-interval setter in search, docs/skills for Chart Explorer header pattern, tests and E2E selectors scoped to the page root for header-mounted controls.

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

elizabetdev and others added 13 commits November 28, 2026 12:21
- Focus the question input instead of the source select, so opening the
  AI assistant no longer pops the source dropdown.
- Show the A shortcut as a Kbd instead of an '[A]' suffix.
- Drop the Experimental badge. The assistant is already gated by the
  server's ANTHROPIC_API_KEY, so the badge implied an opt-in that does not exist.
- Replace the chart name field with InlineNameInputControlled so the name
  is a label until clicked.

Refs HDX-6227

Co-authored-by: Cursor <cursoragent@cursor.com>
The assistant expanded inline above the chart, pushing it down and
away from where its result appears. It now opens in a resizable panel
beside the chart, using the same docking as the alert panel.

Generating a chart replaces the current chart and time range, so the
success notification now offers an Undo that restores both.

Moves the assistant out of DBChartPage into components/ChartAssistant.

Co-authored-by: Cursor <cursoragent@cursor.com>
Saving a chart from the explorer was only reachable through an unlabeled
kebab menu next to Run, so users did not find it. Make it a labeled
secondary button that opens the existing save modal.

The modal title and button use sentence case. Adds unit and e2e coverage
for the explorer-to-dashboard save.

Co-authored-by: Cursor <cursoragent@cursor.com>
The explorer's name field was discarded unless the chart was saved, and
it changed nothing visible while exploring. Hide it in the explorer.

An unnamed chart now gets a default name from its first series and group
by when it is saved to a dashboard, and that name seeds an inline
alert's display name. Tile names are still editable in the tile editor.

Co-authored-by: Cursor <cursoragent@cursor.com>
The chart type tabs took a full row and the AI assistant toggle sat on its own line above the builder toggle. Move the chart type into the header next to the builder toggle and pass the AI assistant toggle in as a header action, which removes two rows above the chart.

Markdown is only offered on dashboard forms. The explorer has nowhere to save a markdown tile, so the option was dead weight there. Existing markdown tiles keep their type.

Co-authored-by: Cursor <cursoragent@cursor.com>
Tiles keep the title and description on their own row. Below it, the data source sits on the left and the chart type, builder toggle, and save actions on the right. The explorer has no title row, so its first row is the data source with the tools on the right, including the AI assistant toggle.

The data source row moves out of ChartEditorControls into ChartDataSource so the header can own the layout. Raw SQL and PromQL editors don't show a data source here, as before.

Co-authored-by: Cursor <cursoragent@cursor.com>
The picker already shows Data Source as its placeholder, so the separate label was redundant. The picker gets an aria-label so it keeps an accessible name.

Co-authored-by: Cursor <cursoragent@cursor.com>
The series format drawer took over the whole screen to edit one number format. Open it as a popover anchored to the series' format button instead, so the chart stays visible while editing.

The popover owns its open state and mounts its form only while open, so each open starts from the saved format and closing without Apply discards edits. The disclosure state in ChartSeriesEditor and ChartFormulaEditor goes away. The heading is now sentence case.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Where input's placeholder and the Lucene language picker already say what the field is. Removing the label lets the input take the space, and the grid template now follows the cells that remain (Where alone, Where with Group By, or Having).

Co-authored-by: Cursor <cursoragent@cursor.com>
Series and formulas in the chart editor sit in cards. A swatch and accent
bar show the color the chart draws that line in, read back from the
rendered chart so it matches even though colors are assigned after
sorting by series key. Grouped charts color per group, so their cards
show no color. Table cards show the pinned column color.

Co-authored-by: Cursor <cursoragent@cursor.com>
Display Settings opened in a Mantine drawer over the page. It now docks in
the same right-hand panel as the alert editor, so the preview stays in view
while settings change. Only one of the two is open at a time: opening the
alert hides display settings, and display settings hide an open alert
without discarding its edits.

The toolbar groups the series actions (Add Series, Add Formula) on the left
and the panel openers (Add alert, Display Settings) on the right.

Co-authored-by: Cursor <cursoragent@cursor.com>
The Builder/SQL/PromQL switch decides which source controls apply, but it
sat among the chart type and save actions while the source, connection and
data source pickers moved between the header and the editor body.

The header is now one row in every mode: the mode switch, then that mode's
source controls (source; connection and source; or PromQL data source),
with chart type and save actions on the right. Display Settings uses the
same button in all three editors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@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 2, 2026 7:46pm UTC
hyperdx-storybook Ready Ready Preview Dec 2, 2026 7:46pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fb419a5

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 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

E2E Test Results

✅ All tests passed • 489 passed • 1 skipped • 1119s

Status Count
✅ Passed 489
❌ Failed 0
⚠️ Flaky 15
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

…the AI assistant in a popover

Co-authored-by: Cursor <cursoragent@cursor.com>
…der's first row

Co-authored-by: Cursor <cursoragent@cursor.com>
elizabetdev and others added 3 commits November 30, 2026 17:55
… explorer header

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rt-explorer-ui

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	packages/app/src/DBChartPage.tsx
@elizabetdev
elizabetdev marked this pull request as ready for review December 2, 2026 16:07
@elizabetdev
elizabetdev requested a review from a team as a code owner December 2, 2026 16:07
@github-actions github-actions Bot added the review/tier-4 Critical — deep review + domain expert sign-off label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

🔴 Tier 4 — Critical

Touches authentication, tenancy data models, the public API or shipped database config — or substantially changes the query rendering engine, background tasks, the OTel pipeline, image build, or release CI.

Why this tier:

  • Large diff: 2962 production lines changed (threshold: 1000)

Review process: Deep review from a domain expert. Synchronous walkthrough may be required.
SLA: Schedule synchronous review within 2 business days.

Stats
  • Production files changed: 29
  • Production lines changed: 2962 (+ 557 in test files, excluded from tier calculation)
  • Branch: elizabet/hdx-6227-chart-explorer-ui
  • Author: elizabetdev

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

Co-authored-by: Cursor <cursoragent@cursor.com>
: undefined
}
clearErrors={clearErrors}
chartColor={

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 — Series card colors are matched by position to the last run config, so they go stale after a swap or remove/add

The only check here is seriesChartColors.series.length === fields.length. Moving a series with the up/down buttons calls useFieldArray swap, which does not re-run the query. After that, card 0 shows the line color of the series that used to be first, even though a different series now sits in that slot. Remove one series and add another, without running, and you get the same mismatch. Key the colors by field id, or by a hash of the series definition, instead of by index. Failing that, drop them whenever the form's series differ from previewConfig.select, so a card shows no color rather than the wrong one.

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

[displayType],
);

const sourceControls = (

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 — Markdown tiles now show a data source picker that does nothing

sourceControls is now rendered on every tab. Before, the source select lived in ChartEditorControls, RawSqlChartEditor and PromqlChartEditor, which all sit in the branches after activeTab === 'markdown' ?, so markdown tiles never showed it. Now a dashboard markdown tile gets a source picker (with schema preview) that has no effect. Render ChartDataSource/ChartRawSqlSource only when activeTab !== 'markdown', or only when displayTypeRequiresSource(displayType) is true; that helper is already imported in this file.

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

const measure =
firstSeries.aggFn === 'count'
? 'Count of events'
: `${firstSeries.aggFn} of ${firstSeries.valueExpression?.trim() || 'events'}`;

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 — getDefaultChartName names every metric chart 'avg of Value'

setMetricName in ChartSeriesEditor sets valueExpression to 'Value' for every metric series. As a result, saved metric tiles and the default alert names all come out as 'avg of Value' or 'sum of Value', and a count on a metric source reads 'Count of events'. renderChartConfig.ts, around line 171, already labels these as ${aggFn}(${metricName}). Accept metricName (and alias) in firstSeries and prefer alias, then metricName, then valueExpression. Add a metric case to the new test.

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

() => ({
opened,
setOpened,
setOpened: openAlertPanel,

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 alert button hides its error badge while Display Settings covers the alert panel

When Display Settings takes the panel, opened in the context stays true but alertVisible is false. AlertPanelButton (AlertPanelButton.tsx:28) uses !alertPanel?.opened to decide whether to carry the alert's error or warning badge, so it drops the badge exactly when the panel showing that error is hidden. It also reports aria-expanded=true for a panel that isn't shown. Add a separate visible: alertVisible to the context and use it for the badge and for aria-expanded. Keep opened for open()'s snapshot logic.

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

@github-actions

github-actions Bot commented Dec 2, 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.

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

1 posted as inline comment(s) on the changed lines. 2 listed below. 5 unchanged from an earlier push (already inline above).

Findings outside the changed lines

  • 🟡 P2 packages/app/src/components/ChartAssistant/ChartAssistant.tsx:962 — New ChartAssistant file renders raw <code> and a palette-colored outline Alert → The "Code snippets (REQUIRED)" convention forbids unstyled <code>, and the Alert guidance says new callouts should use the semantic variants. This new file has <code>ANTHROPIC_API_KEY</code> inside <Alert color="dark" variant="outline">. Use Mantine <Code> and <Alert variant="info">. The display-settings disclaimer in this same PR already uses variant="info".
  • 🟡 P2 packages/app/src/components/ChartEditor/ChartSeriesControls.tsx:1402 — Icon-only Move up/down/Duplicate controls are Buttons with no accessible label → The rewritten actions block renders icon-only <Button>s for Move up, Move down and Duplicate, which breaks the "Icon-only buttons → ActionIcon" rule. They are labelled only by title. Use <ActionIcon variant="subtle" aria-label="Move up"> (and likewise for the others), as the format and color buttons in the same row do.

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 Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. This is a client-side UI refactor; no finding causes data corruption, a guaranteed crash, or a security regression. The strongest items are a markdown-tab source regression, three risks around the new color/undo/auto-submit behaviors, and test coverage for them.

🟡 P2 — recommended

  • packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx:1337 — sourceControls (and its ChartDataSource picker) now renders unconditionally in the toolbar, so markdown tiles show a Data Source selector they never had; changing it dirties the form and persists a source the tile does not use.
    • Fix: Render sourceControls as null when activeTab === 'markdown' so the picker is hidden for markdown tiles.
    • previous-comments, correctness
  • packages/app/src/components/DBEditTimeChartForm/ChartEditorControls.tsx:283 — moving a series up/down swaps order without submitting, so positional seriesChartColors stay at the last run's ordering and each SeriesCard swatch/accent disagrees with the line color the chart draws, defeating the feature's "which line is which" purpose until the next Run.
    • Fix: Submit on swap, or suppress the color swatch while the live series order differs from the config the colors were derived from.
    • adversarial
  • packages/app/src/components/ChartAssistant/ChartAssistant.tsx:122 — the success path calls setConfig/onTimeRangeSelect then fires submitRef.current() after a fixed 100ms; if state has not committed in time the submit queries the previous config and time range, leaving the preview stale, and the never-cleared submitRef can fire a stale closure after unmount.
    • Fix: Replace the timer with a deterministic signal keyed on the generated config having propagated, and clear submitRef.current on unmount.
    • adversarial, frontend-races, correctness
  • packages/app/src/components/ChartAssistant/ChartAssistant.tsx:138 — the Undo action unconditionally restores the generation-time previousConfig/time-range snapshot, silently discarding any edits the user made to the generated chart before clicking Undo.
    • Fix: Re-snapshot or confirm before overwriting user edits on Undo, and add a test asserting the intended behavior.
    • testing
🔵 P3 nitpicks (8)
  • packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx:1598 — a stray {' '} after the self-closing <ChartActionBar /> tag emits an unintended whitespace text node.
    • Fix: Delete the trailing {' '}.
    • kieran-typescript, maintainability
  • packages/app/src/components/ChartDisplaySettingsDrawer.tsx — the component now returns a Stack role="dialog" in the side panel, not a Mantine Drawer, but the file and export keep the Drawer suffix, misleading future readers.
    • Fix: Rename the file/export to ChartDisplaySettingsPanel and update its importers in a follow-up.
    • maintainability, kieran-typescript
  • packages/app/src/components/DBEditTimeChartForm/ChartActionBar.tsx:212 — actionsTarget overloads undefined (inline) vs null (toolbar pending) vs element (portal), and the Save-to-dashboard render decision is duplicated in ChartActionBar and EditTimeChartForm, so the two checks can drift and show Save twice or never.
    • Fix: Replace the tri-state with an explicit mode: 'inline' | 'toolbar' discriminator and express Save ownership once.
    • maintainability, kieran-typescript
  • packages/app/src/components/DBTimeChart/DBTimeChart.tsx:456 — the color read-back round-trip (chart reports colors up via onSeriesColorsChange, form feeds them back down) emits a fresh object on every lineData recompute (extra SeriesCard re-renders) and relies on an undocumented referential-stability contract an inline callback would break.
    • Fix: Skip the emit when the computed colors are unchanged and enforce callback stability via a ref rather than convention.
    • maintainability, kieran-typescript, frontend-races
  • packages/app/src/components/AlertPanel.tsx:239 — opening Display Settings over an open alert flips alertVisible false and unmounts the alert editor subtree; form state survives in the parent, but focus, scroll position, and component-local state are lost on the swap.
    • Fix: Toggle visibility with CSS instead of swapping the portal target so the alert subtree stays mounted.
    • frontend-races, correctness
  • packages/app/src/components/DBEditTimeChartForm/EditTimeChartForm.tsx:1628 — SaveToDashboardModal receives the last-run chartConfig, not live form state, so edits that do not auto-submit (unrun WHERE/SQL, reorders) are saved with a stale config and auto-generated name; pre-existing behavior the new header Save button makes easier to hit.
    • Fix: Submit/validate before opening the Save modal, or pass the modal the current form-derived config.
    • adversarial, correctness
  • packages/app/src/components/DBEditTimeChartForm/ChartRawSqlSource.tsx:24 — connection/source reference resolution (useResolvedReference, useSources, sources.find(...)) is now forked between this new component and RawSqlChartEditor, so a future change must be made in both.
    • Fix: Extract a shared useResolvedRawSqlSource(control) hook consumed by both.
    • maintainability
  • packages/app/src/components/DBEditTimeChartForm/DisplaySettingsButton.tsx:14 — the consolidated button label Display Settings uses Title Case, against the documented sentence-case UI-text rule (Display settings).
    • Fix: Change the label to sentence case in this new shared component.
    • project-standards

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

Testing gaps:

  • No test covers the Undo path restoring config + time range, nor the author-flagged "Undo overwrites later edits" case.
  • No test for the AlertPanel display-settings-vs-alert mutual exclusion (alert content survives the swap).
  • The series-color producer in DBTimeChart (grouped flag, dashed-line dedup, unmount-reports-undefined) and the reorder/empty-select cases are untested; only the consumer getSeriesChartColors is covered.
  • No test exercises the setTimeout auto-submit (the test passes submitRef.current = undefined) or the toolbarTargets portal wiring and inline-vs-portal Save branching.

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

}
clearErrors={clearErrors}
chartColor={
seriesChartColors?.series.length === fields.length

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 — Series cards show the wrong colors after a swap, or after a remove and add, until the chart is run again

The only staleness check is seriesChartColors.series.length === fields.length. swapSeries (a useFieldArray swap in EditTimeChartForm.tsx:329) does not re-run the query, so 'Move down' on series A swaps the cards but leaves the colors where they were. Card B then shows A's line color, and removing one series and adding another does the same. Fix: also check that each field still matches previewConfig.select[index] (for example isEqual on aggFn, valueExpression and aggCondition), and return no color when it doesn't. That gives the stated intent of 'no color rather than a wrong one'.

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

await chartExplorerPage.chartEditor.getSeriesCardColors();

expect(new Set(cardColors).size).toBe(2);
expect([...cardColors].sort()).toEqual([...lineColors].sort());

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 — E2E color test sorts both arrays, so it passes when cards have each other's colors

expect([...cardColors].sort()).toEqual([...lineColors].sort()) only checks that the two sets of colors are the same. If series A's card shows B's line color and B's card shows A's, the test still passes. Pair each card with its line instead: hover a line or read the legend and compare against that card's alias, or give the two series distinct aliases and match legend entries to cards by alias.

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

const [hasContent, setHasContent] = useState(false);
const [root, setRoot] = useState<HTMLDivElement | null>(null);
const showPanel = opened && hasContent;
const sidePanelVisible = sidePanelOpened === true && sidePanel != 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 — New logic for switching between the alert panel and display settings has no unit test

AlertPanel.test.tsx has no case for sidePanel/sidePanelOpened/onSidePanelClose. Add tests for these cases: the side panel hides an open alert and the alert comes back with its edits when the side panel closes; opening the alert calls onSidePanelClose; a closed side panel with a closed alert renders no alert-panel.

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

>
<Text size="xs" pt="2px">
New AI Assistant available, enable with configuring the{' '}
<code>ANTHROPIC_API_KEY</code> environment variable on the {brandName}{' '}

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 — New file renders an unstyled <code> element, which breaks the REQUIRED code snippets rule

Replace <code>ANTHROPIC_API_KEY</code> with Mantine <Code>ANTHROPIC_API_KEY</Code>. While moving this callout, also use variant="info" instead of color="dark" variant="outline" (semantic variants rule) and sentence case: 'New AI assistant available'.

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

>
<Stack pr="md" pb="md" role="dialog" aria-label="Display Settings">
<Group justify="space-between" wrap="nowrap">
<Text fw={600}>Display Settings</Text>

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 — New panel heading and button use Title Case 'Display Settings'

Under the sentence-case convention, the new panel header text, its aria-label, and the label of the new DisplaySettingsButton (DisplaySettingsButton.tsx:14) should read 'Display settings'. The same applies to 'Time Series' in the new CHART_TYPE_OPTIONS in ChartTypeSwitcher.tsx. Update the e2e and unit locators that match on these labels at the same time.

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

setSaveToDashboardModalOpen={setSaveToDashboardModalOpen}
/>
actionsTarget={toolbarTargets?.actions}
/>{' '}

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 — Stray {' '} text node after ChartActionBar

/>{' '} puts a whitespace text node between the action bar and the end of the ErrorBoundary. It looks like a leftover from formatting; delete {' '}.

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

@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 4733b05. Configure here.

/>,
toolbarTargets.save,
)}
</>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Markdown tiles show data source picker

Medium Severity

sourceControls (including ChartDataSource) now always renders in the toolbar, including when activeTab is markdown. Markdown tiles previously had no data source picker because that control lived inside the builder/SQL/PromQL editors. Changing source on a markdown tile dirties the form and can persist a source that the tile does not use.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4733b05. Configure here.

@elizabetdev elizabetdev changed the title feat(app): refresh chart explorer UI and clarify AI assistant controls [DO NOT MERGE] feat(app): refresh chart explorer UI and clarify AI assistant controls Dec 2, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
setValue('alert', {
...DEFAULT_TILE_ALERT,
...(chartName && { displayName: chartName }),
displayName:

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 — Alerts on unnamed dashboard tiles now get a fixed name like "Count of events" instead of the server-derived " - Tile"

Before, an unnamed chart set no displayName, so the server named the alert formatTileAlertDisplayName(dashboard.name, tile.name) (packages/common-utils/src/alerts.ts), which includes the dashboard context. Now every unnamed tile alert stores a name built from the query, which drops the dashboard and stays stale if the tile is renamed later. Only fall back to getDefaultChartName in the explorer (!isDashboardForm). RawSqlChartEditor still uses chartName && {...}, so the two editors now behave differently.

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

.toHaveLength(2);
const lineColors = await chartExplorerPage.getLineColors();
const cardColors =
await chartExplorerPage.chartEditor.getSeriesCardColors();

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 series color E2E test sorts both lists, so it passes even when cards show the wrong line's color

expect([...cardColors].sort()).toEqual([...lineColors].sort()) only checks that the two sets of colors match, not which card got which color. It cannot catch swapped or misindexed colors, which is the mapping this feature exists to get right. Match each card to its line by series alias or legend label, or at least compare the lists in order against known series positions.

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

* It becomes the tile name on save and the default alert name, so an unnamed
* chart still has a name where it is stored.
*/
export function getDefaultChartName(

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 — getDefaultChartName puts raw aggFn values into saved tile names instead of the existing AGG_FNS labels

Tile names come out as none of <expr> for Custom, count_distinct of X, or avg of Value for metric series (the metric name is ignored), and these are saved permanently. Use the labels in AGG_FNS (packages/app/src/ChartUtils.tsx:76) and include metricName for metric sources.

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

<Divider my="sm" />
<Flex justify="flex-end">
<Flex justify="flex-end" mb="md">
<Button

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 heatmap editor still has its own inline Display Settings button instead of the new DisplaySettingsButton

Every other editor (builder, SQL, PromQL) now uses DisplaySettingsButton, which is subtle with an icon. The heatmap editor keeps a secondary compact-sm copy, so it looks different and the test id is defined twice. Replace it with <DisplaySettingsButton onClick={onOpenDisplaySettings} />.

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

data-testid="display-settings-button"
>
<IconAdjustmentsHorizontal size={14} className="me-2" />
Display Settings

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 — New UI text uses Title Case ("Display Settings"), which breaks the sentence case convention

Use "Display settings" here and in the panel header and aria-label (ChartDisplaySettingsDrawer.tsx:332-334). The new ChartGroupByInput ("Group By", "SQL Columns") and the ChartTypeSwitcher label "Time Series" break the same rule.

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

<Text size="xs" pt="2px">
New AI Assistant available, enable with configuring the{' '}
<code>ANTHROPIC_API_KEY</code> environment variable on the {brandName}{' '}
server.

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 ChartAssistant file renders a raw element, which the code snippet convention forbids

The REQUIRED code snippet rule says inline tokens use Mantine <Code>. Replace <code>ANTHROPIC_API_KEY</code> with <Code>ANTHROPIC_API_KEY</Code>.

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

Co-authored-by: Cursor <cursoragent@cursor.com>
onAddAlert={() =>
setValue('alert', {
...DEFAULT_TILE_ALERT,
...(chartName && { displayName: chartName }),

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 — Raw SQL alerts from the explorer now get no default name

The explorer now hides the name field (showChartName={false}), so chartName is always empty there. The builder path falls back to getDefaultChartName for the alert's displayName (ChartEditorControls.tsx), but this raw SQL onAddAlert still uses ...(chartName && { displayName: chartName }). An inline raw-SQL alert created from the explorer therefore has neither a display name nor chartConfig.name. Fix: give it the same fallback, e.g. displayName: chartName || 'Untitled chart', or a name derived from the connection or source.

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

): string {
if (firstSeries?.aggFn == null) return 'Untitled chart';
const measure =
firstSeries.aggFn === 'count'

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 — getDefaultChartName gives vague names for metric and quantile series, with inconsistent casing

Picking a metric sets valueExpression to 'Value' (ChartSeriesEditor setMetricName), so every metric chart is named avg of Value and the metric name is lost. Quantile series also drop their level (e.g. quantile of Duration). Raw aggFn names are lowercase while count gets Count of events. Fix: prefer metricName when it is set, include the quantile level, and capitalize the measure. Add test cases for the metric and quantile inputs.

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

data-testid="display-settings-button"
>
<IconAdjustmentsHorizontal size={14} className="me-2" />
Display Settings

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 — New UI strings use Title Case instead of sentence case

The conventions require sentence case for every user-facing string. Newly added labels break this: Display Settings here (also the panel heading and aria-label at ChartDisplaySettingsDrawer.tsx:332-334), and Time Series in ChartTypeSwitcher.tsx:25. Change them to Display settings and Time series, and update the e2e locators that match on these names.

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

Co-authored-by: Cursor <cursoragent@cursor.com>

// The explorer no longer names charts, so an unnamed chart gets a name from
// its query when it is saved as a tile.
function getTileName(chartConfig: SavedChartConfig): string {

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 — Explorer SQL/PromQL charts are always saved with the literal name "Untitled chart"

The explorer no longer shows a name field, and getTileName returns the placeholder for every non-builder config (and for builder Search tiles, where select is a string). So every raw SQL or PromQL chart saved from the explorer is stored with the name "Untitled chart". Before this change the user could type a name, or the name was left unset. Leave name unset when no meaningful default exists, so the tile renders its usual untitled placeholder instead of storing placeholder text as user data, or derive a name for these modes too.

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

This branch was successfully deployed

2 active deployments
Preview – hyperdx-oss — fb419a59 Deployed Dec 2, 2026 by vercel[bot]
Preview – hyperdx-storybook — fb419a59 Deployed Dec 2, 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-4 Critical — deep review + domain expert sign-off

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant