Skip to content

fix: Exclude the XFoldviewSlotNg element from touch event element lis…#2304

Merged
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/try-to-fix-foldview-ng-stuck
Mar 5, 2026
Merged

fix: Exclude the XFoldviewSlotNg element from touch event element lis…#2304
PupilTong merged 1 commit intolynx-family:mainfrom
PupilTong:p/hw/try-to-fix-foldview-ng-stuck

Conversation

@PupilTong
Copy link
Copy Markdown
Collaborator

@PupilTong PupilTong commented Mar 5, 2026

…ts to resolve a stuck issue.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the foldview component could become stuck during touch interactions.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@PupilTong PupilTong requested a review from Sherry-hue as a code owner March 5, 2026 04:01
@PupilTong PupilTong self-assigned this Mar 5, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 5, 2026

🦋 Changeset detected

Latest commit: aeb2884

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@lynx-js/web-elements Patch
@lynx-js/web-core-wasm Patch
@lynx-js/template-webpack-plugin Patch
@lynx-js/react-rsbuild-plugin Patch
@lynx-js/react-alias-rsbuild-plugin Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

This PR introduces a changelog entry for a patch release and fixes a bug in the XFoldViewNg touch event handler. The fix excludes the DOM element itself from element collections during path and touch start handling to resolve a foldview stuck issue.

Changes

Cohort / File(s) Summary
Changelog Entry
.changeset/spotty-dryers-cry.md
New changelog entry documenting patch release for @lynx-js/web-elements with foldview stuck issue fix.
Touch Event Handler Fix
packages/web-platform/web-elements/src/elements/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.ts
Added check to exclude DOM element from collected elements in pathElements and touchStart methods via element !== this.#dom condition.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

platform:Web

Poem

🐰 A foldview was stuck in a bind,
Elements collected, jumbled and twined,
But a rabbit's quick fix, precise and true,
Excluded the DOM with a !== this.#dom view,
Now the folds flow freely, no stuckness in sight! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: excluding the XFoldviewSlotNg element from touch event element lists to fix a stuck issue, which aligns with the file modifications and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/web-platform/web-elements/src/elements/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.ts (1)

97-107: ⚠️ Potential issue | 🟡 Minor

Consider excluding this.#dom from pointElements for consistency.

The fix correctly excludes this.#dom from pathElements on line 101, but pointElements on lines 104-106 omits this exclusion. Since Element.contains() returns true for the element itself, this.#dom can be included in pointElements when the touch point falls within its bounds. This would add the container element to this.#elements where it shouldn't belong, inconsistent with the #touchStart method (line 130) which explicitly filters with && e !== this.#dom.

Suggested fix for consistency
     const pointElements = document.elementsFromPoint(clientX, clientY).filter(
-      e => this.#dom.contains(e),
+      e => this.#dom.contains(e) && e !== this.#dom,
     );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/web-platform/web-elements/src/elements/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.ts`
around lines 97 - 107, pathElements excludes the container element (this.#dom)
but pointElements does not, causing this.#dom to be included in this.#elements
inconsistently; update the filtering of pointElements in
XFoldviewSlotNgTouchEventsHandler (the pointElements variable) to also exclude
this.#dom (same predicate used for pathElements: element instanceof Element &&
this.#dom.contains(element) && element !== this.#dom) so that when you compute
this.#elements = [...new Set([...pathElements, ...pointElements])], the
container is never added; mirror the check used in `#touchStart` to ensure
consistent behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@packages/web-platform/web-elements/src/elements/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.ts`:
- Around line 97-107: pathElements excludes the container element (this.#dom)
but pointElements does not, causing this.#dom to be included in this.#elements
inconsistently; update the filtering of pointElements in
XFoldviewSlotNgTouchEventsHandler (the pointElements variable) to also exclude
this.#dom (same predicate used for pathElements: element instanceof Element &&
this.#dom.contains(element) && element !== this.#dom) so that when you compute
this.#elements = [...new Set([...pathElements, ...pointElements])], the
container is never added; mirror the check used in `#touchStart` to ensure
consistent behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c633e8ea-ad1a-40b0-bdb5-55a0d31a4f35

📥 Commits

Reviewing files that changed from the base of the PR and between e7d94be and aeb2884.

📒 Files selected for processing (2)
  • .changeset/spotty-dryers-cry.md
  • packages/web-platform/web-elements/src/elements/XFoldViewNg/XFoldviewSlotNgTouchEventsHandler.ts

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 5, 2026

Merging this PR will degrade performance by 8.4%

❌ 1 regressed benchmark
✅ 71 untouched benchmarks
⏩ 3 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-nest-level-100 6.8 ms 7.4 ms -8.4%

Comparing PupilTong:p/hw/try-to-fix-foldview-ng-stuck (aeb2884) with main (e7d94be)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Mar 5, 2026

Web Explorer

#7967 Bundle Size — 383.56KiB (~+0.01%).

aeb2884(current) vs e7d94be main#7961(baseline)

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
#7967
     Baseline
#7961
Regression  Initial JS 154.66KiB(+0.02%) 154.63KiB
No change  Initial CSS 35.1KiB 35.1KiB
Change  Cache Invalidation 40.32% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 239(+0.42%) 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.99% 2.99%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#7967
     Baseline
