Skip to content

docs: Clarify column visibility toggle labels - #6410

Merged
KevinVandy merged 1 commit into
TanStack:betafrom
ckdwns9121:agent/clarify-column-visibility-labels
Jul 12, 2026
Merged

docs: Clarify column visibility toggle labels#6410
KevinVandy merged 1 commit into
TanStack:betafrom
ckdwns9121:agent/clarify-column-visibility-labels

Conversation

@ckdwns9121

@ckdwns9121 ckdwns9121 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Updated the React column visibility guide to avoid rendering column.columnDef.header directly in a visibility toggle menu.
  • Added a stable label-map example for column visibility controls.
  • Added a note explaining that columnDef.header is a header render template and should be rendered with flexRender when rendering actual headers, while visibility menus should use stable text labels.

Why

column.columnDef.header can be a string or render template that needs header context. In a visibility menu we are rendering column objects, and hidden columns may not have an active header context. This caused confusion in #5751 when JSX/template headers were used as toggle labels.

Validation

  • pnpm prettier --write docs/framework/react/guide/column-visibility.md
  • pnpm test:docs

Related: #5751

Summary by CodeRabbit

  • Documentation
    • Updated the React column visibility guide to use stable, column ID-based labels in visibility toggle menus.
    • Added guidance explaining that column header templates require context and may not be suitable for toggle labels.
    • Recommended defining custom text labels for consistent visibility controls.

Column visibility menus render column objects, not active header objects, so rendering columnDef.header directly can fail or confuse users when headers are JSX/templates or when columns are hidden. The guide now shows a stable label map fallback and calls out flexRender as the correct path for real header rendering.

Related: TanStack#5751
Confidence: high
Scope-risk: narrow
Tested: pnpm prettier --write docs/framework/react/guide/column-visibility.md; pnpm test:docs
Not-tested: Full repository test suite
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The React column visibility guide now defines stable labels keyed by column ID, uses them in visibility toggle checkboxes, and explains why column.columnDef.header should not be used directly for toggle menu labels.

Changes

Column visibility documentation

Layer / File(s) Summary
Stable labels for visibility toggles
docs/framework/react/guide/column-visibility.md
The example adds an ID-keyed columnLabels map, uses it for checkbox text with an ID fallback, and documents the header render template constraint.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the docs update about using stable labels for column visibility toggles.
✨ 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.

@ckdwns9121
ckdwns9121 marked this pull request as ready for review July 12, 2026 15:22
@ckdwns9121 ckdwns9121 changed the title Clarify column visibility toggle labels docs: Clarify column visibility toggle labels Jul 12, 2026
@KevinVandy
KevinVandy merged commit 767e251 into TanStack:beta Jul 12, 2026
3 checks passed
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.

2 participants