Skip to content

feat: add error states to LoadingOverlay#19

Merged
Huxpro merged 4 commits intomainfrom
Huxpro/loading-error-states
Mar 17, 2026
Merged

feat: add error states to LoadingOverlay#19
Huxpro merged 4 commits intomainfrom
Huxpro/loading-error-states

Conversation

@Huxpro
Copy link
Copy Markdown
Member

@Huxpro Huxpro commented Mar 17, 2026

Summary

  • Surface errors at each stage of the WebIframe loading pipeline (runtime import, template fetch/parse, shadow root creation, render timeout) instead of silently spinning or timing out
  • Fix shadow root race condition: if children already exist when MutationObserver attaches, mark rendered immediately
  • Add timing instrumentation at key milestones for debugging

Error scenarios covered

Stage Before After
Runtime import fails Spinner forever Error message
Template fetch/parse fails Silent failure Error message
Shadow root not created in 3s Polls forever → 5s silent fallback Error after 3s
Render not complete in 5s Silent fallback (hides overlay) Error message

Test plan

  • Verify normal loading still works (overlay shows then hides on render)
  • Verify error UI appears when template URL is invalid (e.g. 404)
  • Check console logs show timing milestones
  • Confirm rendered (immediate) log appears when shadow root race is hit

Huxpro added 2 commits March 17, 2026 04:58
Track key milestones in the WebIframe loading pipeline:
- Runtime (web-core + web-elements) initialization
- Template URL assignment and shadowRoot polling
- First content render detection (via MutationObserver or fallback timeout)

This diagnostic data helps identify whether the 5s fallback timeout is actually
triggering, and if the observer is missing early DOM insertions.
Surface errors at each stage of the loading pipeline instead of
silently timing out or spinning forever:

- Runtime import failure: catch ensureRuntime() rejection
- Template load failure: catch fetch/parse errors in customTemplateLoader
- Shadow root timeout: error after 3s if shadow root never appears
- Render timeout: error after 5s if content never renders (was silent fallback)

Also fixes the shadow root race condition: if children already exist
when the MutationObserver is attached, mark rendered immediately.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 17, 2026

Deploy Preview for lynx-go-web ready!

Name Link
🔨 Latest commit 3ffef5b
🔍 Latest deploy log https://app.netlify.com/projects/lynx-go-web/deploys/69b946e28ed26400082e42a2
😎 Deploy Preview https://deploy-preview-19--lynx-go-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Huxpro added 2 commits March 17, 2026 05:32
Supports: ?simulateError=runtime|template|shadow|render
Each value triggers the corresponding error path without modifying
source code, making it easy to visually verify all error states.
@Huxpro Huxpro merged commit a27afbf into main Mar 17, 2026
7 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.

1 participant