#7961
Regression  JS 252.6KiB (+0.01%) 252.58KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.1KiB 35.1KiB

Bundle analysis reportBranch PupilTong:p/hw/try-to-fix-foldvi...Project dashboard


Generated by RelativeCIDocumentationReport issue

@PupilTong PupilTong merged commit fca9d4a into lynx-family:main Mar 5, 2026
109 of 114 checks passed
colinaaa pushed a commit that referenced this pull request Mar 9, 2026
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/devtool-mcp-server@0.5.0

### Minor Changes

- Use `@lynx-js/devtool-connector` instead of
`@lynx-js/debug-router-connector`.
([#2284](#2284))

The new connector avoids using keep-alive connections, which makes the
connection much more reliable.

- **BREAKING CHANGE**: Remove the `./debug-router-connector` exports.
([#2284](#2284))

## @lynx-js/web-elements@0.12.0

### Minor Changes

- feat: add `willchange` event to `x-viewpager-ng`
([#2305](#2305))

### Patch Changes

- fix: firefox `@supports(width:1rex)`
([#2288](#2288))

- fix: check computed overflow style in `getTheMostScrollableKid` to
avoid treating `overflow: visible` elements as scroll containers
([#2309](#2309))

- fix: the inline-truncation should only work as a direct child of
x-text ([#2287](#2287))

- fix: getVisibleCells cannot work in firefox due to
contentvisibilityautostatechange not propagate list-item
([#2308](#2308))

- fix: foldview stuck issue
([#2304](#2304))

## @lynx-js/gesture-runtime@2.1.3

### Patch Changes

- Optimize gesture callbacks and relationships to prevent unnecessary
gesture registration and rerenders.
([#2277](#2277))

## @lynx-js/react@0.116.5

### Patch Changes

- Improve React runtime hook profiling.
([#2235](#2235))
Enable Profiling recording first, then enter the target page so the
trace includes full render/hydrate phases.

- Record trace events for `useEffect` / `useLayoutEffect` hook entry,
callback, and cleanup phases.
    -   Log trace events for `useState` setter calls.
- Wire `profileFlowId` support in debug profile utilities and attach
flow IDs to related hook traces.
- Instrument hydrate/background snapshot profiling around patch
operations with richer args (e.g. snapshot id/type, dynamic part index,
value type, and source when available).
- Capture vnode source mapping in dev and use it in profiling args to
improve trace attribution.
- Expand debug test coverage for profile utilities, hook profiling
behavior, vnode source mapping, and hydrate profiling branches.

- refactor: call loadWorkletRuntime once in each module
([#2315](#2315))

## @lynx-js/rspeedy@0.13.5

### Patch Changes

- feat: opt-in the web platform's new binary output format
([#2281](#2281))

    Introduce a new flag to enable the new binary output format.

Currently it's an internal-use-only flag that will be removed in the
future; set the corresponding environment variable to 'true' to enable
it.

- Avoid generating `Rsbuild vundefined` in greeting message.
([#2275](#2275))

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.8

## @lynx-js/lynx-bundle-rslib-config@0.2.2

### Patch Changes

- Support bundle and load css in external bundle
([#2143](#2143))

## @lynx-js/external-bundle-rsbuild-plugin@0.0.3

### Patch Changes

- Updated dependencies
\[[`c28b051`](c28b051),
[`4cbf809`](4cbf809)]:
    -   @lynx-js/externals-loading-webpack-plugin@0.0.4

## @lynx-js/react-rsbuild-plugin@0.12.10

### Patch Changes

- Support bundle and load css in external bundle
([#2143](#2143))

- Updated dependencies
\[[`59f2933`](59f2933),
[`453e006`](453e006)]:
    -   @lynx-js/template-webpack-plugin@0.10.5
    -   @lynx-js/css-extract-webpack-plugin@0.7.0
    -   @lynx-js/react-webpack-plugin@0.7.4
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.10
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4

## @lynx-js/web-core-wasm@0.0.5

### Patch Changes

- Updated dependencies
\[[`4963907`](4963907),
[`8fd936a`](8fd936a),
[`0d41253`](0d41253),
[`d32c4c6`](d32c4c6),
[`7518b72`](7518b72),
[`fca9d4a`](fca9d4a)]:
    -   @lynx-js/web-elements@0.12.0

## @lynx-js/externals-loading-webpack-plugin@0.0.4

### Patch Changes

- perf: optimize external bundle loading by merging multiple
`fetchBundle` calls for the same URL into a single request.
([#2307](#2307))

- Support bundle and load css in external bundle
([#2143](#2143))

## @lynx-js/template-webpack-plugin@0.10.5

### Patch Changes

- feat: allow `templateDebugUrl` to be customized via
`output.publicPath` or the `beforeEncode` hook.
([#2274](#2274))

- feat: opt-in the web platform's new binary output format
([#2281](#2281))

    Introduce a new flag to enable the new binary output format.

Currently it's an internal-use-only flag that will be removed in the
future; set the corresponding environment variable to 'true' to enable
it.

-   Updated dependencies \[]:
    -   @lynx-js/web-core-wasm@0.0.5

## create-rspeedy@0.13.5



## @lynx-js/react-alias-rsbuild-plugin@0.12.10



## upgrade-rspeedy@0.13.5

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants