fix(preprod): Fix snapshot list scroll-to and duplicate React keys#115396
Merged
Conversation
Contributor
📊 Type Coverage Diff✅ No new type safety issues introduced. Coverage: 93.50% |
7b7d615 to
c0d9e10
Compare
Contributor
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
Contributor
Author
|
forgive me reviewers, pls ignore... it was llm trolling w the rebase 😢 |
5b03cb2 to
cf72370
Compare
Two fixes to the snapshot list virtualizer: 1. Use image_file_name instead of content hash for card React keys. Images with identical content within the same group shared a hash, causing duplicate key warnings and potential rendering issues. 2. Retry scrollIntoView across frames until the element position converges. The virtualizer's ResizeObserver measures newly-visible items after the initial scroll, recalculating translateY positions and shifting the target element. A single scrollIntoView was invalidated by these subsequent measurement cascades. Co-Authored-By: Claude <noreply@anthropic.com>
Replace hardcoded LIST_CONTENT_WIDTH_ASSUMPTION with actual container width measured via ResizeObserver, so virtualizer height estimates match rendered sizes. Remove shouldAdjustScrollPositionOnItemSizeChange override that suppressed scroll compensation, which caused both programmatic scroll-to drift and scroll-up position jumps. Simplify initial scroll retry from 8-frame convergence loop to 3-frame element lookup. Co-Authored-By: Claude <noreply@anthropic.com>
cf72370 to
4eaad53
Compare
mtopo27
approved these changes
May 12, 2026
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.
Two fixes to the snapshot list virtualizer:
Duplicate React keys: Card IDs used the image content hash (
image.key),but images with identical visual content within the same group share a hash.
Switched to
image_file_namewhich is always unique.Scroll-to drift: When navigating to a specific snapshot via URL param or
sidebar click,
scrollIntoViewcorrectly positioned the target on the firstframe. However, the virtualizer's ResizeObserver then measured newly-visible
items (rendered by overscan after the scroll), recalculated all
translateYpositions via
flushSync, and shifted the target element out of view — whileshouldAdjustScrollPositionOnItemSizeChange = falseprevented scrollcompensation.
Fixed by retrying
scrollIntoViewacross animation frames until the element'sposition converges (changes < 2px between frames), with a max of 8 retries.
This lets the measurement cascade settle before locking in the final position.