You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
docs(virtual-core): document indexAttribute and test shared-cell measuring - #1387
Documents the indexAttribute option in docs/api/virtualizer.md (default, where it is read, the warning when it is missing, and the grid case where a row and a column virtualizer measure the same cell through distinct attributes). Adds core tests for that shared-cell case and for the default/missing-attribute behavior.
I have tested this code locally with pnpm run test:pr.
🚀 Release Impact
This change affects published code, and I have generated a changeset.
This change is docs/CI/dev-only (no release).
Summary by CodeRabbit
Documentation
Documented how to configure a custom DOM attribute for associating measured elements with item indexes, including when an element is measured by multiple virtualizers.
Clarified that missing attributes cause measurement to be skipped and a warning to be issued.
Tests
Added coverage for independent measurements with separate attributes and for the default attribute behavior.
…uring
The indexAttribute option is part of VirtualizerOptions but was only
described in the Marko docs. Add an entry to the API reference covering its
default, where the attribute is read (measureElement and the resize
observer), the warning logged when it is missing, and the grid use case where
a row and a column virtualizer measure the same cell through distinct
attributes.
Add core tests: a row virtualizer and a column virtualizer measure one cell
carrying data-row-index and data-column-index and each updates only its own
index, and the default attribute / missing-attribute warning behavior.
ClosesTanStack#1386
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: dccc6b76-997d-4f9c-9eb5-0a65c1ee1b3e
Commits
Reviewing files that changed from the base of the PR and between bc18ffc and 45ab9af.
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
No actionable comments were generated in the recent review.
Walkthrough
The Virtualizer options documentation now describes indexAttribute, its default, and its use during measurement. Tests cover separate attributes for row and column virtualizers, the default attribute, and the missing-attribute warning.
Changes: indexAttribute documentation and measurement coverage
Layer / File(s)
Summary
Document and test indexAttribute behavior docs/api/virtualizer.md, packages/virtual-core/tests/measurement.test.ts
The documentation describes the option, its default, and its role in measurement. Tests verify that row and column virtualizers can measure a shared element through separate attributes, and that a missing configured attribute returns -1 and emits a warning.
This change documents the indexAttribute option and adds tests for it. It does not alter library behavior, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title uses the conventional docs(scope) prefix and names the two real parts of the changeset: documentation of indexAttribute and a test for shared-cell measuring. The docs file and the measuremen…
Description check
The description follows the template. It has the Changes section explaining the docs and tests, the Checklist with both items checked, and the Release Impact section with the docs/CI/dev-only option c…
Linked Issues check
Issue #1386 has two coding requirements: (1) document indexAttribute on the core options page, and (2) add a core test in packages/virtual-core/tests for a custom attribute and for shared-element …
Out of Scope Changes check
The PR changes only docs/api/virtualizer.md and packages/virtual-core/tests/measurement.test.ts, according to the PR summary. The PR summary reports no changes to exported declarations. Both chang…
Full details: Title check
Explanation
The title uses the conventional docs(scope) prefix and names the two real parts of the changeset: documentation of indexAttribute and a test for shared-cell measuring. The docs file and the measurement tests both match. It is slightly long but specific and accurate, so it passes.
Full details: Description check
Explanation
The description follows the template. It has the Changes section explaining the docs and tests, the Checklist with both items checked, and the Release Impact section with the docs/CI/dev-only option checked. It also links the issue (Closes #1386). The description is complete. The changeset checkbox is unchecked, which matches the docs-only claim.
Full details: Linked Issues check
Explanation
Issue #1386 has two coding requirements: (1) document indexAttribute on the core options page, and (2) add a core test in packages/virtual-core/tests for a custom attribute and for shared-element measurement. The PR summary states that docs/api/virtualizer.md (+42 lines) documents the default 'data-index', the use by measureElement and the ResizeObserver, the missing-attribute warning, and the row/column grid example. The PR summary also states that packages/virtual-core/tests/measurement.test.ts (+81 lines) adds a shared-cell test with distinct row and column attributes and a default/missing-attribute test. At the reviewed head, the readable part of measurement.test.ts contains no indexAttribute test, and the file is truncated at 16000 bytes. The added tests were therefore not read directly. The docs file was not read. Verdict relies on the summary, which is consistent with the PR description and the issue.
Full details: Out of Scope Changes check
Explanation
The PR changes only docs/api/virtualizer.md and packages/virtual-core/tests/measurement.test.ts, according to the PR summary. The PR summary reports no changes to exported declarations. Both changed files match the scope of #1386, which requires docs and tests only. The PR description marks the change as docs/CI/dev-only with no release. No unrelated change is identified. The added test content beyond the readable portion was not directly verified.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: d7d3c1f5-a34f-4fad-8454-1a888a75ec8c
Commits
Reviewing files that changed from the base of the PR and between eb1cb7c and bc18ffc.
Files selected for processing: 2
docs/api/virtualizer.md
packages/virtual-core/tests/measurement.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
Documents the
indexAttributeoption indocs/api/virtualizer.md(default, where it is read, the warning when it is missing, and the grid case where a row and a column virtualizer measure the same cell through distinct attributes). Adds core tests for that shared-cell case and for the default/missing-attribute behavior.Closes #1386
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit