Skip to content

fix: clarify share flow in UI #3252

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

Merged
merged 3 commits into from
Apr 18, 2025
Merged

fix: clarify share flow in UI #3252

merged 3 commits into from
Apr 18, 2025

Conversation

atalii
Copy link
Contributor

@atalii atalii commented Mar 29, 2025

Prior to this commit, to share an entry, a user has to click on the share link and then copy the URL they are redirected to. The danger is that they may right-click and copy the share link without actually clicking on it, and therefore share a link that, when authenticated, shares the entry, rather than actually sharing the entry.

Here, we avoid this misinterpretation by making sharing into a POST request and using a form rather than a link.


This would have clarified some of the confusion in #3251. Please let me know if there's anything to change/improve with this; thanks!


Have you followed these guidelines?

Prior to this commit, to share an entry, a user has to click on the
share link and then copy the URL they are redirected to. The danger is
that they may right-click and copy the share link without actually
clicking on it, and therefore share a link that, when authenticated,
shares the entry, rather than actually sharing the entry.

Here, we avoid this misinterpretation by making sharing into a POST
request and using a form rather than a link.
Copy link
Member

@fguillot fguillot left a comment

Choose a reason for hiding this comment

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

This change is breaking the Web Share feature that was initially implemented in PR #1992. Is it possible to make it compatible?

2023-07-29_23-45-17 (1)

<input type="hidden" name="csrf" value="{{ .csrf }}">
<button type="submit" class="page-button">
{{ icon "share" }}<span class="icon-label">{{ t "entry.share.label" }}</span>
</button>
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: The indentation is inconsistent with the rest of the code.

@atalii
Copy link
Contributor Author

atalii commented Mar 30, 2025

It certainly looks like it should be possible to work with that; I'll look into it tomorrow. Thanks for letting me know (and thanks for catching the indentation, too)!

@atalii
Copy link
Contributor Author

atalii commented Mar 31, 2025

What exactly broke with the web share functionality? It looks like that's only meant to work after the share link has been created anyway, and, having just tested that, it seems okay. What's meant to work that isn't yet?

By the way, it looks to me like checkShareAPI needed to be await the result of navigator.share to catch the expression (though apparently the linter has issues with my fix, sorry!).

Thanks again for the helpful feedback, hopefully none of this is too strange :)

Navigator.share returns a promise that's executed in the background, but
unless we await it explicitly, we won't get the exceptions in the
try/catch block.
@fguillot fguillot merged commit e02b65d into miniflux:main Apr 18, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants