Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change documents hinge sensor support with new types, statuses, output fields, and platform rules. It adds an interactive hinge playground with slider controls and a two-panel visualization. It also adds a React Native example that uses hinge angle data to rotate two panels around a shared edge. Priority: ⬇️ Low Change: Other Merge Risk: 🔵 Low · up to The hinge playground’s angle field remains awkward to edit after clearing it, but the impact is limited to the documentation demo. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 67ac028e-68ed-4d58-8f24-058fab341be2
📒 Files selected for processing (6)
docs/docs-reanimated/docs/device/useAnimatedSensor.mdxdocs/docs-reanimated/src/components/InteractivePlayground/index.tsxdocs/docs-reanimated/src/components/InteractivePlayground/useAnimatedHingePlayground/Example.tsxdocs/docs-reanimated/src/components/InteractivePlayground/useAnimatedHingePlayground/index.tsxdocs/docs-reanimated/src/components/InteractivePlayground/useAnimatedHingePlayground/styles.module.cssdocs/docs-reanimated/src/examples/AnimatedHinge.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| max={FLAT_DEGREES} | ||
| step={1} | ||
| value={degrees} | ||
| onChange={setDegrees} |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject non-finite angle input.
When a user clears the number input, Range emits NaN. This setter stores it. The playground then renders angle: NaN and rotateY(NaNdeg), so the code preview and foldable model are invalid. Normalize the value here, or make Range suppress non-finite values.
Proposed fix
- onChange={setDegrees}
+ onChange={(value) => {
+ if (Number.isFinite(value)) {
+ setDegrees(value);
+ }
+ }}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| onChange={setDegrees} | |
| onChange={(value) => { | |
| if (Number.isFinite(value)) { | |
| setDegrees(value); | |
| } | |
| }} |
66c11e5 to
4fdfa08
Compare
4fdfa08 to
9cd0222
Compare
3530faf to
648678e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a7a2f87d-add8-4f5a-899f-5e1c039e61d8
📒 Files selected for processing (1)
docs/docs-reanimated/src/components/InteractivePlayground/index.tsx
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| if (!Number.isFinite(newValue)) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve an editable empty state in Range.
When a user selects the current number and deletes it, parseFloat returns NaN. This branch skips onChange, so the controlled TextField retains the old value and prevents keyboard replacement. Keep a string draft for the text field, or commit the clamped numeric value on blur.
945cdd1 to
cfc3a52
Compare
4d2a781 to
acffbaf
Compare
acffbaf to
e584608
Compare
ade3b17 to
ed53545
Compare
ed53545 to
e665f90
Compare
ba8e23e to
3a9f0e6
Compare
cf8b07b to
dc00278
Compare
dc00278 to
7fc6e5c
Compare
7fc6e5c to
aa51470
Compare
Note
This PR description is AI-generated.
Requires #10651.
Summary
#10651 adds
SensorType.HINGE, and theuseAnimatedSensorpage did not mention it. I documented the new type:HINGEin the sensor list, theValueHingeshape, theHingeStatusenum, the fact that it takes no config, a usage snippet that folds two panels withrotateY, and a platform table with the Samsung quantisation remark. The live demos on the page run on web, where no hinge exists, so I added a playground in the style of the other sensor playgrounds: a slider drives a CSS foldable mock and the code box shows theanglein radians and the derivedstatus.Test plan
yarn format:mdreports no diff and the docslintpasses. The docstypecheckreports errors in the new example file because the docs package resolvesreact-native-reanimatedfrom npm, which has noSensorType.HINGEyet; the same script also fails on pre-existing files.Changelog
yarn changelog:addfor each changed package, or this PR does not changereact-native-reanimatedorreact-native-worklets.