Skip to content

chore: add source section comments#47

Draft
zombieJ wants to merge 9 commits into
masterfrom
codex/add-src-section-comments
Draft

chore: add source section comments#47
zombieJ wants to merge 9 commits into
masterfrom
codex/add-src-section-comments

Conversation

@zombieJ
Copy link
Copy Markdown
Member

@zombieJ zombieJ commented May 25, 2026

Summary

  • Add section comments across src following the existing List.tsx separator style, including extra notes for virtual sticky header rendering and scroll handling.
  • Simplify List.tsx by sharing the forwarded ref through sharedListProps, returning the selected list directly, and using the shorter virtual ? VirtualList : RawList branch.
  • Move useFlattenRows into src/VirtualList because it is only used by the virtual list implementation.
  • Refactor raw sticky item scrolling to measure the group header height on demand during scrollTo({ key, align: 'top' }), write it to an item CSS variable, and remove the eager ResizeObserver bookkeeping.

Impact

This keeps the public API unchanged while making the source easier to scan and reducing RawList's sticky scroll bookkeeping.

Validation

  • ut run lint
  • ut run test -- --runInBand

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 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: 3a4d538e-59b7-4864-84ee-d04a67b49871

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/add-src-section-comments

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 25, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.51%. Comparing base (bb0a4c9) to head (c92a5be).

Files with missing lines Patch % Lines
src/RawList/useRawListScroll.ts 94.73% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##            master      #47      +/-   ##
===========================================
- Coverage   100.00%   99.51%   -0.49%     
===========================================
  Files            8        8              
  Lines          201      207       +6     
  Branches        55       62       +7     
===========================================
+ Hits           201      206       +5     
- Misses           0        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 standardized section headers across multiple files to improve code organization by categorizing elements like Types, Props, and Render logic. The review feedback suggests that these headers may be redundant in small re-export files, such as index.ts, where they add visual noise. Additionally, it was noted that using these headers to mark internal logic steps within hooks like useFlattenRows.ts is inconsistent with the top-level categorization used elsewhere in the project.

Comment thread src/index.ts
Comment on lines +3 to 7
// ============================== Types ===============================
export type { ListyRef, ListyProps } from './List';

// ============================== Export ==============================
export default Listy;
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

Adding section comments to a very small re-export file like index.ts introduces unnecessary visual noise. These headers are more effective in larger files with distinct logical sections (as seen in List.tsx).

Suggested change
// ============================== Types ===============================
export type { ListyRef, ListyProps } from './List';
// ============================== Export ==============================
export default Listy;
export type { ListyRef, ListyProps } from './List';
export default Listy;

@@ -22,10 +23,12 @@ export default function useFlattenRows<T, K extends React.Key = React.Key>(
group?: Group<T, K>,
): FlattenRowsResult<T, K> {
return React.useMemo(() => {
// ============================== Init ================================
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

The section headers here are used to mark internal logic steps within a useMemo block, which differs from the granularity established in List.tsx (where headers delineate top-level component sections). For consistency with the referenced style, consider removing these internal labels or using standard comments if clarification is needed.

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