fix: preserve decimal pushable gaps - #1091
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review. WalkthroughChanges小数句柄推挤
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR preserves valid decimal gaps using a magnitude-scaled tolerance and adds regression coverage for dragging in both directions. With the listed tests and checks passing, no actionable merge-blocking risk remains beyond normal review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 #1091 +/- ##
=======================================
Coverage 98.66% 98.67%
=======================================
Files 15 15
Lines 751 755 +4
Branches 224 235 +11
=======================================
+ Hits 741 745 +4
Misses 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
pushableFixes #227.
Problem
Aligned decimal values can still produce an inexact result when subtracted. For example,
0.7 - 0.6is slightly less than0.1, so the current rawdist < pushablecheck treats an already valid gap as too small and pushes the surrounding handle again. Dragging[0.5, 0.6, 0.7]one step to the right therefore jumps to[0.6, 0.8, 1]instead of[0.6, 0.7, 0.8].The tolerance is scaled from the compared handle values and configured gap, so it only absorbs representational noise at their magnitude; genuinely smaller gaps continue through the existing push loop.
Verification
02260ea7a23e09a76f34d9c59d41c9aae8561140[0.6, 0.8, 1]instead of[0.6, 0.7, 0.8]npm test -- --runInBand— 5/5 suites, 122/122 tests, 5/5 snapshots passednpm run tsc— passednpm run lint— passednpm run compile— passedgit diff --check— passedThe full test run retains the repositorys existing React
act(...)console warnings; it has no test failures.Overlap audit
Open PR #904 touches
useOffset.tsin the separateallowCross={false}branch and does not change the pushable distance comparison. Open PRs #1055 and #1089 touchRange.test.tsxfor unrelated deprecated-API and drag-completion coverage. No open PR implements the decimal-gap correction.AI assistance disclosure
Codex was used to reproduce the old report on current master, trace the current push loop, implement the tolerance, audit overlapping open PR files, and run the verification above. I reviewed the diff and results before submitting.
Summary by CodeRabbit
Bug 修复
测试