Skip to content

Prevent avatar fallback flash - #16

Merged
austin-smith merged 2 commits into
mainfrom
prevent-avatar-fallback-flash
Aug 3, 2026
Merged

austin-smith merged 2 commits into
mainfrom
prevent-avatar-fallback-flash

Conversation

@austin-smith

@austin-smith austin-smith commented Aug 3, 2026

Copy link
Copy Markdown
Owner

What Changed

  • Render avatar images in the server HTML instead of waiting for client-side load confirmation.
  • Track image loading and error state so the fallback remains visible until the image loads and returns after a failure.
  • Reset image state when the avatar URL changes in place.
  • Keep the image decorative and expose the avatar's accessible name from its root so failed images do not paint replacement text before hydration.

Why

The Radix avatar image was omitted from the server-rendered HTML until client-side JavaScript confirmed it had loaded. On refresh, this briefly displayed the fallback icon before swapping to a cached avatar. Rendering the image immediately removes that flash while preserving the fallback for loading and failed images.

Validation

  • pnpm web:verify
  • git diff --check

UI Changes

Cached account avatars now render on the initial page frame without flashing the fallback icon. Failed avatar URLs continue to display the fallback without broken-image replacement text.

@austin-smith
austin-smith marked this pull request as ready for review August 3, 2026 00:14

@chatgpt-codex-connector chatgpt-codex-connector 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.

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cde5beefc8

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/web/components/ui/avatar.tsx
@railway-app
railway-app Bot temporarily deployed to webhooks.lol / develop August 3, 2026 00:19 Inactive
@railway-app
railway-app Bot temporarily deployed to webhooks.lol / develop August 3, 2026 00:40 Inactive
@austin-smith
austin-smith merged commit 0fc405f into main Aug 3, 2026
2 checks passed
@austin-smith
austin-smith deleted the prevent-avatar-fallback-flash branch August 3, 2026 00:44
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