Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

Implement rich link preview inside posts #79

Closed
RiccardoM opened this issue Jul 17, 2020 · 2 comments · Fixed by #97
Closed

Implement rich link preview inside posts #79

RiccardoM opened this issue Jul 17, 2020 · 2 comments · Fixed by #97
Assignees
Labels
kind/new-feature New feature or request type/ui issues related to the UI of the app
Milestone

Comments

@RiccardoM
Copy link
Contributor

RiccardoM commented Jul 17, 2020

Feature description

Currently when the user creates a post containing one or more link(s), the link appear as a simple clickable text.
update: https://www.youtube.com/watch?v=sZQ4Ddtz2A4&feature=youtu.be another reference
photo5803408760553714271

I think that in order to give the users a better experience, we should implement links previews.

Implementation proposal

Navigating across pub.dev, I've found that it might be a good library to use to implement this: rich_link_preview.

The way we could handle this is by getting any URL present inside the message body and using that to generate the link preview.

Also, the following conditions should apply:

  • if the message has more than one link, take the last one;
  • if the message has one or more images, do not display the link preview;
  • if the message has a poll, do not display the link preview.
@RiccardoM RiccardoM added the type/ui issues related to the UI of the app label Jul 17, 2020
@ryuash ryuash self-assigned this Jul 22, 2020
@ryuash
Copy link
Contributor

ryuash commented Jul 22, 2020

@RiccardoM There is a version incompatibility

Because graphql >=4.0.0-alpha.0 depends on http ^0.12.1 and graphql <1.0.0 requires SDK version >=1.19.0 <2.0.0, graphql <1.0.0-∞ or >=4.0.0-alpha.0 requires http ^0.12.1.

And because graphql >=1.0.0 <3.0.0-beta.3 depends on http ^0.12.0+2 and graphql >=3.0.0-beta.3 <4.0.0-alpha.0 depends on http ^0.12.0+4, every version of graphql requires http ^0.12.0+2.

Because open_graph_parser >=0.0.2 <0.0.6 requires SDK version >=2.0.0 <2.2.0 and open_graph_parser >=0.0.6 depends on http >=0.11.3+17 <=0.12.0, open_graph_parser >=0.0.2 requires http >=0.11.3+17 <=0.12.0.

Thus, graphql is incompatible with open_graph_parser >=0.0.2.

And because every version of rich_link_preview depends on open_graph_parser ^0.0.4, graphql is incompatible with rich_link_preview.

So, because mooncake depends on both graphql any and rich_link_preview any, version solving failed.
pub get failed (1; So, because mooncake depends on both graphql any and rich_link_preview any, version solving failed.)
exit code 1

@RiccardoM RiccardoM added this to the 0.4.2 milestone Jul 22, 2020
@RiccardoM RiccardoM added the kind/new-feature New feature or request label Jul 22, 2020
@RiccardoM
Copy link
Contributor Author

RiccardoM commented Jul 22, 2020

@ryuash Looks like the library is outdated. What about we fork it and maybe update it/extend it?
https://github.com/wingkwong/rich_link_preview

Another option could be to implement it ourselves from scratch but I would say that's a lot of work. Maybe getting that code into the app and customizing it might be better, leaving an open issue about later extracting it as an external library in the future

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/new-feature New feature or request type/ui issues related to the UI of the app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants