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

Configuration feature: Enables Apple home screen touch icon #1581

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stian-a-johansen
Copy link
Contributor

This additional setting allows chainlit to look better when used as a progressive web app on ios devices. Adds support for apple-touch-icons

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Dec 10, 2024
@dokterbob
Copy link
Collaborator

Thanks! I get how this is a great addition, but I don't think we want to implement it like this - there's plenty other platforms besides Apple and it means we have to add custom code for each.

For a starter, we'd need all of this:

<link rel="apple-touch-icon" sizes="76x76" href="img/touch-icon/apple-touch-icon-76.png" />
<link rel="apple-touch-icon" sizes="120x120" href="img/touch-icon/apple-touch-icon-120.png" />
<link rel="apple-touch-icon" sizes="152x152" href="img/touch-icon/apple-touch-icon-152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="img/touch-icon/apple-touch-icon-180.png" />
<link rel="shortcut icon" sizes="196x196" href="img/touch-icon/android-icon.png">
<meta name="msapplication-square70x70logo" content="img/touch-icon/smalltile.png" />
<meta name="msapplication-square150x150logo" content="img/touch-icon/mediumtile.png" />
<meta name="msapplication-wide310x150logo" content="img/touch-icon/widetile.png" />
<meta name="msapplication-square310x310logo" content="img/touch-icon/largetile.png" />

Source: https://stackoverflow.com/questions/42014745/mobile-touch-icon

A better approach would be to allow users to add arbitrary (static) headers to the HTML. This allows much more options, like OpenGraph support, custom analytics etc. and we will end up with less, not more code to maintain!

Prior efforts towards this and related issues exist. Happy to facilitate getting this implemented, if you are able and willing, please reach out to discuss implementation details and approach. #1164 #1091 #1196

I'll leave this open, for now, as a reference to other users who only need this.

@dokterbob dokterbob added the wontfix This will not be worked on label Dec 11, 2024
@stian-a-johansen
Copy link
Contributor Author

Thanks for the feedback! A workaround is to add custom JS to inject the value, that works too.

On the types - don't think it's strictly necessary to specify all the resolutions, I think only devices from 2006 would care about the <180px sizes ("non retina iphones"), and even if they did they downsample it pretty well. The SO post from 2017 was probably a bit more relevant to add all these! Happy to have a look at the other issues. Meanwhile we just inject it with JS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files. wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants