fix: preserve pushable gaps on track clicks - #1092
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1092 +/- ##
==========================================
+ Coverage 98.66% 98.68% +0.01%
==========================================
Files 15 15
Lines 751 761 +10
Branches 224 239 +15
==========================================
+ Hits 741 751 +10
Misses 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
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 (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. Walkthrough本次修改更新 Changes轨道点击约束
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Track clicks now preserve the documented minimum gaps for pushable ranges without changing public APIs or deployment behavior. The change is merge-ready after normal checks, with no actionable merge-blocking risk remaining. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ 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 |
Summary
offsetValuesconstraints used by drag and keyboard movementpushablegaps for both existing ranges and editable handle insertionFixes #200.
Problem
Track clicks currently replace or insert the nearest value directly, bypassing the pushable algorithm. With
[20, 40]andpushable={20}, clicking 30 emits[20, 30]; editable mode emits[20, 30, 40]. Both results violate the documented minimum adjacent gap.The corrected path keeps the clicked value at 30 and pushes its neighbors through the existing distance-mode algorithm, producing
[10, 30]and[10, 30, 50]respectively. Non-range, disabled, allow-cross, and null-range paths continue through their existing branches; the full suite covers those boundaries.Verification
02260ea7a23e09a76f34d9c59d41c9aae8561140[20, 30]/[20, 30, 40]instead of[10, 30]/[10, 30, 50]npm test -- --runInBand— 5/5 suites, 123/123 tests, 5/5 snapshots passednpm run tsc— passednpm run lint— passednpm run compile— passedgit diff --checkand source Prettier check — passedThe full test run retains the repositorys existing React
act(...)console warnings; it has no test failures.Overlap audit
Open PR #1091 changes
Range.test.tsxfor the independent decimal-distance comparison and places its test in a separate section. #1089 changes drag-completion coverage. The old #1055, #866, and #766 branches touchSlider.tsxfor deprecated APIs, mark/step memoization, and cursor styling; none changes track-click constraint handling.AI assistance disclosure
Codex was used to reproduce the old report on current master, trace the click and offset paths, implement the focused reuse of existing constraints, audit open file overlaps, and run the verification above. I reviewed the diff and results before submitting.
Summary by CodeRabbit
pushable约束的问题。