Skip to content

docs(virtual-core): document indexAttribute and test shared-cell measuring - #1387

Open
officialasishkumar wants to merge 1 commit into
TanStack:mainfrom
officialasishkumar:docs/index-attribute
Open

officialasishkumar wants to merge 1 commit into
TanStack:mainfrom
officialasishkumar:docs/index-attribute

Conversation

@officialasishkumar

@officialasishkumar officialasishkumar commented Nov 20, 2026 •

Copy link
Copy Markdown

🎯 Changes

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.

Closes #1386

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • 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.

Closes TanStack#1386
@changeset-bot

changeset-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bc18ffc

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

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-20T00:05:02.866204Z
We couldn’t complete this review. Comment @codex review to try again.
bc18ffc PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: piecyk

Merge Risk: Minimal · up to bc18f

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed 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 Passed 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

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/virtual-core/tests/measurement.test.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/virtual-core/tests/measurement.test.ts

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

Recent review info

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: 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 branch has not been deployed

No deployments
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.

Document the indexAttribute option and cover it with a test

1 participant