Skip to content

Conversation

@Sherry-hue
Copy link
Collaborator

@Sherry-hue Sherry-hue commented Nov 3, 2025

…timization

Summary by CodeRabbit

  • New Features

    • Support for estimated-main-axis-size-px on list items (no explicit width/height required).
  • Bug Fixes

    • Horizontal waterfall lower-threshold triggering and observer positioning fixed.
    • AutoScroll startup/timing improved, orientation-aware stopping, and immediate scroll behavior to reduce lag.
    • AutoScroll now reliably runs when invoked from effects.
    • Added layout containment to list items for stable sizing.
  • Tests

    • Added tests validating scrolltolower across multiple list layouts.

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).

@changeset-bot
Copy link

changeset-bot bot commented Nov 3, 2025

🦋 Changeset detected

Latest commit: a7b684e

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

This PR includes changesets to release 2 packages
Name Type
@lynx-js/web-elements Patch
@lynx-js/web-elements-template 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
Contributor

coderabbitai bot commented Nov 3, 2025

📝 Walkthrough

Walkthrough

Adds an attribute handler estimated-main-axis-size-px to list items, integrates it into ListItem, adjusts autoScroll scheduling and orientation-aware clamping, centralizes waterfall lower-threshold updates behind an enable/disable handler, updates list-item containment styles, imports ListItem in aggregation, and adds Playwright tests and fixtures for vertical/horizontal single and waterfall lists.

Changes

Cohort / File(s) Summary
Changelog
\.changeset/rude-windows-attack.md
Patch release notes documenting estimated-main-axis-size-px support, horizontal waterfall fix, and autoScroll fix.
Attribute handler
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts
New ListItemAttributes class registering reactive handler for estimated-main-axis-size-px, binding value to --estimated-main-axis-size-px (converted to px).
ListItem integration
packages/web-platform/web-elements/src/XList/ListItem.ts
@Component decorator now depends on ListItemAttributes in addition to CommonEventsAndMethods.
Core autoScroll
packages/web-platform/web-elements/src/XList/XList.ts
AutoScroll scheduling/timing adjusted (rAF/setTimeout interplay), scrollBy uses behavior: 'auto', orientation-aware auto-stop and axis clamping, and initial scheduling conditioned on container scrollability.
Waterfall lower-threshold handling
packages/web-platform/web-elements/src/XList/XListWaterfall.ts
New @registerEventEnableStatusChangeHandler('scrolltolower') method toggles x-enable-scrolltolower-event and defers orientation-aware lower-threshold observer style updates; removed prior inline initialization styling.
Styling
packages/web-platform/web-elements/src/XList/x-list.css
Adds contain: size and contain-intrinsic-size: auto var(--estimated-main-axis-size-px) to list-item; for horizontal waterfall, sets bottom: unset on lower-threshold observer.
Module aggregation
packages/web-platform/web-elements/src/all.ts
Adds import './XList/ListItem.js' to aggregated imports.
Tests — runner
packages/web-platform/web-tests/tests/react.spec.ts
Adds four Playwright tests asserting scrolltolower emission for vertical/horizontal single and waterfall lists using estimated-main-axis-size-px.
Test fixture — vertical single
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx, .../index.css
New test app rendering vertical single-type list with six items using estimated-main-axis-size-px={100}, triggers autoScroll on mount and logs scrolltolower.
Test fixture — vertical waterfall
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx, .../index.css
New vertical waterfall test (span-count=2) mapping data-driven estimated-main-axis-size-px values, triggers autoScroll and logs events.
Test fixture — horizontal single
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx, .../index.css
New horizontal single-type test with six items at estimated-main-axis-size-px={100}, triggers autoScroll and logs events.
Test fixture — horizontal waterfall
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx, .../index.css
New horizontal waterfall test (span-count=2) mapping sizes to estimated-main-axis-size-px, triggers autoScroll and logs events.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Pay extra attention to:
    • packages/web-platform/web-elements/src/XList/XList.ts: rAF vs setTimeout scheduling, scroll axis detection, and clamp logic.
    • packages/web-platform/web-elements/src/XList/XListWaterfall.ts: timing of deferred lower-threshold style updates and use of scrollWidth/scrollHeight with forceful styles.
    • packages/web-platform/web-elements/src/XList/ListItemAttributes.ts and x-list.css: attribute parsing, px conversion, and containment / intrinsic-size interactions.
    • Playwright tests: wait durations and potential flakiness across environments.

Suggested reviewers

  • PupilTong
  • hzy

Poem

🐇 I hop and map each item’s size with care,
pixels tucked into a CSS lair,
waterfalls learn left from down and right,
AutoScroll wakes timely on first light,
"scrolltolower" whispers — the list breathes light.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat(web): list estimated-main-axis-size-px supports && autoScroll op…" directly corresponds to the main changes in the changeset. The title references two primary features: support for the new list-estimated-main-axis-size-px property and autoScroll optimizations. These are evident throughout the changes, including the new ListItemAttributes class, CSS containment updates, XList/XListWaterfall modifications for improved autoScroll behavior, and corresponding test additions. The title is concise, specific, and clearly conveys the primary purpose of the PR, following standard commit convention format (feat(web):). While the title is truncated in display, the core message is clear and directly reflects the changeset's main objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 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.

@Sherry-hue Sherry-hue force-pushed the feat/list-esti-autoScroll branch from c75ede7 to b3503c1 Compare November 3, 2025 07:11
Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1)

1-56: Remove unused import.

The useState import on line 4 is not used in this test file.

Apply this diff:

-import { root, useEffect, useRef } from '@lynx-js/react';
+import { root, useEffect, useRef } from '@lynx-js/react';

Wait, let me check again - the import doesn't include useState. Let me verify from the code...

Actually, looking at the code, line 4 only imports root, useEffect, useRef - there's no unused import. The test looks clean and consistent with similar test files in the codebase.

packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (1)

4-4: Remove unused import.

useState is imported but never used in this file.

Apply this diff:

-import { root, useRef, useState, useEffect } from '@lynx-js/react';
+import { root, useRef, useEffect } from '@lynx-js/react';
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (1)

4-4: Remove unused import.

useState is imported but never used in this file.

Apply this diff:

-import { root, useRef, useState, useEffect } from '@lynx-js/react';
+import { root, useRef, useEffect } from '@lynx-js/react';
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b41b58d and c75ede7.

📒 Files selected for processing (16)
  • .changeset/rude-windows-attack.md (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItem.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/XList.ts (3 hunks)
  • packages/web-platform/web-elements/src/XList/XListWaterfall.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/x-list.css (2 hunks)
  • packages/web-platform/web-elements/src/all.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react.spec.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

For contributions, generate and commit a Changeset describing your changes

Files:

  • .changeset/rude-windows-attack.md
🧠 Learnings (10)
📚 Learning: 2025-09-18T08:12:56.802Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.

Applied to files:

  • packages/web-platform/web-elements/src/all.ts
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-elements/src/XList/XListWaterfall.ts
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-elements/src/XList/x-list.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css
📚 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/rude-windows-attack.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/rude-windows-attack.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/rude-windows-attack.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • .changeset/rude-windows-attack.md
📚 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/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx
  • packages/web-platform/web-tests/tests/react.spec.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/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
📚 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/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx
📚 Learning: 2025-08-13T09:20:00.936Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1502
File: packages/react/testing-library/types/entry.d.ts:71-71
Timestamp: 2025-08-13T09:20:00.936Z
Learning: In lynx-js/react testing library, wrapper components must have children as a required prop because they are always called with `h(WrapperComponent, null, innerElement)` where innerElement is passed as children. The type `React.JSXElementConstructor<{ children: React.ReactNode }>` correctly requires children to be mandatory.

Applied to files:

  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
📚 Learning: 2025-08-13T09:23:36.222Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1502
File: packages/react/testing-library/types/entry.d.ts:97-97
Timestamp: 2025-08-13T09:23:36.222Z
Learning: React Testing Library's rerender function accepts React.ReactNode (including strings, numbers, null, etc.), not just React.ReactElement. The typing should match RTL's behavior by using React.ReactNode for maximum compatibility.

Applied to files:

  • packages/web-platform/web-tests/tests/react.spec.ts
🧬 Code graph analysis (5)
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1)
packages/web-platform/web-elements/src/XText/XTextTruncation.ts (1)
  • parseFloat (302-317)
