8000 feat(ui): explain and recover from ChartArtifact states that cannot be drawn by AntonTyb · Pull Request #812 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(ui): explain and recover from ChartArtifact states that cannot be drawn - #812

Merged
AntonTyb merged 3 commits into
feat/ui-chart-artifact-viewfrom
feat/ui-chart-artifact-view-states
Sep 11, 2026
Merged

AntonTyb merged 3 commits into
feat/ui-chart-artifact-viewfrom
feat/ui-chart-artifact-view-states

Conversation

@AntonTyb
@AntonTyb AntonTyb commented Sep 7, 2026
Copy link
Copy Markdown
Collaborator

What

Stacked on #811 (base branch feat/ui-chart-artifact-view). Slice 4 of 4 from the split of
#710, requested in review.

Slice 3 assumed a provisioned, renderable chart. Everything else fell through to an empty
panel with no indication of why. A chart artifact is provisioned asynchronously, so it spends
its first moments naming metrics it cannot yet plot — the blank state is the one a user is
most likely to hit first.

Each unrenderable state now says what happened in place of the plots:

  • Still provisioning — and no request is sent, because an unprovisioned artifact has no
    chart name to ask the Dashboard Service about; calling GetChartData with an empty name
    would only turn the wait into an error message.
  • Provisioning failed — surfacing the server's error_message. This is the surface that
    made the unauthenticated-CreateChart defect fixed in fix(ess): authenticate and durably record ChartArtifact provisioning #809 visible at all.
  • Provisioned with no plots — and again no request, because nothing would display the
    response and the data engine runs a query per plot behind it.
  • The fetch itself failed — with a refresh button to retry it.

Statuses are normalised through chartStatusName before matching. A serializer that did not
apply the proto JSON mapping emits ChartArtifact.Status as its enum tag, and matching only
the names let a numeric FAILED slip past the notice and render as a healthy chart,
swallowing the error message the payload was carrying. isSummaryBoxPlot already did the same
for PlotSpec.type. An unrecognised tag is left unmatched rather than mapped to a wrong
status.

Testing

Full Angular suite green at 585 specs — the pre-split baseline; tsc --noEmit and prettier
clean.

Seven specs added to chart_artifact_view_test.ts, covering each notice, both status
spellings, the two suppressed requests, the failed fetch, and chartStatusName's mapping
including the unknown-tag case. The enum-tag FAILED spec was checked to fail against
name-only matching.

Notes for the reviewer

Stack

Branch Scope
feat/chart-artifact-example (#676) the example
1 fix/ess-chart-provisioning-lifecycle (#809) authentication and status persistence
2 feat/ess-chart-artifact-plot-specs (#810) plot specs on the provisioned chart
3 feat/ui-chart-artifact-view (#811) full-width rendering, happy path
4 feat/ui-chart-artifact-view-states this PR

TAG=agy
CONV=96ac94bd-c2b9-4753-b54f-b0b6b02d801f

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request enhances the chart artifact view by adding support for asynchronous provisioning states, error handling, and manual data refreshing. It introduces a notice container to explain why a chart cannot be drawn (such as when it is still provisioning or has failed), normalizes status representations from both string and numeric enum tags, and adds a retry mechanism on failure. The reviewer's feedback suggests making the error-catching logic more robust by handling cases where the caught error is a plain string rather than an object with a message property.

@AntonTyb
AntonTyb force-pushed the feat/ui-chart-artifact-view-states branch from 9e6b16c to 6b7d418 Compare September 8, 2026 08:35
@AntonTyb
AntonTyb marked this pull request as ready for review September 8, 2026 08:44
@AntonTyb
AntonTyb dismissed andrzejfudro’s stale review September 8, 2026 15:59

The merge-base changed after approval.

@AntonTyb
AntonTyb force-pushed the feat/ui-chart-artifact-view-states branch from 6b7d418 to 3526ae9 Compare September 8, 2026 15:59
@AntonTyb
AntonTyb force-pushed the feat/ui-chart-artifact-view-states branch from 3526ae9 to c8ad690 Compare September 9, 2026 06:59
andrzejfudro
andrzejfudro previously approved these changes Sep 9, 2026
github-actions[bot]
github-actions Bot previously approved these changes Sep 9, 2026
@github-actions github-actions 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.

🤖 Incremental PR Approval

Clean rebase detected with zero semantic patch lines changed.

Preserving prior approval by @andrzejfudro on commit c8ad690.

…e drawn

ChartArtifactView assumed a provisioned, renderable chart. An artifact still
being provisioned, one whose provisioning failed, or one whose chart carries no
plots all fell through to an empty panel with no indication of why -- and a
failed GetChartData call left the same blank space behind.

Each of those states now says what happened in place of the plots, carrying the
server's error message through when there is one, and a refresh button retries
a fetch that did not arrive. Two of them also stop a pointless round trip: an
unprovisioned artifact has no chart name to ask about, and a chart with no plots
has nothing to display the response.

Statuses are normalised through chartStatusName so that a serializer emitting
ChartArtifact.Status as its enum tag rather than its proto JSON name cannot slip
a FAILED artifact past the notice and render it as healthy.

TAG=agy
CONV=96ac94bd-c2b9-4753-b54f-b0b6b02d801f
The spec threw an Error whose message was the component's own fallback string,
so `expect(error()).toBe('Failed to load chart metrics')` held whether the
message was read off the error or not -- replacing the whole expression with
the literal fallback still passed it.

Throw a distinct message and assert that, which fails against a component that
ignores the error. The fallback keeps its own spec, with an Error carrying no
message.

TAG=agy
CONV=96ac94bd-c2b9-4753-b54f-b0b6b02d801f
Review round 3 on #812.

The hand-rolled error container is replaced by xmc-error-banner, which already
carries the retry affordance and the styling the rest of the app uses for the
same state. Its own refresh button goes with it, and the local .error-container
rule is no longer needed.

The two failure specs now assert through ErrorBannerHarness instead of reading
the component's private signals, and a third covers the retry re-fetching. The
banner only renders once loading has finished, so reaching it also covers the
loading flag clearing that the old spec checked directly.

TAG=agy
CONV=96ac94bd-c2b9-4753-b54f-b0b6b02d801f
@github-actions github-actions Bot left a comment
Copy link
Copy Markdown
8000

Choose a reason for hiding this comment

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

🤖 Incremental PR Approval

Clean rebase detected with zero semantic patch lines changed.

Preserving prior approval by @andrzejfudro on commit c8ad690.

@AntonTyb
AntonTyb added this pull request to the merge queue Sep 11, 2026
Merged via the queue into main with commit 891cdf6 Sep 11, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0