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

Support WebManifest shortcuts when generating the TWA #46

Merged
merged 3 commits into from
Dec 11, 2019
Merged

Support WebManifest shortcuts when generating the TWA #46

merged 3 commits into from
Dec 11, 2019

Conversation

rayankans
Copy link
Contributor

No description provided.

Copy link
Collaborator

@PEConn PEConn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the UX here? We're prompting to ask if the developer wants to include shortcuts and then what?

What if the developer selects yes and there are no shortcuts in the web manifest? Do we let them specify some?

src/cli/cmds/init.js Outdated Show resolved Hide resolved
@rayankans
Copy link
Contributor Author

What's the UX here? We're prompting to ask if the developer wants to include shortcuts and then what?

I had an offline conversation with @andreban about this. Currently, we just ask whether users want to include shortcuts or not. They can't set it themselves. If we do end up going down that path, we will need to explore some UI possibilities, as it's not that easy to set them up via a CLI. It's easier to pass a file manifest if you want to customize shortcuts in a way that differs from the published Web Manifest.

If they select yes and there are no shortcuts, nothing happens.

@andreban
Copy link
Member

andreban commented Dec 5, 2019

Yes, filling a shortcuts section from the prompt might make things complicated (maybe we could make it optional later).

It's possible to add an ask attribute to the configuration and add a function that will only trigger the question if a shortcuts section exists in the Manifest. https://github.com/flatiron/prompt/blob/master/examples/dynamic-ask-prompt.js#L14-L17

I wonder if we should show developers the content of the existing shortcuts before asking them to confirm.

@rayankans
Copy link
Contributor Author

Makes sense, I added the ask condition, and the shortcut is now displayed. So if there are no shortcuts, no prompt shows up. Here's what it looks like if there are in fact shortcuts in the manifest
shortcuts

@rayankans rayankans requested a review from PEConn December 9, 2019 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants