Skip to content

fix(table-core): toggle group column visibility - #6442

Merged
KevinVandy merged 2 commits into
betafrom
agent/fix-5497-group-visibility
Aug 3, 2026
Merged

fix(table-core): toggle group column visibility#6442
KevinVandy merged 2 commits into
betafrom
agent/fix-5497-group-visibility

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • apply group-column visibility changes to descendant leaf column IDs
  • preserve visibility for descendant columns that disable hiding
  • cover explicit and inferred group visibility toggles with regression tests

Why

Group columns already derive getIsVisible() from their children, but toggleVisibility() wrote the group ID into columnVisibility. Since visibility state is evaluated at the leaf level, that entry had no effect and the group remained visible. This keeps the existing leaf-based state model and makes the two group APIs consistent.

Validation

  • pnpm nx run @tanstack/table-core:test:lib (52 files, 1006 tests)
  • pnpm nx run @tanstack/table-core:test:types
  • pnpm nx run @tanstack/table-core:test:eslint
  • Prettier check for changed files

Closes #5497

Summary by CodeRabbit

  • Bug Fixes

    • Improved grouped-column visibility toggling so hideable child columns are updated consistently.
    • Non-hideable child columns now retain their existing visibility.
    • Visibility changes no longer leave misleading state associated with the parent group column.
  • Tests

    • Added coverage for grouped-column visibility behavior, including mixed hideable and non-hideable columns.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Grouped-column visibility toggles now update each hideable leaf column instead of storing visibility under the group ID. Tests cover explicit hiding, inferred toggling, and non-hideable leaves.

Changes

Column visibility

Layer / File(s) Summary
Propagate group visibility to leaf columns
packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts, packages/table-core/tests/unit/features/column-visibility/columnVisibilityFeature.utils.test.ts
column_toggleVisibility applies one target visibility to every hideable leaf column. Non-hideable leaves remain unchanged, and group IDs are omitted from the visibility state. Tests cover explicit and inferred visibility changes.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address group visibility toggling by updating hideable descendant leaf columns and add regression tests for the reported behavior [#5497].
Out of Scope Changes check ✅ Passed The changes are limited to grouped column visibility logic and related regression tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the fix for toggling visibility on grouped columns.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-5497-group-visibility

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.

@nx-cloud

nx-cloud Bot commented Jul 18, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5fd708a

Command Status Duration Result
nx affected --targets=test:eslint,test:sherif,t... ✅ Succeeded 8m 45s View ↗
nx run-many --targets=build --exclude=examples/** ✅ Succeeded 1m View ↗

☁️ Nx Cloud last updated this comment at 2026-08-03 04:11:13 UTC

@pkg-pr-new

pkg-pr-new Bot commented Jul 18, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/alpine-table@6442

@tanstack/angular-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table@6442

@tanstack/angular-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/angular-table-devtools@6442

@tanstack/ember-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/ember-table@6442

@tanstack/lit-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/lit-table@6442

@tanstack/match-sorter-utils

npm i https://pkg.pr.new/TanStack/table/@tanstack/match-sorter-utils@6442

@tanstack/octane-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/octane-table@6442

@tanstack/preact-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table@6442

@tanstack/preact-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/preact-table-devtools@6442

@tanstack/react-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table@6442

@tanstack/react-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/react-table-devtools@6442

@tanstack/solid-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table@6442

@tanstack/solid-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/solid-table-devtools@6442

@tanstack/svelte-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/svelte-table@6442

@tanstack/table-core

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-core@6442

@tanstack/table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/table-devtools@6442

@tanstack/vue-table

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table@6442

@tanstack/vue-table-devtools

npm i https://pkg.pr.new/TanStack/table/@tanstack/vue-table-devtools@6442

commit: 5fd708a

@KevinVandy
KevinVandy marked this pull request as ready for review August 3, 2026 04:01
@KevinVandy
KevinVandy merged commit 164ef45 into beta Aug 3, 2026
9 checks passed
@KevinVandy
KevinVandy deleted the agent/fix-5497-group-visibility branch August 3, 2026 04:14
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.

Column visibility APIs do not work with column groups

1 participant