Skip to content
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

Extend markdown support for LBRY urls #2521

Merged
merged 27 commits into from
Jun 26, 2019
Merged

Extend markdown support for LBRY urls #2521

merged 27 commits into from
Jun 26, 2019

Conversation

btzr-io
Copy link
Collaborator

@btzr-io btzr-io commented May 30, 2019

WIP

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Fixes

Changes

Automatically generated links

  • @channel -> [@channel](lbry://@chanel)
  • @channel/claim -> [@channel/claim](lbry://@channel/claim)
  • lbry://claim#e -> [lbry://claim#e](lbry://claim#e)

Todo

  • Validate channel url
  • Channel mentions ( custom link )
  • Create channel tooltip
  • Implement channel tooltip
  • Auto-embed lbry urls

@neb-b
Copy link

neb-b commented May 30, 2019

This is awesome!

@neb-b
Copy link

neb-b commented Jun 10, 2019

Hey @btzr-io! Sorry I lost track of this one. Do you have any urls I can test this at?

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 10, 2019

@seanyesmunt Here is a claim with examples for all the new features:

lbry://channel-tooltip#336e32722929861f1e8557381ffac66cb93a4e7b

But you can see some real examples already working here:

Mentions for channels:

I think this is a good example of this feature but you could also mention a friend's channel or another channel you own:

"Get this episode, DRM free, on LBRY (https://lbry.com) at: @lunduke"
lbry://does-going-full-stallman-isolate-a#f5761639b0416038e0257046cce7b59f7b4a6e42

Auto-embed lbry urls
I think this is really useful for obscured links like what is this link? because usually the lbry url don't give us any information about the content ( it can help with clickbait)

"The full unedited video can be watched here"
lbry://one#3ae4ed38414e426c29c2bd6aeab7a6ac5da74a98

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 10, 2019

Also I still need to find a way to let the user choose if the auto-embed feature should apply for a specific link. I think discord has a syntax for this:

<http://no-preview.com> | http://show-preview.com

But this don't work on inline links like this [link'](<url>)

@neb-b
Copy link

neb-b commented Jun 10, 2019

Cool. I'll mess around with those links. Let me know when you would like me to review this PR.

@neb-b neb-b assigned btzr-io and unassigned neb-b Jun 10, 2019
@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 10, 2019

I found a plugin for custom props, now we can block the auto-embed with this syntax:

[link](lbry://cute-fat-cats){ data-preview=false }

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 11, 2019

@seanyesmunt Ok, is ready for review:
I noticed some weird glitches / issues with the tooltip, but I'm still not sure if I fixed all of them 🙃

Also let me know if you notice any performance or loading time issues ( can't confirm nothing yet )

@lbry-bot lbry-bot assigned neb-b and unassigned btzr-io Jun 11, 2019
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 12, 2019
@neb-b
Copy link

neb-b commented Jun 12, 2019

Can you try to use https://ui.reach.tech/tooltip/?

I was planning to use this for the regular tooltips. It has great keyboard/accessibility support. If it looks like a lot of trouble don't worry about it.

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 17, 2019
@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 21, 2019

@seanyesmunt ready for review ✌️

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

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

I ended up adding reach/tooltip to the branch I'm working on. I used the ClaimListItem component (i'm going to rename to ClaimPreview) and added the tooltip in just a couple lines.

99b5cff

I really like what you did with your channel tooltip, but to keep development simpler in the future I'm going to just use this ^ for now.

Everything else looks good. I can merge once the tooltip stuff is removed.

@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 24, 2019
@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 24, 2019

@seanyesmunt Ok done 👍

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 24, 2019

I really like what you did with your channel tooltip, but to keep development simpler in the future I'm going to just use this ^ for now.

yeah that looks better and clean 👍 💯

@neb-b neb-b merged commit 081d860 into master Jun 26, 2019
@btzr-io btzr-io deleted the smart-links branch July 4, 2019 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants