nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
622 stars 134 forks source link

Notes reference widget #1167

Open juliusknorr opened 11 months ago

juliusknorr commented 11 months ago

Would be nice to have an actual preview when pasting a note link:

Screenshot 2023-11-20 at 15 08 16
JuliaKirschenheuter commented 1 week ago

I've collected some examples regarding possible widgets:

  1. Image + text

Image

  1. Text

Image

  1. Image + text + user + last edit info

Image

  1. File preview + text

Image Image

  1. Gif + text

Image

  1. Edit mode of existing internal document

Image

JuliaKirschenheuter commented 1 week ago

Some examples which are not workable in other apps:

  1. Youtube (image) Image

  2. Code snippet form Github:

Image

  1. Any info from Github:

Image

jancborchardt commented 5 days ago

@JuliaKirschenheuter in the popover widget (not the directly embedded one) the title is always duplicated, can we get rid of that?

(If it is needed as a placeholder until the actual widget loads that could be done but then replaced with the widget.)

juliusknorr commented 5 days ago

As discussed via chat, the scope of this issue is to provide metadata for notes app links like https://nextcloud.local/apps/notes/note/12345 using the existing link preview API, so instead of the odd placeholder in the first post we'd show the note title somehow similar to linking a file maybe.

@jancborchardt Your comments seems a general text issue, maybe that can be filed separately (with a reference screenshot).

nimishavijay commented 4 days ago

Thanks for the great screenshots of references @JuliaKirschenheuter ! Very helpful!

I would suggest it be like in Collectives, so (3) looks great. The image can be the file thumbnail. The text can be the name of the note on the first line, in [name of category] on the second line (if it is categorized), and last edited on the third line.

With the standardization of the widgets the specifics of the size, width, etc can be smoothed out in the other issue :)

JuliaKirschenheuter commented 2 days ago

Seems that backend have to be implemented first. https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/reference.html#register-a-reference-provider (ReferenceProvider, PublicReferenceProvider) and https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/reference.html#using-the-default-widget for default widget (should be enough for current task).

JuliaKirschenheuter commented 2 days ago

Could this implementations serve as examples?: https://github.com/nextcloud/spreed/blob/main/lib/Collaboration/Reference/TalkReferenceProvider.php#L109 https://github.com/nextcloud/deck/blob/main/lib/Reference/BoardReferenceProvider.php https://github.com/nextcloud/richdocuments/blob/main/lib/Reference/OfficeTargetReferenceProvider.php