fix(mobile): add recyclingKey to PR review comment avatars - #6091
Open
iscekic wants to merge 1 commit into
Open
Conversation
Surface: the mobile app (apps/mobile).
# Problem
On the PR review Discussion tab, comment author avatars render inside a FlashList whose rows are recycled. `apps/mobile/src/components/pr-review/discussion/pr-review-discussion-list.tsx` renders `CommentRow` for every `kind: 'comment'` item from a `FlashList` (see its `renderItem` at lines 138-152). `apps/mobile/src/components/pr-review/discussion/comment-row.tsx` lines 232-240 render the avatar as:
```tsx
<Image
source={{ uri: comment.author.avatarUrl }}
className="size-6 rounded-full"
transition={0}
cachePolicy="memory"
accessibilityIgnoresInvertColors
/>
```
There is no `recyclingKey`. Expo Image documents this prop as: "Changing this prop resets the image view content to blank or a placeholder before loading and rendering the final image. This is especially useful for any kinds of recycling views like FlashList to prevent showing the previous source before the new one fully loads." With `cachePolicy="memory"` the previous commenter's avatar can render for a frame when a cell is recycled onto a different comment. The repository already sets this prop on the other recycled images (`apps/mobile/src/components/agents/markdown-image.tsx:266` uses `recyclingKey={uri}` and `apps/mobile/src/components/agents/attachment-preview-strip.tsx:302` uses `recyclingKey={attachment.id}`), so the comment avatar is the outlier.
# Requested behavior
Set `recyclingKey={comment.author.avatarUrl}` on the avatar `Image` in `comment-
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The change adds Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
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.
Changelog for users
Changelog for maintainers
recyclingKeyto the author's avatar URL and keeps size, transition, and cache policy unchanged.CommentRowtest file gains a case that renders an author avatar URL and asserts the image'srecyclingKey.Image; tighten the selector if another image renders above the avatar.E2E proof
Owner request