Uh oh!
There was an error while loading. Please reload this page.
fix: prevent browser zoom in image preview - #527
Conversation
@trudbot is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
0b2ce6e to
31d7d11CompareWalkthrough预览组件移除 Changes滚轮缩放流程
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #527 +/- ##
=======================================
Coverage 99.26% 99.27% =======================================
Files 17 17 Lines 543 549 +6 Branches 166 167 +1 =======================================
+ Hits 539 545 +6
Misses 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
nrps9909
left a comment
There was a problem hiding this comment.
Reviewed exact head 31d7d1171eb242bce570386ccf594a49a869ea04.
I traced the wheel path from the preview image through the native non-passive listener, including listener registration/cleanup, wheel={false}, target filtering, scale limits, and transform dispatch. The move from React's delegated onWheel to one native window listener avoids the passive-listener limitation without double-dispatching zoom.
Validation performed:
npm test -- tests/preview.test.tsx --runInBand— 42/42 passednpm test -- --runInBand— 8 suites, 81/81 tests and 1/1 snapshot passednpm run tsc— passednpm run lint -- --no-fix— 0 errors (repository's existing warnings remain)npx prettier --check src/hooks/useMouseEvent.ts src/Preview/index.tsx tests/preview.test.tsx— passednpm run build— passedgit diff --check ca5754037261b89a60681bf85c056d6533adee8d...31d7d1171eb242bce570386ccf594a49a869ea04— clean- Additional isolated probe: a cancelable Ctrl+wheel event outside the active preview image remained unprevented and did not alter the image transform
The red Vercel status is an external preview-authorization failure, not a failing code check. I found no blocking correctness or regression issue in this head.
AI assistance disclosure: Codex was used to help trace the event-listener lifecycle, run the isolated validation matrix, and draft this review. I independently checked the exact diff, live review state, and test results before approving.
Summary
Tests
Summary by CodeRabbit
新功能
变更