fix: prevent user avatar flickering on scroll in Rill Cloud user list#9168
Open
fix: prevent user avatar flickering on scroll in Rill Cloud user list#9168
Conversation
Replace bits-ui `Avatar.Image`/`Avatar.Fallback` with a native `<img>` element. bits-ui creates a new `Image()` on every mount and forces a loading→loaded state transition, briefly showing the fallback even for cached images. A native `<img>` renders immediately from browser cache, eliminating the flicker when infinite scroll triggers a table re-render. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
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.
Replace bits-ui
Avatar.Image/Avatar.Fallbackwith a native<img>element in theAvatarcomponent.bits-ui's
Avatar.Imagecreates anew Image()on every mount and forces aloading→loadedstate transition, settingdisplay: noneon the<img>untilonloadfires. Even for cached images, this is async — so there's at least one frame showing the fallback initials. When infinite scroll loads a new page, the table re-renders, Avatar components remount, and every visible avatar briefly flashes its fallback.A native
<img>renders immediately from browser cache with no loading state machine, eliminating the flicker.loom: https://www.loom.com/share/70190439af2e455797839a33a28e589a?from_recorder=1&focus_title=1
Fixes: https://linear.app/rilldata/issue/APP-526/user-management-table-header-row-moves-and-avatar-flickers-when
Checklist:
Developed in collaboration with Claude Code