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

Displayed count of items per category is wrong for "Program and Libraries" if "Android Apps" has items #2232

Closed
wladimirleite opened this issue May 29, 2024 · 4 comments
Assignees
Labels

Comments

@wladimirleite
Copy link
Member

Just a minor detail that I noticed in the "Program and Libraries" category (maybe there are other cases).

If there are two categories A and B, A is B's parent, and both have items, then the item count displayed for A is wrong.
I think that originally parent categories do not have any items assigned to them.
So we may:

  1. Change the current configuration files and maybe put a constraint to avoid this situation (items assigned to categories that have child subcategories).
  2. Change the code used to count, so items in the parent category are also added to the total (which is a trivial change).

The second option seems better, unless I am missing some detail, as it may be desired in some cases to have items assigned to parent categories, so I am submitting a simple fix.

image

@lfcnassif
Copy link
Member

Hi @wladimirleite!

Originally, parent categories shouldn't have items. When I implemented the category hierarchy, I thought about it and thought it would be more intuitive for users to always put items in leaf categories. Otherwise, it wouldn't be possible to display just items in the parent category simply selecting a node in the category tree.

Not sure when the "Android Apps" subcategory was created without creating a complementary "Other Apps" subcategory... Maybe we should go with option 1, not sure... Could you point an example when items in non leaf categories would be better?

@wladimirleite
Copy link
Member Author

wladimirleite commented May 29, 2024

Not sure when the "Android Apps" subcategory was created without creating a complementary "Other Apps" subcategory...

That was added by @patrickdalla while reviewing the APK parser (commit 7527882), which I thought that made sense.

Could you point an example when items in non leaf categories would be better?

This was pretty much the case I had in mind, as the category "Program and Libraries" already mixes a lot of different types, it seems a bit odd to me have everything else under "Other Apps".

Maybe we should go with option 1, not sure...

Sure! We can simply remove "Android Apps" sub-category. I will close the PR I just submitted.

@wladimirleite wladimirleite removed their assignment May 29, 2024
@wladimirleite wladimirleite changed the title Displayed count of items per category is wrong if a parent category contains items Displayed count of items per category is wrong for "Program and Libraries" if "Android Apps" has items May 29, 2024
@lfcnassif
Copy link
Member

This was pretty much the case I had in mind, as the category "Program and Libraries" already mixes a lot of different types, it seems a bit odd to me have everything else under "Other Apps".

I agree.

lfcnassif added a commit that referenced this issue Jun 18, 2024
Count items in parent categories and add to children's totals (#2232)
@lfcnassif
Copy link
Member

Fixed by #2233

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

No branches or pull requests

2 participants