Richiesta di funzionalità: collegamento al titolo anziché al testo completo quando si condivide su discourse PWA

It would be really nice if links shared to the Title instead of (just) the Post body so that the Title was populated automatically just like it does if you do that within a site.

Is there any reason why the Post body is the target?

1 Mi Piace

Would you accept a PR here or is there a reason why it was done this way?

@Falco what PR introduced this feature (I had a look but couldn’t track it down)?

This been a loooooong time ago, but won’t this break when you aren’t sharing a link but a textual content?

At least you’d had to detect if the sharing text is a link and send it to the proper field.

1 Mi Piace

Yeah, that’s presumably more challenging because aren’t you just GETing a URL e.g. https://blah.com/new-topic? ...

But happy to take a look

1 Mi Piace

If most sites are sending just a URL nowadays I’d be happy with the change.

1 Mi Piace

I’ve found the code :detective: and I’ll take a look if we can handle both … but agree URL’s are probably sent 99% of the time, so worth considering …

1 Mi Piace

OK I’ve worked out how to support both:

  • text shares will go to body
  • titles go to title
  • link shares will go to title (and then render as a fully expanded title and in the body a nice onebox upon instantiation with all that comes with that including topic list previews)

Currently the update is in a working plugin:

I’ll submit this as a PR as really a no brainer.

Tested this on both Android and Windows (Edge) PWAs and seems to work great.

1 Mi Piace

PR is here:

Gentle reminder @Falco

2 Mi Piace

Merged, thanks for the PR!

2 Mi Piace

thanks for the review!

2 Mi Piace

Confirmed this is working on latest rebuild

Another reason to consider Android over iOS for your next phone :mobile_phone: if addicted to Discourse-land :sweat_smile:

I think we can mark this as Completed?

3 Mi Piace