feat: remove stale gestures when diff#2297
Conversation
🦋 Changeset detectedLatest commit: 05b9dc0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis PR introduces gesture detector removal functionality across the React framework ecosystem. It adds the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
208e3fc to
05b9dc0
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/react/runtime/__test__/snapshot/gesture.test.jsx (1)
360-360: Consider extracting repeated text element lookup helper.The traversal
__root.__element_root.children[0].children[0]is repeated multiple times and is brittle to tree-shape changes; a local helper would improve maintainability.♻️ Optional refactor
+const getTextElement = () => __root.__element_root.children[0].children[0]; ... -const textElement = __root.__element_root.children[0].children[0]; +const textElement = getTextElement();Also applies to: 702-702, 848-848, 1119-1119
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/react/runtime/__test__/snapshot/gesture.test.jsx` at line 360, The test repeats the brittle traversal __root.__element_root.children[0].children[0]; extract a small helper (e.g., getTextElement or findTextElement) that returns that node so all occurrences call that function instead of duplicating the path; update usages at the locations referencing __root.__element_root.children[0].children[0] to call the helper, improving readability and making future tree-shape changes easier to handle.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/react/runtime/__test__/snapshot/gesture.test.jsx`:
- Line 360: The test repeats the brittle traversal
__root.__element_root.children[0].children[0]; extract a small helper (e.g.,
getTextElement or findTextElement) that returns that node so all occurrences
call that function instead of duplicating the path; update usages at the
locations referencing __root.__element_root.children[0].children[0] to call the
helper, improving readability and making future tree-shape changes easier to
handle.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.changeset/all-crabs-smell.md.changeset/fair-horses-worry.mdpackages/react/runtime/__test__/snapshot/gesture.test.jsxpackages/react/runtime/__test__/utils/nativeMethod.tspackages/react/runtime/src/alog/elementPAPICall.tspackages/react/runtime/src/gesture/processGesture.tspackages/react/runtime/types/types.d.tspackages/testing-library/testing-environment/etc/testing-environment.api.mdpackages/testing-library/testing-environment/src/lynx/ElementPAPI.ts
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests
Checklist