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

Shortcut items with no icon URL are ignored #116

Closed
FluorescentHallucinogen opened this issue Feb 29, 2020 · 10 comments · Fixed by #122
Closed

Shortcut items with no icon URL are ignored #116

FluorescentHallucinogen opened this issue Feb 29, 2020 · 10 comments · Fixed by #122
Labels
bug Something isn't working

Comments

@FluorescentHallucinogen
Copy link
Contributor

Repro: llama-pack init --manifest https://shortcut-bugs.web.app/manifest.json.

Shortcut items with no icon URL are just ignored. llama-pack should provide some default icon in this case instead of ignoring them.

@andreban
Copy link
Member

Looking at this section of the template project, it seems this is by design.

The icon is somewhat required on Android, as if the developer doesn't set it in shortcuts.xml Android will generate a default icon, an Android head, that is not meaningful to the action.

It doesn't sound to me that llama-pack would be better to provide a default icon that would be able to convey any better meaning to the actions.

I do think we should alert developers of missing data in the shortcuts, so they know it's not being included and know how to fix it.

@rayankans will know more about the current design.

@FluorescentHallucinogen
Copy link
Contributor Author

if the developer doesn't set it in shortcuts.xml Android will generate a default icon, an Android head

Just checked, can't confirm the case of item with no icon, the situation with WebAPK is very sad. I've opened https://crbug.com/1057380.

@rayankans
Copy link
Contributor

Hi, I explained on the bug how the case with WebAPKs is related to caching and the fact that this hasn't been enabled on all channels.

As for llama-pack, as @andreban mentioned, this was a design decision. I could be convinced otherwise. Maybe a warning that it's being skipped is best for now? I believe that we we show developers a summary of the shortcuts included though when they are generating the TWA.

@andreban
Copy link
Member

andreban commented Mar 2, 2020

+1 to a warning of with what is being skipped and a summary of the shortcuts being included.

@FluorescentHallucinogen
Copy link
Contributor Author

The web app manifest spec doesn't require icon for shortcut items, it's optional (see https://w3c.github.io/manifest/#example-11).

If the developer declared 5 shortcut items (and 2 of them have no icons) in the web app manifest for PWA, then he expects to see these 5 shortcut items for TWA (and 2 of them should have default icon — android heads).

I.e. we should skip items only if

  • the property is required by spec (e.g. "url" or "name"), but for some reason is missing

or

  • the property is present, but invalid

Since #103 is not fixed yet, if "icons"/"src" is SVG file, it breaks the build. As an idea, we could temporarily skip shortcut items like this until SVG will be supported.

BTW, is the number of shortcut items limited? What if the developer declared e.g. 100 items?

@andreban
Copy link
Member

andreban commented Mar 2, 2020

The manifest spec doesn't require it, but an Icon is required on Android. When an icon is not included in shortcuts.xml, a default icon is included, but results in a bad user experience. We want to ensure applications using Trusted Web Activity are high quality Android Apps. Therefore, it makes sense being more strict than the manifest spec in this case.

@FluorescentHallucinogen
Copy link
Contributor Author

I believe we should align with WebAPK behavior.

@rayankans What if the icon for shortcut item is not provided in the manifest in case of WebAPK? Will it be android head icon or something else default icon? (Which exactly?) Or will this shortcut item be ignored?

And what if the icon has unsupported format (e.g. SVG)? Will this shortcut item be ignored or has default icon?

@andreban andreban added the bug Something isn't working label Mar 3, 2020
@rayankans
Copy link
Contributor

@FluorescentHallucinogen WebAPKs don't ignore any shortcuts. They currently use a fully transparent icon if nothing was provided.

I don't think llama-pack should match behaviour with WebAPKs. It already gives the option to modify manifest values, or provide a custom manifest, so it makes sense to have its own quality enforcements.

I think a warning should suffice. @andreban any thoughts on the matter?

@andreban
Copy link
Member

+1 to the warning.

@FluorescentHallucinogen
Copy link
Contributor Author

@rayankans

WebAPKs don't ignore any shortcuts. They currently use a fully transparent icon if nothing was provided.

For me WebAPK always shows transparent icon even if icon is provided and has supported format. PTAL at https://crbug.com/1057380. You closed this issue with "WontFix" status, but it's not fixed! :-/

shortcut-icons-bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants