feat(embeds): fallback for hung embeds and deleted X posts (#200)
CI / Build & Quality Checks (push) Successful in 3m24s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 10s
CI / Trigger Desktop Build (push) Successful in 9s
CI / Playwright smoke (e2e) (push) Successful in 9m57s

Probed how real providers fail before picking signals:
- X renders an EMPTY frame for a deleted/private/suspended post and says
  so only via postMessage `twttr.private.no_results`. The post embed now
  swaps to "This post isn't available…" with an "Open on X" link.
- A hung frame never fires `load`. After 20 s every player (media, rich
  posts, TikTok, Steam widget, X) overlays "This embed is taking too long
  to load" with Retry (remounts the iframe) and "Open on <site>". A late
  `load` clears it.
- Instagram and Bluesky show their own "removed / not found" page, and a
  refused request still fires `load` (browser error page), so neither needs
  or can use a guess. A missing height message is not treated as failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
Lotus CI
2026-09-26 11:54:16 -04:00
co-authored by Claude Opus 5.5
parent 1b5e6a37f5
commit ba5b1ffe7d
4 changed files with 277 additions and 52 deletions
@@ -315,6 +315,33 @@ export const EmbedIframeStatic = style([
},
]);
// Shown over (or instead of) an embed that hung or that the provider says is gone.
export const EmbedNotice = style([
DefaultReset,
{
position: 'absolute',
inset: 0,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
gap: config.space.S200,
padding: config.space.S300,
textAlign: 'center',
backgroundColor: color.Surface.Container,
color: color.Surface.OnContainer,
},
]);
export const EmbedNoticeStatic = style([
EmbedNotice,
{
position: 'static',
minHeight: toRem(120),
borderRadius: config.radii.R300,
},
]);
export const EmbedPlaceholder = style([
DefaultReset,
{