Conversation
🦋 Changeset detectedLatest commit: 0a323cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a new NativeGesture class (extending ContinuousGesture), re-exports it (and ContinuousGesture) from the gesture-runtime public index, updates useGesture types to include NativeGesture, and updates tests to cover NativeGesture in creation, cloning, configuration, and React hook usage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (6)
🧰 Additional context used📓 Path-based instructions (3)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/__test__/**/*.{ts,tsx,js}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-10-11T06:16:12.517ZApplied to files:
🧬 Code graph analysis (1)packages/lynx/gesture-runtime/__test__/gesture-plain.test.ts (2)
🔇 Additional comments (2)
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: 0
🧹 Nitpick comments (1)
packages/lynx/gesture-runtime/src/nativeGesture.ts (1)
12-16: Consider expanding documentation for clarity.While the
@experimentaltag is appropriate, the JSDoc could benefit from additional details such as:
- What qualifies as a "native platform gesture"
- When to use NativeGesture vs other gesture types
- Example use cases (e.g., cooperating with ScrollView/List as mentioned in PR description)
- Any platform-specific considerations
Since this is experimental, minimal documentation may be acceptable for now, but consider adding more context in future iterations.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
.changeset/blue-pears-sin.mdpackages/lynx/gesture-runtime/__test__/gesture-clone.test.tspackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/__test__/gesture-plain.test.tspackages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/src/index.tspackages/lynx/gesture-runtime/src/nativeGesture.ts
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with the configuration specified in tsconfig.json
Files:
packages/lynx/gesture-runtime/__test__/gesture-clone.test.tspackages/lynx/gesture-runtime/src/nativeGesture.tspackages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/src/index.tspackages/lynx/gesture-runtime/__test__/gesture-plain.test.ts
**/__test__/**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
**/__test__/**/*.{ts,tsx,js}: Place test files in test/ directories adjacent to source files
Use vitest-based unit tests as configured in vitest.config.ts
Files:
packages/lynx/gesture-runtime/__test__/gesture-clone.test.tspackages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/__test__/gesture-plain.test.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,tsx}: Follow eslint rules as configured in eslint.config.js including React and TypeScript specific rules
Follow code formatting rules specified in .dprint.jsonc and biome.jsonc
Files:
packages/lynx/gesture-runtime/__test__/gesture-clone.test.tspackages/lynx/gesture-runtime/src/nativeGesture.tspackages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/src/index.tspackages/lynx/gesture-runtime/__test__/gesture-plain.test.ts
🧠 Learnings (9)
📚 Learning: 2025-10-11T06:16:12.517Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1820
File: packages/web-platform/web-tests/tests/react.spec.ts:834-856
Timestamp: 2025-10-11T06:16:12.517Z
Learning: In packages/web-platform/web-tests/tests/react.spec.ts, the tests `basic-bindmouse` and `basic-mts-bindtouchstart` are NOT duplicates despite having similar test structures. They test different event types: `basic-bindmouse` validates mouse events (mousedown, mouseup, mousemove) with mouse-specific properties (button, buttons, x, y, pageX, pageY, clientX, clientY), while `basic-mts-bindtouchstart` validates touch events (touchstart) with touch arrays (touches, targetTouches, changedTouches). The similar test structure is coincidental and follows testing conventions.
Applied to files:
packages/lynx/gesture-runtime/__test__/gesture-clone.test.tspackages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/__test__/gesture-plain.test.ts
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Applied to files:
.changeset/blue-pears-sin.md
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Applied to files:
.changeset/blue-pears-sin.md
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Applied to files:
.changeset/blue-pears-sin.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Applied to files:
.changeset/blue-pears-sin.md
📚 Learning: 2025-12-26T05:10:01.595Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.595Z
Learning: Use changeset tool with `pnpm changeset` to document changes before contribution
Applied to files:
.changeset/blue-pears-sin.md
📚 Learning: 2025-12-26T05:10:01.595Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.595Z
Learning: Applies to packages/react/components/**/*.{ts,tsx} : Optimize component library in packages/react/components/ using ReactLynx syntax
Applied to files:
packages/lynx/gesture-runtime/__test__/gesture-react.test.tsx
📚 Learning: 2025-12-29T11:26:09.487Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.487Z
Learning: Applies to packages/web-platform/web-elements/src/elements/all.ts : Export new components in `src/elements/all.ts` and add export configuration to `package.json` under `exports` for both types and default
Applied to files:
packages/lynx/gesture-runtime/__test__/gesture-react.test.tsxpackages/lynx/gesture-runtime/__test__/gesture-config.test.tspackages/lynx/gesture-runtime/src/index.ts
📚 Learning: 2025-08-06T13:28:57.182Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1453
File: vitest.config.ts:49-61
Timestamp: 2025-08-06T13:28:57.182Z
Learning: In the lynx-family/lynx-stack repository, the file `packages/react/testing-library/src/vitest.config.js` is source code for the testing library that gets exported for users, not a test configuration that should be included in the main vitest projects array.
Applied to files:
packages/lynx/gesture-runtime/__test__/gesture-config.test.ts
🧬 Code graph analysis (4)
packages/lynx/gesture-runtime/src/nativeGesture.ts (2)
packages/lynx/gesture-runtime/src/index.ts (2)
NativeGesture(48-48)ContinuousGesture(39-39)packages/lynx/gesture-runtime/src/gestureInterface.ts (2)
NativeGestureConfig(268-270)NativeGestureChangeEvent(100-102)
packages/lynx/gesture-runtime/__test__/gesture-react.test.tsx (3)
packages/lynx/gesture-runtime/src/index.ts (6)
NativeGesture(48-48)useGesture(51-51)PanGesture(45-45)TapGesture(46-46)FlingGesture(44-44)LongPressGesture(47-47)packages/lynx/gesture-runtime/src/nativeGesture.ts (1)
NativeGesture(23-23)packages/lynx/gesture-runtime/src/useGesture.ts (1)
useGesture(34-34)
packages/lynx/gesture-runtime/__test__/gesture-config.test.ts (2)
packages/lynx/gesture-runtime/src/index.ts (1)
NativeGesture(48-48)packages/lynx/gesture-runtime/src/nativeGesture.ts (1)
NativeGesture(23-23)
packages/lynx/gesture-runtime/__test__/gesture-plain.test.ts (3)
packages/lynx/gesture-runtime/src/index.ts (1)
NativeGesture(48-48)packages/lynx/gesture-runtime/src/nativeGesture.ts (1)
NativeGesture(23-23)packages/web-platform/playwright-fixtures/src/coverage-fixture.ts (1)
expect(65-65)
🔇 Additional comments (11)
.changeset/blue-pears-sin.md (1)
1-5: LGTM! Changeset is properly formatted.The changeset correctly documents the addition of
NativeGestureas a patch-level change to@lynx-js/gesture-runtime.packages/lynx/gesture-runtime/__test__/gesture-config.test.ts (2)
10-10: LGTM! Import added correctly.NativeGesture is properly imported from the public API for use in tests.
169-182: LGTM! NativeGesture properly included in common configuration tests.The addition ensures NativeGesture is validated for the
enabled()configuration method alongside other gesture types.packages/lynx/gesture-runtime/__test__/gesture-clone.test.ts (1)
10-10: LGTM! Import and test coverage are appropriate.NativeGesture is correctly imported and included in the clone identity tests to verify proper cloning behavior.
packages/lynx/gesture-runtime/src/nativeGesture.ts (2)
5-10: LGTM! Imports are correct.All necessary dependencies for the NativeGesture class are properly imported.
17-21: GestureTypeInner.NATIVE enum value is defined. No action required. TheNATIVEvalue is properly defined in theGestureTypeInnerenum (value 7) in packages/lynx/gesture-runtime/src/gestureInterface.ts, making the implementation correct.packages/lynx/gesture-runtime/__test__/gesture-plain.test.ts (1)
30-35: LGTM! Test coverage is consistent with existing patterns.The NativeGesture type test follows the same structure as other gesture types, ensuring proper type identification.
packages/lynx/gesture-runtime/src/index.ts (2)
5-5: Verify that exporting ContinuousGesture is intentional.
ContinuousGestureis now part of the public API surface. While NativeGesture extends this base class, exporting the base class commits to maintaining it as a stable public API. Consider whether:
- Users need direct access to
ContinuousGesturefor extending or type-checking- This should remain internal until NativeGesture graduates from experimental status
- The export should be documented if it's intentional for advanced use cases
Based on learnings, if this export is needed, it should be documented in the changeset or public API documentation.
Also applies to: 39-39
16-16: LGTM! NativeGesture is properly exported.The new gesture class is correctly imported and exported as part of the public API, making it available for consumers alongside other gesture types.
Also applies to: 48-48
packages/lynx/gesture-runtime/__test__/gesture-react.test.tsx (2)
41-46: LGTM! React creation test includes NativeGesture.The test properly verifies that NativeGesture can be instantiated and has the correct type in a React context.
105-128: LGTM! useGesture hook test includes NativeGesture.The test correctly verifies that NativeGesture can be created via the
useGesturehook and returns the proper instance type.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #2076 will not alter performanceComparing Summary
Footnotes
|
Web Explorer#6956 Bundle Size — 379.18KiB (0%).0a323cd(current) vs 394ebe1 main#6947(baseline) Bundle metrics
Bundle size by type
|
| Current #6956 |
Baseline #6947 |
|
|---|---|---|
249.67KiB |
249.67KiB |
|
96.98KiB |
96.98KiB |
|
32.53KiB |
32.53KiB |
Bundle analysis report Branch f0rdream:native-gesture Project dashboard
Generated by RelativeCI Documentation Report issue
|
@codex review |
React Example#6796 Bundle Size — 237KiB (0%).0a323cd(current) vs 394ebe1 main#6787(baseline) Bundle metrics
|
| Current #6796 |
Baseline #6787 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
162 |
162 |
|
65 |
65 |
|
46.74% |
46.74% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #6796 |
Baseline #6787 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.24KiB |
91.24KiB |
Bundle analysis report Branch f0rdream:native-gesture Project dashboard
Generated by RelativeCI Documentation Report issue
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
39e6083 to
7b178b5
Compare
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/gesture-runtime@2.1.1 ### Patch Changes - Add `NativeGesture` ([#2076](#2076)) ## @lynx-js/react@0.115.3 ### Patch Changes - Add dual-thread commutation logs for troubleshooting when `REACT_ALOG=true` or global define `__ALOG__` is set. ([#2081](#2081)) - Use error cause to simplify the error msg of lazy bundle loading. User can catch the error cause to get the original result: ([#2056](#2056)) ```ts const LazyComponent = lazy(async () => { try { const mod = await import("./lazy-bundle"); return mod.default; } catch (error) { console.error(`Lazy Bundle load failed message: ${error.message}`); // User can catch the error cause to get the original result console.error(`Lazy Bundle load failed result: ${error.cause}`); throw error; } }); ``` ## @lynx-js/rspeedy@0.12.5 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.19.4 ## @lynx-js/react-rsbuild-plugin@0.12.4 ### Patch Changes - ([#2051](#2051)) - Updated dependencies \[]: - @lynx-js/react-alias-rsbuild-plugin@0.12.4 - @lynx-js/use-sync-external-store@1.5.0 - @lynx-js/react-refresh-webpack-plugin@0.3.4 - @lynx-js/react-webpack-plugin@0.7.3 ## @lynx-js/testing-environment@0.1.9 ### Patch Changes - Fix duplicated `<page />` elements on body when multiple `__CreatePage` called. ([#2065](#2065)) ## @lynx-js/web-constants@0.19.4 ### Patch Changes - Updated dependencies \[[`bba05e2`](bba05e2)]: - @lynx-js/web-worker-rpc@0.19.4 ## @lynx-js/web-core@0.19.4 ### Patch Changes - Updated dependencies \[[`bba05e2`](bba05e2)]: - @lynx-js/web-worker-rpc@0.19.4 - @lynx-js/web-constants@0.19.4 - @lynx-js/web-worker-runtime@0.19.4 - @lynx-js/web-mainthread-apis@0.19.4 ## @lynx-js/web-elements@0.10.1 ### Patch Changes - feat: implement x-webview component ([#2061](#2061)) - feat: support `recyclable="false"` on `list-item` and enable overflow visibility ([#2069](#2069)) ## @lynx-js/web-mainthread-apis@0.19.4 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-constants@0.19.4 ## @lynx-js/web-worker-rpc@0.19.4 ### Patch Changes - Ensure the `default` export entry is last in the package exports map. ([#2075](#2075)) ## @lynx-js/web-worker-runtime@0.19.4 ### Patch Changes - Updated dependencies \[[`bba05e2`](bba05e2)]: - @lynx-js/web-worker-rpc@0.19.4 - @lynx-js/web-constants@0.19.4 - @lynx-js/web-mainthread-apis@0.19.4 ## create-rspeedy@0.12.5 ## @lynx-js/react-alias-rsbuild-plugin@0.12.4 ## upgrade-rspeedy@0.12.5 ## @lynx-js/web-core-server@0.19.4 ## @lynx-js/web-rsbuild-server-middleware@0.19.4 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Add experimental
NativeGesture, which provide an interface to cooperate with ScrollView, List's internal native gesture.Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.