Skip to content

feat(viewer): load-failed recovery panel#196

Draft
MrCoder wants to merge 2 commits into
mainfrom
feat/error-panel
Draft

feat(viewer): load-failed recovery panel#196
MrCoder wants to merge 2 commits into
mainfrom
feat/error-panel

Conversation

@MrCoder

@MrCoder MrCoder commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a load-failed recovery panel to all viewer macros (Sequence, Mermaid, PlantUML, Graph, OpenAPI/Swagger, Embed) — Lite variant
  • When a custom content fetch fails (404, permission error, network error), viewers now show a centered error panel instead of a blank canvas
  • Two failure states: failed_with_source (has a customContentId → retryable, "Try again" + "Contact support") and failed_without_source (no CC ID → permanent, "Contact support" only)
  • "Contact support" copies a diagnostic bundle to clipboard (content ID, page ID, macro UUID, space key, HTTP status, error code/class, app version) and opens the support portal
  • load_failed_shown and support_link_clicked analytics events added
  • viewerLoadState and loadError added to Vuex store (RootState)
  • New viewerLoadOutcome.ts utility centralises state classification (classifyViewerLoadOutcome, applyViewerLoadOutcome, mapCustomContentLoadError, mapThrownViewerLoadError)
  • Fixes blank-diagram regression: isDisplayableDiagram now returns true for diagrams with a known DiagramType but empty content — a freshly-created or cleared diagram shows an empty canvas, not the error panel

Test plan

  • Unit tests: viewerLoadOutcome.spec.ts (9 tests), GenericViewer.spec.ts (19 tests), viewerBootstrap.spec.ts, ApWrapper2.spec.ts — all pass
  • Spot check via Forge tunnel on lite-dev.atlassian.net: happy path renders correctly, 404 failure shows error panel, Try again reloads iframe, Contact support opens portal
  • Regression test added: treats a blank-but-loaded diagram (empty code, known type) as ready

🤖 Generated with Claude Code

MrCoder and others added 2 commits May 29, 2026 17:09
…upport actions

When a diagram custom content fetch returns 404 or another error, viewers now
show an error panel ("This diagram isn't available") instead of a blank canvas.
The panel includes a Try again button (location.reload) for transient failures and
a Contact support button that copies a diagnostic bundle to the clipboard and opens
the support portal. The failed state is reflected in the Vuex store via two new
fields (viewerLoadState, loadError) and emits a load_failed_shown analytics event.

Fixes blank-diagram regression: isDisplayableDiagram now returns true for diagrams
with a known DiagramType but empty content, so freshly created or cleared diagrams
render as an empty canvas rather than incorrectly showing the error panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant