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

Better categorisation #1938

Open
Donnnno opened this issue Jan 21, 2024 · 25 comments
Open

Better categorisation #1938

Donnnno opened this issue Jan 21, 2024 · 25 comments
Labels
enhancement New feature or request Help wanted need some help with this one!

Comments

@Donnnno
Copy link
Collaborator

Donnnno commented Jan 21, 2024

Basically have some more categories so that the user can search the app more quickly, like:

  • Google
  • Microsoft
  • Games
  • System
  • more? You name it

The challenge would be how to do it with the automatic sorting.

@Donnnno Donnnno added the enhancement New feature or request label Jan 21, 2024
@TotallyAvailable
Copy link
Contributor

TotallyAvailable commented Jan 21, 2024

Given that you probably already considered the one obvious way that's already in use and me currently not being available, I'm not going to suggest it as the best way to go.

While the additional step for every new contribution
"Please add one of the following categories [google_, microsoft_, games_, ...] in front of the drawable name ["category_iconname"] most likely to apply to the app. Do the same with [category_iconname.svg]" would be manageable, every added (useful) category obviously requires a LOT more manual work dealing with the existing Icons, eventually making the existing letter sorting somewhat weird looking as well.
Although 'google_' could obviously still be listed in 'G' to avoid forcing people to jump around if they prefer/are used to the current sorting, the entire [Games] section under [G] as well would probably be less ideal. Might not apply to every category of course and for the possibility to continue traditional sorting by skipping the new 'category_' tag ([Games] games_mindustry + [M] Mindustry) ? No idea.

Inspiration could obviously be taken from the sorting Izzy or F-Droid are using, including a somewhat automatic renaming of some of the existing entries.

I do like the idea though.

====

Anyone not aware of the current method

elif new.groups(0)[0].startswith('calendar_'):

Would allow for

  • startswith('google_'): -> drawable="google_chrome" 👀
  • startswith('microsoft_'): -> drawable="microsoft_authenticator"
  • startswith('games_'): -> drawable="games_mindustry"

Kinda the way I have been labeling Icons for other Icon Packs with '_icon' or mostly korean based apps with '_kr'. (mostly to avoid future conflicts)

Obviously leads to a bunch of potential issues and conflicts (depending on the categories chosen).

@Donnnno
Copy link
Collaborator Author

Donnnno commented Jan 23, 2024

I've added a Google and Microsoft line in the preparerelease script, so that should be covered now.

I don't think it's a good idea to add a game_ or system_ prefix for everything. We should probably add it by hand if we do something like that. But we have to find a way so that the automatic sorting / adding of icons doesn't mess with those categories.

@TotallyAvailable
Copy link
Contributor

One actually "obvious" and probably quite useful would be an "Alt" category which lists every '_alt_x' currently in the pack.

@Donnnno
Copy link
Collaborator Author

Donnnno commented Jul 7, 2024

I just had a thought. It still requires many manual edits, but worth a shot, maybe.

What if the preparereleasescript starts with all the normal stuff: new, calendar, emoji, brands etc. and after that searches through a different file, for example a game category.

In the game category file is a list that can be edited, so everyone can add additions to it.

_2048
_20_minutes_till_dawn
_2_player_games
_2248
afk_arena
alto
altos_odyssey
angry_birds
...

After the script has done that, it continues with the last part, ordering everything.
That way, the specific categories won't get overridden with each release.

@Kaiserdragon2
Copy link
Collaborator

That would be possible the good thing with this would be that the files don't need to be renamed

@Donnnno
Copy link
Collaborator Author

Donnnno commented Jul 7, 2024

Exactly, that was that I was thinking too :)

@Donnnno Donnnno added the Help wanted need some help with this one! label Jul 13, 2024
@Donnnno
Copy link
Collaborator Author

Donnnno commented Jul 13, 2024

I've added a simple XML file called games.xml to test with. However, I tried to understand how the preparereleasescript works, but just can't wrap my head around it. 🙃
So I decided to add the label help wanted, for anyone who likes to figure out how the better categorization system should work.
#1938 (comment)

https://github.com/Arcticons-Team/Arcticons/blob/main/scripts/games.xml

@Kaiserdragon2
Copy link
Collaborator

I will write up something just need a bit of time.
The games.xml already helps to test it.

@Kaiserdragon2
Copy link
Collaborator

image

@gewaleelek
Copy link
Contributor

Hi, I'm not sure if I should add this here, but the folder tab contains icons for the apps called "folder in folder" and "folder widget" which probably shouldn't be there.

Would renaming them so their names don't start with "folder_" work?

@Kaiserdragon2
Copy link
Collaborator

Yes renaming them would work.

@skedastically
Copy link
Contributor

skedastically commented Dec 16, 2024

I suggest using a different delimiter to separate categories from icon names. For example, the dot (.)

Icons can now be named like this

google.google_docs.svg
microsoft.microsoft_word.svg
microsoft.wordament.svg ## Wordament is a Microsoft app, but without the "Microsoft" prefix
calendar.calendar_proton_12.svg
games.genshin_impact.svg