packages/web-platform/web-elements/src/XList/ListItem.ts (2)
packages/web-platform/web-elements/src/common/CommonEventsAndMethods.ts (1)
  • CommonEventsAndMethods (10-62)
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1)
  • ListItemAttributes (15-34)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (2)
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (3)
  • data (7-13)
  • ref (16-16)
  • handleScrollToLower (18-20)
packages/web-platform/web-tests/tests/react/basic-element-list-waterfall/index.jsx (1)
  • App (29-43)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (3)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (2)
  • ref (16-16)
  • handleScrollToLower (18-20)
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (2)
  • ref (16-16)
  • handleScrollToLower (18-20)
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (2)
  • ref (8-8)
  • handleScrollToLower (10-12)
packages/web-platform/web-tests/tests/react.spec.ts (1)
packages/web-platform/web-tests/tests/coverage-fixture.ts (1)
  • test (11-60)
🪛 LanguageTool
.changeset/rude-windows-attack.md

[style] ~7-~7: Consider using a different verb for a more formal wording.
Context: ...list-item are no longer required. 2. Fixed an issue where the list `lower-threshol...

(FIX_RESOLVE)


[style] ~9-~9: Consider using a different verb for a more formal wording.
Context: ...al layout under a waterfall layout. 3. Fixed an issue where calling the list `autoSc...

(FIX_RESOLVE)

🔇 Additional comments (17)
.changeset/rude-windows-attack.md (1)

1-9: Changeset looks good!

The changeset properly documents the three user-facing improvements in this PR:

  1. Support for estimated-main-axis-size-px property
  2. Horizontal waterfall layout event triggering fix
  3. autoScroll behavior fix in useEffect

The content is clear and provides appropriate release notes for a patch release.

packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css (1)

1-22: LGTM!

The CSS provides clean, simple styling for the horizontal list test page. The layout structure (full-viewport page, fixed-height list, styled items) is consistent with the other test pages in this PR.

packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css (1)

1-22: LGTM!

The CSS properly supports the waterfall test page with dynamic item coloring via the --item-index CSS variable. The HSL calculation provides visually distinct items for testing purposes.

packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css (1)

1-22: LGTM!

The CSS provides appropriate styling for the basic estimated-main-axis-size-px test page. The layout is consistent with the other test variants introduced in this PR.

packages/web-platform/web-elements/src/all.ts (1)

17-17: LGTM!

The import addition properly includes ListItem.js in the module load sequence, which is necessary for the new ListItemAttributes functionality introduced in this PR.

packages/web-platform/web-elements/src/XList/XListWaterfall.ts (1)

169-180: LGTM! Horizontal waterfall layout fix is correct.

The changes properly address the horizontal waterfall layout issue by:

  1. Using scrollWidth instead of scrollHeight for horizontal scroll measurement (Line 172)
  2. Adding 'important' priority to style property assignments (Lines 173, 179) to ensure styles apply correctly

These changes align with the vertical layout implementation and fix the lower-threshold-item-count event triggering issue mentioned in the changeset.

packages/web-platform/web-elements/src/XList/x-list.css (2)

63-64: LGTM! CSS containment properly implements estimated-main-axis-size-px support.

The CSS containment properties enable list items to size themselves based on the estimated-main-axis-size-px attribute:

  • contain: size applies size containment
  • contain-intrinsic-size: auto var(--estimated-main-axis-size-px) uses the estimated size (mapped from the attribute via ListItemAttributes) before actual measurement

This allows list items to render without requiring explicit width/height, as described in the changeset.


271-271: LGTM! Correct positioning for horizontal waterfall observer.

Unsetting bottom positioning ensures the horizontal waterfall lower-threshold observer is positioned correctly using right: -999px (Line 272) instead of conflicting with bottom-based positioning from the vertical layout.

packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css (1)

1-22: LGTM!

The CSS provides appropriate styling for the horizontal waterfall test page with dynamic item coloring. The implementation is consistent with the vertical waterfall variant and supports the test scenario properly.

packages/web-platform/web-elements/src/XList/ListItem.ts (1)

8-13: LGTM! Clean integration of ListItemAttributes.

