Skip to content

DataGrid: HirearchyColumn refactored InitiallyExpandedFunc #9728

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Nephim
Copy link
Contributor

@Nephim Nephim commented Aug 28, 2024

InitiallyExpandedFunc was not working, this refactor should fix the issues.

Description

The InitiallyExpandedFunc that I previously introduced seems to have been borked by another feature. From what i can tell now only one Hirearchy column is created. I am unsure how this would work but from debugging my Func only gets called called once for the first item. Meaning you could only expand the first column.

This should resolve #9681 as I tested on a project with live updates and it worked mostly as expected. If new items are added to the component this function will not be called on those functions. If I remove the check the feature will break as expanding the row will cause a rerender meaning an infinite render loop.

If someone knows why the column and this Func only gets evaluated once and not once per row. This could lead to a better fix.

How Has This Been Tested?

Tested manually with complex real world project

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added bug Something does not work as intended/expected PR: needs review labels Aug 28, 2024
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (28bc599) to head (4a24bf1).
Report is 922 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9728      +/-   ##
==========================================
+ Coverage   89.82%   90.82%   +0.99%     
==========================================
  Files         412      406       -6     
  Lines       11878    12821     +943     
  Branches     2364     2484     +120     
==========================================
+ Hits        10670    11645     +975     
+ Misses        681      624      -57     
- Partials      527      552      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro
Copy link
Member

Hi. Thanks for the fix, but I'd like to see a bUnit test for this.

@Nephim
Copy link
Contributor Author

Nephim commented Sep 26, 2024

@ScarletKuro I got around to adding another test that should test the actual rendering and not just the underlying data. How does this look?
Something I've missed or something else I need to add?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected PR: needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MudDataGrid HierarchyColumn - InitiallyExpandedFunc not working when collection is changed
2 participants