feat: add PWA support share functionality#1060
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1060 +/- ##
=======================================
Coverage 34.64% 34.64%
=======================================
Files 61 61
Lines 5499 5499
=======================================
Hits 1905 1905
Misses 3359 3359
Partials 235 235 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Hey @pudymody, this looks awesome! I have tested it in my iOS emulator and it works well (except for the share target that is not supported in iOS :( ).
I have one nit, could we use the same parameter names as the fields in the form? (title and excerpt) To prevent confusion.
|
Here are some icons in different sizes, in case you need any. PNG with transparecy. shiori-logo-144 |
Nice catch. I also added the 192x192 icon variant as its the minimum recommendable. https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Guides/Making_PWAs_installable#required_manifest_members |
awesome, thank you for making the changes so quick! I've fixed the lint errors, hope you don't mind. Thank you for your contribution! |
This is based on #919. As i said in my comment it adds the share functionality.
It only allows to install it as a native app and other apps to share to it. Offline functionality could be explored in the future.
In the home page, it checks if the query param "url" or "description" are present, and if thats the case, it automatically opens the add modal dialog with the data prefilled. From there, you can always edit it before saving.
This also allows not only the native share functionality, but to trigger this from anywhere else as you only need to construct the correct url.
urlmaps to the url to save.descriptionto the excerpt andnameto the title.For example:
shiori.tld/?url=github.com&name=pudymody&description=pudymody+is+a+developerChanged the display mode from "fullscreen" to "standalone" as fullscreen hides native controls needed for basic functionality. Fullscreen is targeted more towards things like games and not apps. https://developer.mozilla.org/en-US/docs/Web/Manifest/Reference/display
Removed the 512 size icon as it didnt exists and i couldnt find some bigger version to downscale and generate it.
Used relative urls for start_url and share_target to allow subfolder installations to work without needing to define the manifest file as some templated file https://developer.mozilla.org/en-US/docs/Web/Manifest/Reference/start_url
Closes #919