The logic now is to check for the existence of the full stop in the filename. If there is one, anything before it will be a category.

Downside: introducing this parsing logic means fixing the app code and website to display/search for icon names only, which is not trivial. Also this new syntax might confuse the contributors


Edit: This might help with alternative icons too, for instance:

element.svg
element.alt-1.svg
google.google.svg
google.google.alt-1.svg

The generalized syntax will be of the following:

<category>.<name>.alt-<alt-number>.svg

(alt- was chosen instead of alt_ to avoid future conflict with any apps named Alt + something)

@Donnnno
Copy link
Collaborator Author

Donnnno commented Dec 16, 2024

. and - are not possible characters in Android

@Donnnno
Copy link
Collaborator Author

Donnnno commented Dec 16, 2024

Sorry, my answer was a bit brief.
From my understanding, the only legal separator character is a _. So we gotta stick to that.

But we can create more and specific categories in the same way as the game category.

@gewaleelek
Copy link
Contributor

I think we might want to add the "reserved prefix" like folder_ or microsoft_ somewhere in the contribution documentation too to prevent unrelated icons from appearing in those tabs because of the names.

@skedastically
Copy link
Contributor

skedastically commented Dec 16, 2024

From my understanding, the only legal separator character is a _. So we gotta stick to that.

Maybe a separator of something like a prefix + 3 underscores would work?

games____2048.svg --> category: games, name: 2048
(that's 4 underscores)

This adds extra complexity to the codebase though, but if validated properly I think it's a neat(er) convention.

Even more ideas
I also suggest renaming icons when moving them into "official" directories, and only limit the use of this convention inside `/newicons`. That way the only metadata source needed would be the generated XMLs and not a prefix heuristic:
/newicons/games____2048.svg --> /app/src/normal/res/drawable-nodpi/_2048.svg
/newicons/games____2048.svg --> /icons/white/_2048.svg
add _2048 to /generated/games.xml

But this falls short of just manually editing the XML files lol

@Donnnno
Copy link
Collaborator Author

Donnnno commented Dec 16, 2024

But it's not needed. We have a seperate file for the game category:
https://github.com/Arcticons-Team/Arcticons/blob/main/generated/games.xml
we could do just the same for different categories. The only thing is: we gotta find contributors who are willing to help with categorizing apps

@skedastically
Copy link
Contributor

skedastically commented Dec 16, 2024

Does this mean doing away with prefix-based categories altogether (except for the obvious ones like letters and numbers), and maintaining them in XMLs? If so I'd be fine categorizing new icons manually, and maybe some old icons too.

I'll await official contrib docs on this

@Kaiserdragon2
Copy link
Collaborator

I don't see the benefit of handling the categories in a file. I think it is much easier to name the icons with a prefix instead of opening a file and at a line there. Also there is much more room for errors if you edit a file that should be machine readable.
Also what is the drawback of the prefix as it is ?
If someone names something microsoft_ i think it would probably correct to include into the Microsoft category. The same is true for the rest of them and even if one icon should not be in such categories it just needs to be renamed.

@aloxe
Copy link
Contributor

aloxe commented Dec 17, 2024

What if an app fits in two categories? Say you have a Microsoft game for example.

@Kaiserdragon2
Copy link
Collaborator

What if an app fits in two categories? Say you have a Microsoft game for example.

that's a really good question with the prefix this isn't possible. But I also think it would introduce a strange behavior, because if an icon would be in two categories it would need to be twice inside the drawable.xml (don't know if this is possible to compile) also the icon count depends on the entries in the drawable.xml.

@Donnnno
Copy link
Collaborator Author

Donnnno commented Dec 17, 2024

it would need to be twice inside the drawable.xml

That's not a problem.

also the icon count depends on the entries in the drawable.xml

There's a setting inside Candybar to show a custom number

@skedastically
Copy link
Contributor

Also what is the drawback of the prefix as it is ?

My main problem with prefixes is that they can be confusing when displayed ("Games Plants Vs Zombies" rather than "Plants Vs Zombies").

That's not a problem.

There's a setting inside Candybar to show a custom number

If so, then I think category files is good to go

@Kaiserdragon2
Copy link
Collaborator

Candybar has also an option to rename apps. It could replace the prefix, but this costs performance.

My main problem with prefixes is that they can be confusing when displayed ("Games Plants Vs Zombies" rather than "Plants Vs Zombies").

With the games i the that it would be weird to have games before every entry. But the other Categories we have i think are good as they are.

If so, then I think category files is good to go

For the games you are good to go. The file is located at /generated/games.xml

@Donnnno
Copy link
Collaborator Author

Donnnno commented Dec 18, 2024

Check this out:
https://docs.arcticons.com/contribute/categorize-icons

(System apps aren't implemented yet, but will be in the future. The file is present already, so apps can be categorized)

@Donnnno Donnnno pinned this issue Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Help wanted need some help with this one!
Projects
None yet
Development

No branches or pull requests

6 participants