Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sorting by size is incorrect when searching by string #4

Closed
patrickdevarney opened this issue Apr 5, 2021 · 7 comments
Closed

Sorting by size is incorrect when searching by string #4

patrickdevarney opened this issue Apr 5, 2021 · 7 comments

Comments

@patrickdevarney
Copy link

Repro:

  1. Open list of native objects
  2. Search with a string that returns many results
  3. Sort by size

Expected that the objects are correctly sorted by size.

Actual result is chunks of assets are sorted by size, then size appears to reset when a new group of assets is met.

@patrickdevarney
Copy link
Author

Initial guess is that this is related to AbstractTreeView.SortItemsRecursive seeming to sort groups of assets rather than the full tree, but I have yet to find the confirmed culprit.

@patrickdevarney
Copy link
Author

Capture

@pschraut
Copy link
Owner

pschraut commented Apr 6, 2021

Thank you for the bug-report. I'm able to reproduce the issue. I think you're spot-on with "sort groups of assets rather than the full tree". I hopefully find time to look into the issue at the weekend, but it's more likely that it's a weekend after that.

@patrickdevarney
Copy link
Author

Excellent! I gave it a shot myself but quickly ended up in an infinite recursive loop.

Also, thank you for creating and maintaining such an amazing tool! I use it nearly every week 👍

@jojo59516
Copy link
Contributor

For now, when searching something, the profiler just simply filter out items that don't match the pattern. In other words, searching cannot break groups, while sorting is in groups.
Note that the result even contains groups, and the items are "correctly" indented.

So, it is a "feature" (may not be designed by the author) rather than a bug :)

@pschraut
Copy link
Owner

This should be fixed in 3.9.0, which went just online. The changes to get this working can be found here.

I wasn't able to get sorting to work by using the TreeView.searchString API, so I implemented item filtering myself.

Filtering works by adding all items that pass the TreeView.DoesItemMatchSearch check to a single parent node, see here. I also fixed that the items are no longer indented when a search is active, see here.

Please let me know whether it works for you.

@patrickdevarney
Copy link
Author

Just tested and it works perfectly! Thank you for the update

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants