-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[terminal] Always open terminal links on touch events #6875
[terminal] Always open terminal links on touch events #6875
Conversation
|
dbfef2a
to
498929a
Compare
e.g. when tapping a link on iPad. Signed-off-by: Jan Keromnes <jan.keromnes@typefox.io>
498929a
to
cfb33e8
Compare
@vince-fugnitto Could you try it out? i don't have ipad unfortunately |
I cannot test this one, I don't have an IPAD and/or a touch screen to test |
I forgot to mention, I unfortunately do not have an iPad or any tablet for that matter to properly test out the pull request 😞 |
I guess there are two main risks here:
I believe that 1. can be tested on non-touch devices, and that 2. is not critical (because Terminal links already don't work on touch today), but I can upload a video of me testing 2. on my iPad. |
It works as described, although I wonder how a user can figure out on iPad that a link is tappable? Can we highlight it with underscore and hover as on the desktop? Or you think it would be too much. |
Here is a video where I test this PR on my iPad: https://youtu.be/TL5EaIOfUZI However, please note that the main motivation for this fix was that on iPad (iOS 1.12), even with an external keyboard, you could not open Terminal links at all. But now that iOS 1.13 is out, if you have an external keyboard,
On iPad, the normal XtermJS styling of underlining links will happen when you focus on a link (I don't think there is an actual "hover" state on touch screens, except maybe modern/high-end screens that detect a nearby finger that's not yet in touch contact?):
But if you were talking about passive link styling to reveal what's clickable, I don't think XtermJS allows it, because they render everything via a |
Thank you for merging this! This change is a UX improvement for touch devices without external keyboard (e.g. tablet, smartphone). However, if it turns out that force-opening Terminal links when touched is not a desirable feature (e.g. if Theia users report issues about it), please feel free to revert my commit. |
What it does
Fixes #6320.
This PR attempts to detect whether a
click
event on an XtermJS link was from a touch screen (should always open) or not (should only open if Cmd was also pressed).This is achieved by keeping track of the last
touchend
event, and comparing times / coordinates.How to test
yarn
cd examples/browser && yarn start --hostname=0.0.0.0
3000
in desktop browser: runecho http://perdu.com
3000
on touch device, e.g. iPad: runecho http://perdu.com
Review checklist
Reminder for reviewers