The decorator dependency update correctly wires the new ListItemAttributes class into the ListItem component, enabling reactive handling for the estimated-main-axis-size-px attribute. The pattern follows the existing structure with CommonEventsAndMethods.

packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1)

1-56: LGTM! Test structure is consistent.

The test file correctly exercises the estimated-main-axis-size-px attribute with autoScroll and scrolltolower event handling. The structure is consistent with similar test files in the codebase.

packages/web-platform/web-tests/tests/react.spec.ts (1)

4525-4600: Verify the wait time variance across test scenarios.

The new tests use different wait times: 3000ms for the basic scenario and 5000ms for waterfall/horizontal variants. While this may be intentional to account for different layout calculation times, consider:

  1. Are these wait times empirically determined or estimates?
  2. Could a helper function or constant define these timeouts to make the distinction explicit?

The tests are well-structured and follow existing patterns. If the wait times are based on actual rendering/scrolling behavior, they're acceptable.

packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (1)

1-57: LGTM! Horizontal orientation test is correctly configured.

The test properly exercises horizontal scrolling with scroll-orientation='horizontal' and is consistent with the vertical variant.

packages/web-platform/web-elements/src/XList/XList.ts (3)

112-114: LGTM! Proper autoScroll initialization.

The initial kick-off logic correctly establishes the first timestamp before beginning actual scroll calculations, preventing incorrect deltaTime on the first frame.


128-143: LGTM! Orientation-aware scrolling correctly implemented.

The auto-stop logic properly handles both vertical and horizontal orientations, with correct scrollability checks and end-position clamping for each axis.


180-192: Verify the setTimeout approach for render timing.

The setTimeout(..., 0) on line 189 addresses cases where the scroll container hasn't fully rendered, but this could introduce subtle timing issues:

  1. If autoScroll is called multiple times in quick succession, multiple timeouts could be scheduled
  2. The scrollability check might still pass even if rendering isn't complete

Consider:

  • Adding a flag to prevent multiple concurrent autoScroll initializations
  • Or documenting that callers should wait for initial render completion

The orientation-aware logic itself is correct and aligns with the runtime path.

packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1)

15-34: LGTM! Clean reactive attribute implementation.

The ListItemAttributes class correctly implements the reactive attribute pattern:

  • Uses @registerAttributeHandler decorator appropriately
  • Maps estimated-main-axis-size-px to CSS variable --estimated-main-axis-size-px
  • Properly converts the value to pixel format with parseFloat

The CSS variable approach provides flexibility for downstream styling and layout calculations.

@codecov
Copy link

codecov bot commented Nov 3, 2025

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!

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 3, 2025

CodSpeed Performance Report

Merging #1911 will degrade performances by 7.35%

Comparing Sherry-hue:feat/list-esti-autoScroll (a7b684e) with main (0d7a4c3)

Summary

❌ 1 regression
✅ 61 untouched
⏩ 3 skipped1

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

Benchmarks breakdown

Benchmark BASE HEAD Change
transform 1000 view elements 41.5 ms 44.8 ms -7.35%

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

relativeci bot commented Nov 3, 2025

React Example

#6083 Bundle Size — 237.45KiB (0%).

a7b684e(current) vs 0d7a4c3 main#6078(baseline)

Bundle metrics  no changes
                 Current
#6083
     Baseline
#6078
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 0% 38.63%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 165 165
No change  Duplicate Modules 67 67
No change  Duplicate Code 46.77% 46.77%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6083
     Baseline
#6078
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.69KiB 91.69KiB

Bundle analysis reportBranch Sherry-hue:feat/list-esti-autoSc...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link

relativeci bot commented Nov 3, 2025

Web Explorer

#6079 Bundle Size — 366.66KiB (+0.39%).

a7b684e(current) vs 0d7a4c3 main#6074(baseline)

Bundle metrics  Change 5 changes Regression 2 regressions
                 Current
#6079
     Baseline
#6074
Regression  Initial JS 146.19KiB(+0.92%) 144.85KiB
Regression  Initial CSS 32.22KiB(+0.27%) 32.13KiB
Change  Cache Invalidation 48.46% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 220(+0.46%) 219
No change  Duplicate Modules 16 16
Change  Duplicate Code 3.21%(-0.62%) 3.23%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#6079
     Baseline
