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

Icon purpose "any" is confusing #1094

Open
mkruisselbrink opened this issue Jul 19, 2023 · 4 comments · May be fixed by #1120
Open

Icon purpose "any" is confusing #1094

mkruisselbrink opened this issue Jul 19, 2023 · 4 comments · May be fixed by #1120

Comments

@mkruisselbrink
Copy link

From discussions on other bugs and elsewhere I learned that the "any" purpose does not in fact mean that "The user agent is free to display the icon in any context.", but rather that the icon can be used in any context for which no other purpose has been defined (i.e. icons without explicit purpose "maskable" should not be masked).

While the ship has sailed as far as naming goes, I do think it would be good to be very explicit about this in the explanation of what the "any" purpose actually means and how purpose of an icon ties into icon selection logic.

If for example the "most appropriate" icon was actually defined in an algorithm (related discussion in #925 (comment)) that would probably have avoided confusion here, as such an algorithm would presumably have included the purpose of icons, but if the spec doesn't want to define that, at least some non-normative text would be good I think.

@marcoscaceres
Copy link
Member

Yeah, we should consider if it does affect the parsing algorithm.

@marcoscaceres
Copy link
Member

Marking as a potential bug also... need to investigate actual usage and impact of any change we make here.

@aarongustafson
Copy link
Collaborator

@diekus Can you grab the usage stats from our last crawl? I don't have access anymore.

@mgiuca
Copy link
Collaborator

mgiuca commented Jul 24, 2023

This came out of a discussion Marijn and I were having on here (very long thread). I don't think Marijn was asking to change the name (and I don't think we should).

What we should do is clarify the wording of what it means. It wouldn't be a breaking change.

I think there are two separate issues here which we should tease apart:

  1. Does "any" mean the user agent can use it as if it were tagged with any of the other purposes, or something more specific?
  2. How does the user agent choose the "most appropriate" icon size?

On the first: I thought it was pretty clear from the way we have been doing things, but surprised to learn how ambiguous it is in the text itself, so I think we should clear it up. There are two possible reads here:

  • (Wrong) Purpose "any" can be used to mean it can be used as if it were tagged with any of the other prescribed purposes; i.e. purpose: "any" is equivalent to purpose: "any maskable monochrome". This might be the most obvious read (given the name), but it is emphatically not how we interpret it, nor should it be.
  • (Right) Purpose "any" means the icon can be used in all the "usual" places in the user agent and operating system where another more specialized purpose is not needed. You can use it as a regular icon on the shelf or anywhere you like, but cannot use it in places where the special rules for maskable or monochrome apply. (This is the correct interpretation and we should make it explicitly clear.)

This is complicated by the fact that a user agent can technically do whatever it wants with an icon, for example, put the icon inside a circle, apply shadows, etc. But there should be SHOULD NOT requirements around applying treatments to icons that are only tagged with purpose: "any":

  • User agents SHOULD NOT ignore the colour channel of a purpose: "any" icon and turn it into a silhouette, like you would a purpose: "monochrome" icon. We've tried this and it looks quite bad. You are explicitly required to do this for a monochrome icon, which a designer has provided for that purpose. But we shouldn't take a regular icon and treat it as a silhouette.
  • User agents SHOULD NOT crop any part of a purpose: "any" icon, e.g. inserting it into a masked shape like you would a purpose: "maskable" icon. An "any" icon has not been designed with any particular safe zone in mind, so designers expect every pixel of their icon to be displayed to the user.

So there is actually a valid use for a purpose: "any maskable" which is that it's an explicit statement that "you can use this icon in normal contexts, but also feel free to mask it according to the safe zone rules"; however purpose: "any" (the default) should not be considered maskable. Similarly, purpose: "any monochrome" would say "you can use the colour of this icon or just treat it as a silhouette", but without the explicit "monochrome" the UA shouldn't be able to ignore the colour.

On the second: I actually don't think it's that necessary for us to exactly specify what "most appropriate" means in terms of icon sizes. The user agent is presented with a bunch of icons of different sizes. It can be left as an implementation detail which to pick. (e.g. on some systems you might want to choose the one that's closest to the size you need but larger; on other systems you may be forced to pick exactly one icon to represent your app, so you pick the largest one and store it and the OS scales it; others may have a maximum icon size, so you have to pick the largest one smaller than that, etc.) We shouldn't be prescriptive about icon size selection.

@marcoscaceres marcoscaceres linked a pull request May 2, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants