Skip to content

feat: add PWA support share functionality#1060

Merged
fmartingr merged 11 commits intogo-shiori:masterfrom
pudymody:pwa
Feb 22, 2025
Merged

feat: add PWA support share functionality#1060
fmartingr merged 11 commits intogo-shiori:masterfrom
pudymody:pwa

Conversation

@pudymody
Copy link
Copy Markdown
Contributor

@pudymody pudymody commented Feb 15, 2025

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.

url maps to the url to save. description to the excerpt and name to the title.
For example: shiori.tld/?url=github.com&name=pudymody&description=pudymody+is+a+developer

Changed 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

@fmartingr fmartingr added this to the 1.7.5 milestone Feb 22, 2025
@fmartingr fmartingr self-requested a review February 22, 2025 09:24
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.64%. Comparing base (775f8e8) to head (dd9d5b6).
Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

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.

@fmartingr
Copy link
Copy Markdown
Member

Here are some icons in different sizes, in case you need any. PNG with transparecy.

shiori-logo-144
shiori-logo-152
shiori-logo-512
shiori-logo-1024
shiori-logo-white-144
shiori-logo-white-152
shiori-logo-white-512
shiori-logo-white-1024

@pudymody
Copy link
Copy Markdown
Contributor Author

I have one nit, could we use the same parameter names as the fields in the form? (title and excerpt) To prevent confusion.

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

@fmartingr
Copy link
Copy Markdown
Member

I have one nit, could we use the same parameter names as the fields in the form? (title and excerpt) To prevent confusion.

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!

@fmartingr fmartingr merged commit 07819b5 into go-shiori:master Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants