-
Notifications
You must be signed in to change notification settings - Fork 309
msglist: Make links touchable, opening in browser #71
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
Labels
Milestone
Comments
This was referenced Apr 19, 2023
This was referenced Jun 21, 2023
gnprice
added a commit
that referenced
this issue
Jun 27, 2023
This abstraction doesn't pull a lot of weight yet, but it will when we start tracking LinkNode descendants, for #71.
gnprice
added a commit
to gnprice/zulip-flutter
that referenced
this issue
Jun 29, 2023
At this stage we don't yet *do* anything with this information, like open the linked URL when the user touches the link (zulip#71). That will require some more infrastructure, which we build next.
gnprice
added a commit
to gnprice/zulip-flutter
that referenced
this issue
Jun 29, 2023
This gives us the information that the corresponding widgets will need at build time in order to create appropriate gesture recognizers for touching the links, as part of implementing zulip#71.
This was referenced Jun 29, 2023
gnprice
added a commit
to gnprice/zulip-flutter
that referenced
this issue
Jul 6, 2023
At this stage the recognizer is always null and so this doesn't do anything. But it provides us the infrastructure with which to start recognizing taps on links, zulip#71.
gnprice
added a commit
to gnprice/zulip-flutter
that referenced
this issue
Jul 6, 2023
gnprice
added a commit
to gnprice/zulip-flutter
that referenced
this issue
Jul 6, 2023
At this stage the recognizer is always null and so this doesn't do anything. But it provides us the infrastructure with which to start recognizing taps on links, zulip#71.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many Zulip messages have links in them. We should recognize when the user taps such a link, and follow the link for them.
For this issue, it's OK not to try to recognize links that are internal to the Zulip realm (that'll be #73); we can just open all links as generic URLs, in a browser.
The tricky parts here are about managing the GestureRecognizer objects for recognizing taps on the links.
First, there's a quirk in Flutter's API for using a gesture recognizer on text spans: see flutter/flutter#10623 and in particular flutter/flutter#10623 (comment) . I have a draft branch from back in December that deals with that; the key lines are this in
_buildInlineNode
:and then
recognizer
is a parameter passed down recursively by_buildInlineNode
and everything else that buildsInlineSpan
s out of otherInlineSpan
s.Second, there's the question of where those recognizers should live as state. In the draft branch, we render a
LinkNode
with aStatefulWidget
, which creates a recognizer ininitState
. That was good enough for a proof-of-concept of solving the first issue, but isn't the layout we want. Here's my notes from there on the way forward:Better yet, walking the inline nodes to find links should happen within
parseContent
. From brief discussion later in chat:The text was updated successfully, but these errors were encountered: