Skip to content
Source
Sign inSign up
TanStack/table

Add `getLeafHeaders()` method to skip group headers #6579

Opensarathkumarsasi(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/6579/headopened

🎯 Changes:

Fixes: #6573 collectLeafHeaders now excludes parent/group headers from results. table_getLeafHeaders returns only real leaf headers instead of placeholders

Summary by CodeRabbit

  • Bug Fixes

    • Corrected leaf-header retrieval to return only actual nested leaf headers.
    • Preserved left-to-right ordering while excluding group, parent, and placeholder headers.
  • Documentation

    • Clarified the behavior of leaf-header retrieval in the Header Objects guide.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Review Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 2ddbc731-b9f9-40dd-94f9-11bcf1a67651

      📥 Commits

      Reviewing files that changed from the base of the PR and between 3bfc1bf60b3f00218394b744939eda4699e9ca2b and cf84ef9bbeb11f9b5700f468933cf662c772e512.

      📒 Files selected for processing (3)
      • docs/guide/headers.md
      • packages/table-core/src/core/headers/coreHeadersFeature.utils.ts
      • packages/table-core/tests/unit/core/headers/coreHeadersFeature.utils.test.ts

      Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      The header utilities now return only real leaf headers in left-to-right order. Documentation describes the behavior, and unit tests cover nested, group, intermediate, and placeholder headers.

      Changes

      Leaf header collection

      Layer / File(s)Summary
      Leaf header behavior
      packages/table-core/src/core/headers/coreHeadersFeature.utils.ts, docs/guide/headers.md
      collectLeafHeaders now returns only leaf headers. The guide documents the leaf-only behavior and ordering.
      Leaf header validation
      packages/table-core/tests/unit/core/headers/coreHeadersFeature.utils.test.ts
      Tests exclude group, intermediate, and placeholder headers and verify the returned header identities.

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

      Merge Risk: ⚪ Minimal · up to cf84e

      This change makes leaf-header collection return only real leaf headers, with matching tests and documentation updates. No actionable merge-blocking risk remains beyond normal checks and review.

      Suggested reviewers: kevinvandy

      🚥 Pre-merge checks | ✅ 3 | ❌ 2

      ❌ Failed checks (2 warnings)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 …Write docstrings for the functions missing them to satisfy the coverage threshold.
      Description check⚠️ WarningThe description accurately summarizes the leaf-header behavior and references issue #6573, but it omits the required Checklist and Release Impact sections.Add the required Checklist section and mark each applicable item. Add the Release Impact section and select whether the change affects published code or is docs/CI/dev-only.
      ✅ Passed checks (3 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly identifies the main change: adding or exposing getLeafHeaders() behavior that skips group headers.
      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.

Sign in to join this conversation.