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

[Bug] Empty categories are displayed #8

Closed
Elscrux opened this issue Jun 29, 2023 · 2 comments
Closed

[Bug] Empty categories are displayed #8

Elscrux opened this issue Jun 29, 2023 · 2 comments

Comments

@Elscrux
Copy link

Elscrux commented Jun 29, 2023

Categories that have no members to display, for example when they are hidden by VisibilityPropertyCondition are still displayed in the categories list at the top. When there are lots of categories which not might be visible based on conditions it gets very messy.

Here, "Category A" shouldn't be displayed until one element of the category is displayed.

[ConditionTarget]
public bool Enable { get; set; }

[Category("Category A")]
[VisibilityPropertyCondition(nameof(Enable), true)]
public bool Test { get; set; }
@bodong1987
Copy link
Owner

I personally think this behavior is reasonable, if the category is removed when the dynamic visibility changes, when the property is visible again, the previous category filter information is lost. Moreover, the quick filter tags are analyzed at one time when the object is first set, and will not be refreshed halfway, so you may encounter a situation where there is no editable attribute under a category.

@bodong1987 bodong1987 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
@Elscrux
Copy link
Author

Elscrux commented Jul 3, 2023

If I understood you correctly the points you make are mainly about limitations in the implementation, you're not disregarding the behavior I propose directly, right?
Without knowing specifics about the implementation, I think the first point you raise that the information about the filter is lost when a filtered category is toggled off and on again could be solved by detaching the displayed categories from the actual categories in data where the filter information would persist, no matter if you hide the category from the view or not.
Your second point that the categories aren't refreshed of course might need some more work on it which I can't expect to be implemented just for this request.
I may look into getting this feature implemented by myself in the future, would you be interested in a PR down the line?

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

No branches or pull requests

2 participants