[codex] add raw list sticky sections#46
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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.
| registerElement(key, rowIndex, element); | ||
| }; | ||
|
|
||
| if (React.isValidElement(node)) { |
There was a problem hiding this comment.
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.
| if (React.isValidElement(node)) { | |
| if (React.isValidElement(node) && node.type !== React.Fragment) { |
| let rowIndex = 0; | ||
| const rawContent = group | ||
| ? Array.from(groupData).map(([groupKey, groupItems]) => { | ||
| const headerRow = { type: 'header', groupKey } as Row<T, K>; |
There was a problem hiding this comment.
| })} | ||
| </section> | ||
| ); | ||
| }) |
a49095e to
c69d6cc
Compare
Summary
virtual={false}that renders grouped content as section blocks@rc-component/virtual-list, with shared list props for both pathsChecks
npm run lintnpm test -- --runInBandnpm run compile