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

Improve link handling in posts/comments #869

Merged

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Nov 1, 2023

Pull Request Description

This PR improves the functionality of links within posts and comments.

  1. There is now an InkWell effect around links to make it more clear that you're tapping on an interactable element.
  2. There is now a long-press menu with...
    1. A link preview.
    2. The full URL.
    3. The ability to open, copy, or share.

There are a few caveats with this implementation.

  1. Elements that are formatted by markdown and then surrounded by a link lose their additional markdown formatting. This is probably fixable, but with a lot of work.
  2. Even more strangely, as soon as we provide our own builder for the a element, all text surrounding a link on the same line becomes tappable. To handle this, I removed our onTapLink handler, which does solve the problem, but it also means that the text is not tappable in any capacity. That causes a small issue when viewing a CommentReference because it means you can't tap on the text surrounding a link to navigate to the comment. You have to tap on another line or outside the body.

Feel free to experiment to see what I mean by these issues, and if they're dealbreakers, I can keep working on it.

I'm going to leave this as a draft for now until I've had a chance to daily drive it.

Issue Being Fixed

Issue Number: #309, #709

Screenshots / Recordings

qemu-system-x86_64_xfbhehNZpv.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

@micahmo
Copy link
Member Author

micahmo commented Nov 3, 2023

I've been daily driving this and it seems to be working very well, so I'll mark this ready for review!

@micahmo micahmo marked this pull request as ready for review November 3, 2023 02:51
Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

LGTM!

@hjiangsu
Copy link
Member

hjiangsu commented Nov 3, 2023

Awesome, in that case, I'll go ahead and merge it in so that we can slot it into the nightly build

@hjiangsu hjiangsu merged commit 54e3d2d into thunder-app:develop Nov 3, 2023
1 check passed
@micahmo micahmo deleted the feature/improve-link-handling branch November 3, 2023 16:00
@micahmo micahmo mentioned this pull request Nov 3, 2023
@hjiangsu hjiangsu mentioned this pull request Nov 15, 2023
5 tasks
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