Repository navigation
Fix repo avatars falling back to initials when icon can't load - #919
Merged
Merged
Conversation
- Handle empty/undecodable icon files (e.g. 0-byte favicon.ico) in backend - Track Radix Avatar's `onLoadingStatusChange` instead of img events - Fix avatar showing blank instead of initials when icon fails - Add test coverage for fallback behavior and empty icon files
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes repo avatars rendering blank instead of falling back to the name initials when a repository's icon file can't be displayed (e.g. an empty
favicon.icoplaceholder or an undecodable.icofile).What changed
Backend (
helpers.rs):data:URIs that render as blankFrontend (
avatar.tsx):onError/onLoadhandlers with properonLoadingStatusChangetracking from Radix AvatarAvatar.Imagenever mounts the underlying<img>on error, so nativeonErrornever fires"error"Tests (
avatar.test.tsx):window.Imageto simulate broken icons and verifies the fallback rendersMisc (
row-item.tsx,workspace-hover-card.tsx):??) to logical OR (||) for consistency with repoInitialsTest plan