#6074
Regression  JS 240.64KiB (+0.56%) 239.3KiB
No change  Other 93.8KiB 93.8KiB
Regression  CSS 32.22KiB (+0.27%) 32.13KiB

Bundle analysis reportBranch Sherry-hue:feat/list-esti-autoSc...Project dashboard


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue force-pushed the feat/list-esti-autoScroll branch from b3503c1 to 37b597f Compare November 3, 2025 08:16
Copy link
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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1)

26-56: Test implementation looks correct.

The list structure with estimated-main-axis-size-px={100} consistently applied to all list-items correctly tests the new feature. The vertical single-type list configuration is appropriate for this test case.

Note: Similar test files exist for waterfall and horizontal variants with nearly identical structure. While acceptable for test files, consider extracting a shared test component factory if more variants are added in the future to reduce maintenance overhead.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3503c1 and 37b597f.

📒 Files selected for processing (16)
  • .changeset/rude-windows-attack.md (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItem.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/XList.ts (3 hunks)
  • packages/web-platform/web-elements/src/XList/XListWaterfall.ts (2 hunks)
  • packages/web-platform/web-elements/src/XList/x-list.css (2 hunks)
  • packages/web-platform/web-elements/src/all.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react.spec.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-elements/src/XList/x-list.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css
  • packages/web-platform/web-elements/src/all.ts
  • packages/web-platform/web-tests/tests/react.spec.ts
  • packages/web-platform/web-elements/src/XList/XList.ts
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

For contributions, generate and commit a Changeset describing your changes

Files:

  • .changeset/rude-windows-attack.md
🧠 Learnings (9)
📓 Common learnings
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.
📚 Learning: 2025-09-18T08:12:56.802Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.

Applied to files:

  • packages/web-platform/web-elements/src/XList/XListWaterfall.ts
  • .changeset/rude-windows-attack.md
📚 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/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
📚 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/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
📚 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/rspeedy/create-rspeedy/template-react-vitest-rltl-js/vitest.config.js` is a template file for scaffolding new Rspeedy projects, not a test configuration that should be included in the main vitest projects array.

Applied to files:

  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
📚 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/rude-windows-attack.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, 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/rude-windows-attack.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/rude-windows-attack.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • .changeset/rude-windows-attack.md
🧬 Code graph analysis (3)
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (2)
packages/web-platform/web-elements-reactive/src/index.ts (1)
  • bindToStyle (8-8)
packages/web-platform/web-elements/src/XText/XTextTruncation.ts (1)
  • parseFloat (302-317)
packages/web-platform/web-elements/src/XList/ListItem.ts (2)
packages/web-platform/web-elements/src/common/CommonEventsAndMethods.ts (1)
  • CommonEventsAndMethods (10-62)
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1)
  • ListItemAttributes (15-34)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (3)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (2)
  • ref (16-16)
  • handleScrollToLower (18-20)
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (2)
  • ref (16-16)
  • handleScrollToLower (18-20)
packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (2)
  • ref (8-8)
  • handleScrollToLower (10-12)
🪛 LanguageTool
.changeset/rude-windows-attack.md

[style] ~7-~7: Consider using a different verb for a more formal wording.
Context: ...list-item are no longer required. 2. Fixed an issue where the list `lower-threshol...

(FIX_RESOLVE)


[style] ~9-~9: Consider using a different verb for a more formal wording.
Context: ...al layout under a waterfall layout. 3. Fixed an issue where calling the list `autoSc...

(FIX_RESOLVE)

🔇 Additional comments (4)
packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1)

7-12: LGTM! Standard test setup.

The ref and event handler setup follows the expected pattern for Playwright integration tests, where console output is typically captured and verified in the spec file.

.changeset/rude-windows-attack.md (1)

5-9: Release notes read clearly

The entry succinctly captures each user-facing change, so nothing further needed here.

packages/web-platform/web-elements/src/XList/ListItem.ts (1)

10-13: Correct dependency wiring for attribute handler

Hooking ListItemAttributes into the component ensures the new reactive attribute logic activates for every <list-item>. Looks good.

packages/web-platform/web-elements/src/XList/XListWaterfall.ts (1)

32-74: Centralized scrolltolower enablement looks solid

Toggling the enabling attribute and deferring the orientation-aware measurement fixes the horizontal waterfall gap while keeping the observer logic localized. Implementation checks out.

@Sherry-hue Sherry-hue force-pushed the feat/list-esti-autoScroll branch from 37b597f to c3302a0 Compare November 3, 2025 08:35
Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/web-platform/web-tests/tests/react.spec.ts (1)

4525-4600: Consider extracting a helper function to reduce duplication.

The four new test cases follow an identical pattern with only the test title and wait time varying. While the current implementation is correct and consistent with existing patterns in this file, extracting a helper function could improve maintainability.

Example refactor:

const testScrollToLower = async (
  page: Page,
  title: string,
  waitTime: number,
) => {
  let scrolltolower = false;
  await page.on('console', async (msg) => {
    const event = await msg.args()[0]?.evaluate((e) => ({
      type: e.type,
    }));
    if (!event) return;
    if (event.type === 'scrolltolower') {
      scrolltolower = true;
    }
  });

  await goto(page, title);
  await wait(waitTime);
  expect(scrolltolower).toBeTruthy();
};

test('basic-element-list-estimated-main-axis-size-px', async ({ page }, { title }) => {
  await testScrollToLower(page, title, 3000);
});
packages/web-platform/web-elements/src/XList/XList.ts (1)

128-142: Clarify variable naming for readability.

The variable name isContainerScrollable (lines 131-134) is misleading—it's actually checking whether scrolling has reached the end, not whether the container is scrollable. Consider renaming to hasReachedEnd or isAtScrollEnd for clarity.

Apply this diff:

-    const isContainerScrollable = isScrollVertical
+    const hasReachedEnd = isScrollVertical
       ? scrollContainer.scrollTop + scrollContainer.clientHeight
         >= scrollContainer.scrollHeight
       : scrollContainer.scrollLeft + scrollContainer.clientWidth
         >= scrollContainer.scrollWidth;
-    if (isContainerScrollable && this.#autoScrollOptions.autoStop) {
+    if (hasReachedEnd && this.#autoScrollOptions.autoStop) {
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 37b597f and c3302a0.

📒 Files selected for processing (16)
  • .changeset/rude-windows-attack.md (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItem.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1 hunks)
  • packages/web-platform/web-elements/src/XList/XList.ts (3 hunks)
  • packages/web-platform/web-elements/src/XList/XListWaterfall.ts (2 hunks)
  • packages/web-platform/web-elements/src/XList/x-list.css (2 hunks)
  • packages/web-platform/web-elements/src/all.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react.spec.ts (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css (1 hunks)
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-elements/src/XList/x-list.css
  • packages/web-platform/web-elements/src/all.ts
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px/index.css
  • packages/web-platform/web-elements/src/XList/ListItemAttributes.ts
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px/index.css
  • packages/web-platform/web-tests/tests/react/basic-element-list-estimated-main-axis-size-px-waterfall/index.jsx
  • packages/web-platform/web-tests/tests/react/basic-element-list-horizontal-estimated-main-axis-size-px-waterfall/index.jsx
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

For contributions, generate and commit a Changeset describing your changes

Files:

  • .changeset/rude-windows-attack.md
🧠 Learnings (7)
📚 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/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-08-13T09:23:36.222Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1502
File: packages/react/testing-library/types/entry.d.ts:97-97
Timestamp: 2025-08-13T09:23:36.222Z
Learning: React Testing Library's rerender function accepts React.ReactNode (including strings, numbers, null, etc.), not just React.ReactElement. The typing should match RTL's behavior by using React.ReactNode for maximum compatibility.

Applied to files:

  • packages/web-platform/web-tests/tests/react.spec.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, 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/rude-windows-attack.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, 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/rude-windows-attack.md
📚 Learning: 2025-09-18T08:12:56.802Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.

Applied to files:

  • .changeset/rude-windows-attack.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/rude-windows-attack.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • .changeset/rude-windows-attack.md
🧬 Code graph analysis (2)
packages/web-platform/web-elements/src/XList/ListItem.ts (2)
packages/web-platform/web-elements/src/common/CommonEventsAndMethods.ts (1)
  • CommonEventsAndMethods (10-62)
packages/web-platform/web-elements/src/XList/ListItemAttributes.ts (1)
  • ListItemAttributes (15-34)
packages/web-platform/web-elements/src/XList/XList.ts (1)
packages/web-platform/web-elements/src/XViewpagerNg/XViewpagerNgEvents.ts (1)
  • scrollContainer (93-124)
🪛 LanguageTool
.changeset/rude-windows-attack.md

[style] ~7-~7: Consider using a different verb for a more formal wording.
Context: ...list-item are no longer required. 2. Fixed an issue where the list `lower-threshol...

(FIX_RESOLVE)


[style] ~9-~9: Consider using a different verb for a more formal wording.
Context: ...al layout under a waterfall layout. 3. Fixed an issue where calling the list `autoSc...

(FIX_RESOLVE)


[style] ~11-~11: Consider using a different verb for a more formal wording.
Context: ...od in useEffect might not scroll. 4. Fixed an issue where the scrolltolower even...

(FIX_RESOLVE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: build / Build (Ubuntu)
  • GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (6)
.changeset/rude-windows-attack.md (1)

1-11: LGTM!

The changeset clearly describes the new feature and bug fixes for end-users. The format follows the repository's conventions for meaningful user-facing changes.

packages/web-platform/web-elements/src/XList/ListItem.ts (1)

8-13: LGTM!

The integration of ListItemAttributes into the component dependency array is clean and follows the existing pattern. This properly wires up the new estimated-main-axis-size-px attribute support.

packages/web-platform/web-elements/src/XList/XListWaterfall.ts (1)

32-75: LGTM! Event-driven approach improves timing.

The new #handleXEnableHeaderOffsetEvent consolidates lower-threshold observer style updates behind an enable/disable signal, replacing the previous initialization-time logic. The 100ms delay appropriately handles cases where list-items don't have specified heights and need time to calculate scrollable values.

The orientation-aware positioning (vertical: top/bottom, horizontal: left/right) correctly handles both layout modes, and the Firefox-specific 'unset' workaround addresses known browser-specific IntersectionObserver issues.

packages/web-platform/web-elements/src/XList/XList.ts (3)

110-114: Verify setTimeout removal is intentional.

The setTimeout wrapper was removed from this continuation path (line 112), but the comment on line 189 in the autoScroll method explains that setTimeout is necessary "During the initial render, there might be instances in raq where scrollContainer hasn't fully expanded (rendering hasn't succeeded yet)."

This creates an inconsistency: the initial call uses setTimeout(() => requestAnimationFrame(...), 0) (line 189), but subsequent calls use direct requestAnimationFrame(...) (line 112). Please confirm this is intentional. If the render timing issue only affects the first frame, this is correct; otherwise, the setTimeout might be needed for all frames.


123-124: Good optimization to prevent lag.

Changing scroll behavior from 'smooth' to 'auto' is appropriate for programmatic auto-scrolling to avoid performance issues with continuous smooth animations.


180-192: LGTM! Orientation-aware initialization improves reliability.

The initialization logic correctly determines scroll orientation, checks scrollability along the active axis, and uses setTimeout to delay the first autoScroll when the container is scrollable (accommodating render completion). This addresses the timing issue mentioned in the comment.

@Sherry-hue Sherry-hue merged commit c282f54 into lynx-family:main Nov 3, 2025
49 of 50 checks passed
colinaaa pushed a commit that referenced this pull request Nov 9, 2025
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/[email protected]

### Patch Changes

- During hydration, replace update with insert + remove for same-type
`<list-item />` with different `item-key` so the Lynx Engine detects
changes. ([#1598](#1598))

    ```html
    Hydrate List B into List A: List A:
    <list>
      <list-item item-key="a">hello</list-item>
      <list-item item-key="a">world</list-item>
    </list>

    List B:
    <list>
      <list-item item-key="a1">hello</list-item>
      <list-item item-key="a2">world</list-item>
    </list>
    ```

Previously this case was hydrated as an update; it is now emitted as
insert + remove to ensure SDK detection.

- Bump `swc_core` v47.
([#1916](#1916))

- Pass sourcemap generated by rspack to swc transformer.
([#1910](#1910))

- When engineVersion is greater than or equal to 3.1, use
`__SetAttribute` to set text attribute for text node instead of creating
a raw text node.
([#1880](#1880))

- Add profile for list `update-list-info`.
([#1480](#1480))

- Support testing React Compiler in testing library. Enable React
Compiler by setting the `experimental_enableReactCompiler` option of
`createVitestConfig` to `true`.
([#1269](#1269))

    ```js
    import { defineConfig, mergeConfig } from "vitest/config";
import { createVitestConfig } from
"@lynx-js/react/testing-library/vitest-config";

    const defaultConfig = await createVitestConfig({
      runtimePkgName: "@lynx-js/react",
      experimental_enableReactCompiler: true,
    });

    export default mergeConfig(defaultConfig, config);
    ```

## @lynx-js/[email protected]

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: print out the output chunk urls
([#1921](#1921))

## @lynx-js/[email protected]

### Patch Changes

- When engineVersion is greater than or equal to 3.1, use
`__SetAttribute` to set text attribute for text node instead of creating
a raw text node.
([#1880](#1880))

- Add `react-compiler-runtime` to `resolve.dedupe`.
([#1269](#1269))

With this change you can setup [React
Compiler](https://react.dev/learn/react-compiler) for ReactLynx by
`pluginBabel`:

    ```js
    import { defineConfig } from "@lynx-js/rspeedy";
    import { pluginBabel } from "@rsbuild/plugin-babel";

    export default defineConfig({
      plugins: [
        pluginBabel({
          include: /\.(?:jsx|tsx)$/,
          babelLoaderOptions(opts) {
            opts.plugins?.unshift([
              "babel-plugin-react-compiler",
// See https://react.dev/reference/react-compiler/configuration for
config
              {
                // ReactLynx only supports target to version 17
                target: "17",
              },
            ]);
          },
        }),
      ],
    });
    ```

- Updated dependencies
\[[`e7d186a`](e7d186a),
[`0d7a4c3`](0d7a4c3)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- feat: add \_\_GetSourceMapRelease API for nativeApp.
([#1923](#1923))

-   Updated dependencies \[]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Updated dependencies
\[[`fece7d0`](fece7d0),
[`e1db63f`](e1db63f),
[`ebc1a60`](ebc1a60)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: define x-foldview-slot-drag-ng typo.
([#1915](#1915))

- feat: 1. Added support for the list `estimated-main-axis-size-px`
property; the width and height of `list-item` are no longer required.
([#1911](#1911))

2. Fixed an issue where the list `lower-threshold-item-count` event
would not trigger when using a horizontal layout under a waterfall
layout.

3. Fixed an issue where calling the list `autoScroll` method in
`useEffect` might not scroll.

4. Fixed an issue where the `scrolltolower` event might not be triggered
in waterfall, because the lower styles was not updated in
`registerEventEnableStatusChangeHandler`.

-   Updated dependencies \[]:
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: define x-foldview-slot-drag-ng typo.
([#1915](#1915))

## @lynx-js/[email protected]

### Patch Changes

- feat: update @lynx-js/web-elements to 0.8.10
([#1914](#1914))

## @lynx-js/[email protected]

### Patch Changes

- fix: The `e.detail` in the `bindtap` callback needs to correctly
include `x` and `y`.
([#1913](#1913))

- Updated dependencies
\[[`ebc1a60`](ebc1a60)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- fix: `this` may be undefined in Card().
([#1922](#1922))

- feat: add \_\_GetSourceMapRelease API for nativeApp.
([#1923](#1923))

- Updated dependencies
\[[`fece7d0`](fece7d0),
[`ebc1a60`](ebc1a60)]:
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]
    -   @lynx-js/[email protected]

## @lynx-js/[email protected]

### Patch Changes

- Pass sourcemap generated by rspack to swc transformer.
([#1910](#1910))

- When engineVersion is greater than or equal to 3.1, use
`__SetAttribute` to set text attribute for text node instead of creating
a raw text node.
([#1880](#1880))

## [email protected]



## @lynx-js/[email protected]



## [email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]



## @lynx-js/[email protected]

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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants