fix(image-bank): black screen when opening the image bank - #76
Merged
Merged
Conversation
On WebKit with ScrollTimeline support (macOS 26), motion hands useTransform's input range to WAAPI as keyframe offsets. FlowScrollCell computed ranges that dip below 0 on the first rows, exceed 1 on the last and aren't sorted, so element.animate threw a TypeError. With no error boundary that unmounted the whole app, leaving a black window whenever the image bank showed two or more rows of screenshots. Clamp the range into [0, 1] and keep it non-decreasing.
|
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Problem
In v0.9.0, opening the Image Bank blanks the whole window when a device has at least two rows of screenshots.
Cause
On WebKit with ScrollTimeline support (macOS 26),
motionacceleratesuseScrolland passes eachuseTransforminput range to WAAPI as keyframe offsets. The rangesFlowScrollCellcomputes go below 0 on the first rows, above 1 on the last rows, and are not sorted.element.animatethen throws aTypeError. The app has no error boundary, so React unmounts everything and leaves a black window.Fix
toKeyframeOffsets()helper (insrc/components/effects/keyframeOffsets.ts) clamps the range into [0, 1] and keeps it non-decreasing. The first row stays full size at the top of the page, which matches the intended design.Test plan
vitest(helper tests)tsc --noEmit🤖 Generated with Claude Code