Repository navigation
Conversation
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
Co-authored-by: generaltony007 <144252170+GeneralTony007@users.noreply.github.com>
|
@hakarrr is attempting to deploy a commit to the Darkroom Team on Vercel. A member of the Team first needs to authorize it. |
4 tasks done
Author
|
Could you review this horizontal snap alignment fix and the separate observer-cleanup fix in #566? Is there anything you need changed in the implementation or regression coverage before they can move forward? I can address specific feedback on each PR. Thanks. |
This branch has not been deployed
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.
What & why
computeSnaps()usesrect.topforalign: 'start'regardless of the Lenis orientation. A horizontal instance therefore scrolls to the element's vertical position instead of its horizontal position. Center and end alignment already use the appropriate axis.Use
rect.leftfor horizontal start alignment, keeping vertical start unchanged. No API or default changes.This was found while testing the existing horizontal snap behavior, so there is no separate issue.
How to verify
bun install --frozen-lockfile bun test packages/snap/tests/align.test.js bun run build bunx biome check packages/snap/src/snap.ts packages/snap/tests/align.test.jsThe regression exercises
Snap.addElement()andgoTo()for start, center, and end on both axes. Before the source change: 5 pass, 1 fail (horizontal start requests 20 instead of 640). After: 6 pass.Also verified the built browser bundles in Chromium with a real horizontal
Lenisinstance and an element positioned atleft: 1400px; top: 180px:With a 3200px-wide page and 1000px viewport, the unmodified bundle scrolls to x=180, leaving the target at viewport x=1220. The fixed bundle scrolls to x=1400, placing the target at viewport x=0.
bun run build, the focused tests, and the focused Biome check pass. Standalonetsc --noEmitreports the same existing workspace module-resolution errors on both the base and this change (includinglenis,lenis/vue, and Nuxt#imports); no standalone all-green typecheck claim.Checklist