Skip to content

FEATURE: sharing link to PWA renders url in title in new Topic to leverage core link expansion #32631

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

merefield
Copy link
Contributor

@merefield merefield commented May 7, 2025

Discourse has a fantastic feature whereby when installed as PWA (on Android or Windows), you can share content to that Discourse from other apps and browsers.

Currently when sharing a link to a Discourse PWA, it pre-populates a draft Topic body with the link.

Whilst this is really nice already, we can improve this further. Currently, sharing a link to the body misses out on the auto-magic core feature of pasting a link in the title which simultaneously hydrates a title from the og tag and creates a one-box in the body.

This PR remedies this whilst carefully maintaining the current behaviour for text shares.

Documentation for the standard is here:

https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/How_to/Share_data_between_apps

Demo of this working change is implemented in this plugin:

https://github.com/merefield/discourse-share-to-link-oneboxer

I added a test to check presence of share target in manifest endpoint.

@merefield merefield marked this pull request as draft May 7, 2025 21:47
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/feature-request-link-to-title-not-body-when-sharing-to-discourse-via-android/365156/8

@merefield merefield changed the title FEATURE: sharing link to PWA rndrs title in new Topic to lvrge 1boxin… FEATURE: sharing link to PWA renders title in new Topic to leverage onebox May 7, 2025
@merefield merefield marked this pull request as ready for review May 7, 2025 22:14
@merefield merefield changed the title FEATURE: sharing link to PWA renders title in new Topic to leverage onebox FEATURE: sharing link to PWA renders url in title in new Topic to leverage onebox May 7, 2025
@merefield merefield changed the title FEATURE: sharing link to PWA renders url in title in new Topic to leverage onebox FEATURE: sharing link to PWA renders url in title in new Topic to leverage core link expansion May 7, 2025
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/daily-summary-5am-utc/291851/474

@pmusaraj pmusaraj requested a review from xfalcox May 14, 2025 15:27
@pmusaraj
Copy link
Contributor

Can you review this when you get a chance @xfalcox? Thanks!

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.

3 participants