Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(table-core): fix API to calculate max expanded row depth#6120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ugjjffu wants to merge5 commits intoTanStack:main
base:main
Choose a base branch
Loading
fromugjjffu:fix/row-expanding-bug

Conversation

@ugjjffu
Copy link

@ugjjffuugjjffu commentedOct 24, 2025
edited by coderabbitaibot
Loading

🎯 Changes

I fixed a logic bug in the toggleExpanded function that led to an incorrect calculation of tableDepth. The original logic only deleted the expanded row's ID, but it failed to recursively delete the IDs of its hidden child rows. I fixed this bug by implementing a recursive deletion mechanism to ensure all dependent child rows are correctly removed from the expanded state.

✅ Checklist

  • [ ✅️] I have followed the steps in theContributing guide.
  • [ ✅️] I have tested this code locally withpnpm test:pr.

🚀 Release Impact

  • [ ✅️] This change affects published code, and I have generated achangeset.
  • [❌️ ] This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved row collapsing behavior. When you collapse an expanded row, the row and all its nested descendant rows are now properly removed from the expanded state while preserving other rows' states.
  • Breaking Changes

    • Major version update includes a fix to how the maximum depth of expanded rows is calculated.

@changeset-bot
Copy link

changeset-botbot commentedOct 24, 2025
edited
Loading

🦋 Changeset detected

Latest commit:5c43c9c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
NameType
@tanstack/table-coreMajor
@tanstack/angular-tablePatch
@tanstack/lit-tablePatch
@tanstack/qwik-tablePatch
@tanstack/react-tablePatch
@tanstack/solid-tablePatch
@tanstack/svelte-tablePatch
@tanstack/vue-tablePatch
@tanstack/react-table-devtoolsPatch

Not sure what this means?Click here to learn what changesets are.

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

@coderabbitai
Copy link

coderabbitaibot commentedOct 24, 2025
edited
Loading

Walkthrough

The row expansion feature now removes collapsed rows and their entire descendant hierarchy from the expanded state, rather than just removing the single row entry. This ensures complete cleanup of nested expanded rows when a parent row is collapsed.

Changes

Cohort / File(s)Summary
Row Expansion Logic
packages/table-core/src/features/RowExpanding.ts
Modified collapse behavior to filter out all keys starting with the current row's id, removing the row and all its descendants from expanded state instead of single-key removal
Changeset Entry
.changeset/every-grapes-judge.md
Added changeset documenting major version bump for @tanstack/table-core with API fix for calculating maximum depth of expanded rows

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Down the tree of rows so wide,
Collapse the branch, its children hide,
No orphans left to expand in vain,
Clean state reigns, descendants wane! 🐰✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.You can run@coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Title Check✅ PassedThe PR title "feat(table-core): fix API to calculate max expanded row depth" is directly related to the main change in the pull request. The changeset and code modifications address a bug in the toggleExpanded function where collapsing a row now correctly removes the expanded state for that row and all its descendants by filtering keys that start with the row's id, rather than just removing a single entry. This fix ensures the tableDepth calculation becomes accurate, which is exactly what the title references. The title is concise, specific enough for scanning history, and accurately captures the intent of the fix.
Description Check✅ PassedThe PR description follows the required template structure with all three sections present and appropriately filled. The 🎯 Changes section clearly explains the bug in toggleExpanded and describes the recursive deletion fix implemented to resolve the tableDepth calculation issue. The ✅ Checklist section confirms both contributing guide compliance and local testing were completed. The 🚀 Release Impact section indicates the change affects published code and a changeset was generated. All required information is provided with sufficient detail.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between207f890 and5c43c9c.

📒 Files selected for processing (1)
  • .changeset/every-grapes-judge.md (1 hunks)
🔇 Additional comments (1)
.changeset/every-grapes-judge.md (1)

1-5:Verify the changeset description and version bump level.

The description "fix API to calculate max expanded row depth" could be more specific. Based on the PR context, the actual fix involves recursively removing descendant row IDs from the expanded state when collapsing a parent row (previously only the parent was removed).

Additionally, the "major" version bump should be verified as appropriate for this change. While this fixes a logic bug with a behavioral impact, confirm whether this is truly a breaking API change that warrants a major version.


Thanks for usingCodeRabbit! 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 and usage tips.

Copy link

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between02c203a and88ea0e8.

📒 Files selected for processing (2)
  • examples/react/basic/src/data.ts (1 hunks)
  • packages/table-core/src/features/RowExpanding.ts (1 hunks)
🔇 Additional comments (1)
examples/react/basic/src/data.ts (1)

1-44:LGTM! Well-structured example data.

The hierarchical data structure with multi-level nesting effectively demonstrates the row expansion functionality. The inline comment on line 6 and line 27 helpfully highlight the nesting capability.

ugjjffuand others added4 commitsOctober 24, 2025 23:03
agreeCo-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@ugjjffu

[8]ページ先頭

©2009-2025 Movatter.jp