Skip to content
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

feat(module: tree): Hide unmatched nodes in tree #3242

Merged

Conversation

rhodon-jargon
Copy link
Contributor

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

Adds parameter HideUnmatched to Tree, which (if true) will hide all nodes that are not matched to the SearchValue.
This is particularly useful if there are a lot of nodes, and nodes might have a lot of children (or there are a lot of root nodes), as you won't have to scroll down past all the unmatched nodes.

(Note: The chinese doc text is translated by a machine)

📝 Changelog

Add HideUnmatched parameter, which allows you to hide all TreeNodes that are not matched to the SearchValue.

Language Changelog
🇺🇸 English Add HideUnmatched parameter, which allows you to hide all TreeNodes that are not matched to the SearchValue
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

@github-actions
Copy link

github-actions bot commented Apr 25, 2023

@codecov
Copy link

codecov bot commented Apr 27, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.51 ⚠️

Comparison is base (7033ccb) 46.14% compared to head (8649dfc) 44.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3242      +/-   ##
==========================================
- Coverage   46.14%   44.64%   -1.51%     
==========================================
  Files         557      557              
  Lines       26640    26669      +29     
  Branches      266      266              
==========================================
- Hits        12294    11906     -388     
- Misses      14306    14723     +417     
  Partials       40       40              
Impacted Files Coverage Δ
components/tree/Tree.razor.cs 0.00% <0.00%> (ø)
components/tree/TreeNode.razor.cs 0.00% <0.00%> (ø)

... and 25 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@huangjia2107
Copy link
Contributor

duplicate of #3221

@rhodon-jargon
Copy link
Contributor Author

Ah yes, I hadn't seen that. Though my implementation might be a bit more efficient, since it updates the Hidden property for all nodes once in the SearchNodes method (instead of letting all nodes repeatedly search through all parents and children for matched nodes).

But that is up to @ElderJames. If you like the implementation of #3221 better, you can close this PR.

@ElderJames
Copy link
Member

Hello @rhodon-jargon @huangjia2107 , I think the parameter name HideUnmatched is more accurate and this implement is more efficient.

@huangjia2107
Copy link
Contributor

@ElderJames that's ok, I just need the feature ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants