table
table copied to clipboard
fix: retain columnFiltersMeta when leaf row filtering
Summary by CodeRabbit
- Bug Fixes
- Ensures column filter metadata is correctly propagated to leaf rows during leaf-based filtering, resolving inconsistent results and missing/incorrect filter states in grouped or nested tables. Users should now see consistent filter behavior and indicators across all hierarchy levels.
- Tests
- No changes to public APIs.
Walkthrough
Propagates columnFiltersMeta to newly created leaf rows in filterRowModelFromLeafs, aligning it with columnFilters during leaf-based filtering. No public API or control-flow changes.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
Filtering metadata propagationpackages/table-core/src/utils/filterRowsUtils.ts |
When creating leaf rows in filterRowModelFromLeafs, now copies columnFiltersMeta from the source row alongside columnFilters to ensure metadata is preserved. |
Sequence Diagram(s)
sequenceDiagram
autonumber
actor User
participant Table as Table Core
participant Filter as filterRowModelFromLeafs
participant Leaf as New Leaf Row(s)
User->>Table: Trigger filtering
Table->>Filter: Build row model from leafs
rect rgb(240,248,255)
note right of Filter: For each matched row
Filter->>Leaf: Create new leaf row
Filter->>Leaf: Copy columnFilters
Filter->>Leaf: Copy columnFiltersMeta (new)
end
Filter-->>Table: Return filtered leaf row model
Table-->>User: Render filtered rows
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
Poem
A hop, a skip, a meta-tag in tow,
I carry filters where the leaf rows go.
Tiny bytes align, like trails in snow—
No APIs stirred, just tidy flow.
Thump-thump! says the reviewer’s heart:
“One small copy, a well-placed art.” 🐇✨
✨ Finishing Touches
- [ ] 📝 Generate Docstrings
🧪 Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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.
Comment @coderabbitai help to get the list of available commands and usage tips.