Skip to content

fix row pinning after ungrouping - #6493

Merged
KevinVandy merged 1 commit into
betafrom
agent/fix-row-pinning-after-ungrouping
Aug 2, 2026
Merged

fix row pinning after ungrouping#6493
KevinVandy merged 1 commit into
betafrom
agent/fix-row-pinning-after-ungrouping

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Aug 2, 2026

Copy link
Copy Markdown
Member

What changed

Resolve pinned rows directly from the pre-pagination and core row-model maps instead of calling the throwing table.getRow(id, true) API. Add a regression test covering grouping, pinning a synthetic group row, ungrouping, and regrouping.

Fixes #5822.

Why

Ungrouping removes synthetic group rows from the active row models while their IDs may remain in row-pinning state. getTopRows() and getBottomRows() treated those temporarily absent IDs as exceptional and crashed. The previous proposed fix in #5823 used try/catch for this expected lookup miss.

An absent synthetic row is now omitted without exception-driven control flow. The pinned ID remains in state, so the correct grouped row is restored if the same grouping is applied again.

Validation

  • pnpm --filter @tanstack/table-core test:lib --run tests/implementation/features/row-pinning/rowPinningFeature.test.ts
  • pnpm exec eslint packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts packages/table-core/tests/implementation/features/row-pinning/rowPinningFeature.test.ts
  • pnpm --filter @tanstack/table-core test:types
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes
    • Improved pinned-row retention when pagination or grouping changes.
    • Preserved pinning state safely when grouped rows are temporarily ungrouped and later restored.
    • Ensured pinned rows appear only when their parent rows are expanded.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cc9342a0-803b-4656-ab48-de87cd53db0f

📥 Commits

Reviewing files that changed from the base of the PR and between 9700f9b and 5404e05.

📒 Files selected for processing (2)
  • packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts
  • packages/table-core/tests/implementation/features/row-pinning/rowPinningFeature.test.ts

📝 Walkthrough

Walkthrough

The row-pinning lookup now uses pre-pagination and core row models. Grouped row-pinning tests verify safe grouping removal, temporary omission, preserved pin state, and restoration.

Changes

Grouped row pinning

Layer / File(s) Summary
Resolve pinned rows from row models
packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts
Pinned rows are resolved from the pre-pagination row model, with a core row-model fallback, before the expanded-parent check.
Cover grouping changes during pinning
packages/table-core/tests/implementation/features/row-pinning/rowPinningFeature.test.ts
The test setup enables grouping and verifies that a pinned grouped row is omitted when ungrouped, retains its pin state, and reappears when grouping returns.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the fix for row pinning after ungrouping.
Linked Issues check ✅ Passed The changes prevent errors for pinned synthetic group rows after ungrouping and preserve their pinning state for regrouping.
Out of Scope Changes check ✅ Passed The implementation and regression test directly support the linked issue and stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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-row-pinning-after-ungrouping

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 Aug 2, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 5404e05

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

☁️ Nx Cloud last updated this comment at 2026-08-02 13:00:19 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2026

Copy link
Copy Markdown
More templates

@tanstack/alpine-table

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

@tanstack/angular-table

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

@tanstack/angular-table-devtools

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

@tanstack/ember-table

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

@tanstack/lit-table

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

@tanstack/match-sorter-utils

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

@tanstack/octane-table

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

@tanstack/preact-table

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

@tanstack/preact-table-devtools

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

@tanstack/react-table

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

@tanstack/react-table-devtools

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

@tanstack/solid-table

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

@tanstack/solid-table-devtools

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

@tanstack/svelte-table

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

@tanstack/table-core

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

@tanstack/table-devtools

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

@tanstack/vue-table

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

@tanstack/vue-table-devtools

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

commit: 5404e05

@KevinVandy
KevinVandy merged commit 03142ed into beta Aug 2, 2026
9 checks passed
@KevinVandy
KevinVandy deleted the agent/fix-row-pinning-after-ungrouping branch August 2, 2026 13:00
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.

Pinning aggregation rows then ungrouping causes a hard error

1 participant