Skip to content

Fix: show a fallback for slide thumbnails that fail to load - #366

Draft
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixslides-show-a-fallback-when-slide-b27988
Draft

posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixslides-show-a-fallback-when-slide-b27988

Conversation

@posthog-eu

@posthog-eu posthog-eu Bot commented Sep 11, 2026

Copy link
Copy Markdown

Problem

  • Who is hurt: a user preparing a live presentation sees the browser's broken-image icon in the slide grid instead of a slide preview, and cannot recover in the app.
  • The grid draws each thumbnail as a bare <img> (FillLayer) with no onError, retry, or placeholder.
  • Imported slides publish their media names before the medias__pdf_to_images worker finishes uploading the pages, so /media/processed answers 404 for a few seconds. The failure is silent: a failed <img> fires no event.

Changes

  • FillLayer now retries a failed image fetch a few times with a growing delay (the media may still be uploading), then falls back to a placeholder icon instead of the broken-image glyph. Successful loads are unchanged.
  • Slide grid skeletons any slide whose thumbnail name is not published yet, matching the guard the renderer path (ImageRenderer) already applies.
State Before After
Media still uploading (404) Broken-image icon Retry, then placeholder icon
Thumbnail name not published Broken render / empty name Skeleton
Media loads normally Image Image (unchanged)

Testing

  • Added a FillLayer component test: repeated load failures drop the bare <img> and render the fallback icon; a normal load keeps the image.
  • @repo/layout build (type-checked) and plugins/slides type-check pass.

Agent context

  • I could not launch the full Electron app here (needs Postgres + backend), so the visual state change is confirmed through the real-DOM component test rather than a live screenshot.
  • The scope matches the report: two files plus a test, reusing the renderer's existing empty-thumbnail guard. I did not touch the import worker's Promise.all upload path.

Created with PostHog Desktop from this inbox report.

The slide grid drew a bare <img> for each thumbnail with no error handling.
When a slide's media 404s - which happens while the import worker is still
uploading the pages - the browser showed its broken-image icon and the user
could not recover in the app.

Give the image fill in FillLayer a failed state: retry the fetch a few times
with a growing delay (the media may still be uploading), then fall back to a
placeholder icon instead of the broken-image glyph. Skeleton grid slides whose
thumbnail name is not published yet, matching the guard the renderer already
applies.

Generated-By: PostHog Desktop
Task-Id: 72c3ca67-2298-4ee6-b30b-5837232559a2
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

0 participants