Skip to content

[codex] add raw list sticky sections#46

Draft
zombieJ wants to merge 11 commits into
masterfrom
codex/raw-list-sticky-sections
Draft

[codex] add raw list sticky sections#46
zombieJ wants to merge 11 commits into
masterfrom
codex/raw-list-sticky-sections

Conversation

@zombieJ
Copy link
Copy Markdown
Member

@zombieJ zombieJ commented May 18, 2026

Summary

  • add a RawList path for virtual={false} that renders grouped content as section blocks
  • keep virtual rendering on @rc-component/virtual-list, with shared list props for both paths
  • let native sticky group headers be constrained by their group section so the next group can push the previous header away
  • keep the sticky virtual header lookup optimized with binary search

Checks

  • npm run lint
  • npm test -- --runInBand
  • npm run compile

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf07f541-3b8d-4cd3-9c2e-9c81ab6bbae3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/raw-list-sticky-sections

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 May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.38%. Comparing base (cc4923b) to head (7e5e65b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   98.94%   99.38%   +0.43%     
==========================================
  Files           5        7       +2     
  Lines          95      162      +67     
  Branches       23       44      +21     
==========================================
+ Hits           94      161      +67     
  Misses          1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a non-virtualized list implementation through the new RawList component, which is used when the virtual prop is set to false. It also optimizes the sticky header logic by replacing a linear search with a binary search for finding the active header index. Review feedback suggests preventing runtime warnings by ensuring refs are not attached to React.Fragment and improving performance by using the mapping function within Array.from when rendering grouped data.

Comment thread src/RawList.tsx Outdated
registerElement(key, rowIndex, element);
};

if (React.isValidElement(node)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Attaching a ref to a React.Fragment will result in a runtime warning and the ref will not be attached, which would break the scrollTo functionality for that item. It is safer to check if the element is a Fragment before attempting to clone it with a ref.

Suggested change
if (React.isValidElement(node)) {
if (React.isValidElement(node) && node.type !== React.Fragment) {

Comment thread src/RawList.tsx Outdated
let rowIndex = 0;
const rawContent = group
? Array.from(groupData).map(([groupKey, groupItems]) => {
const headerRow = { type: 'header', groupKey } as Row<T, K>;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When converting a Map to an array for rendering, you can use the second argument of Array.from as a mapping function. This is slightly more efficient than calling .map() on the intermediate array created by Array.from(groupData).

    ? Array.from(groupData, ([groupKey, groupItems]) => {

Comment thread src/RawList.tsx Outdated
})}
</section>
);
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This closing parenthesis needs to be adjusted if the Array.from mapping function optimization is applied.

      )

@zombieJ zombieJ force-pushed the codex/raw-list-sticky-sections branch from a49095e to c69d6cc Compare May 18, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant