37
votes
Feature suggestion: Highlighted text in comment automatically creates quote when you respond to that comment
I'm fairly sure it's either a Reddit or RES feature, but whenever I select text in a comment and then click Reply, it'll copy that text to the comment box and add a > in front so it'll turn into a quote. It makes it a little quicker to respond to a specific part of someone's message.
I'm no IT bird and as such I don't know if this is something that can be implemented easily(if at all). It'd also require more JS, not sure if that's an issue as well.
In any case, let me know what you think.
Edit: I'd like to suggest something else, should I make a secondary post or append it to this one? I'd like to avoid cluttering up the front page.
I've implemented this now. Please let me know if you notice any issues with it. (@hungariantoast @Soptik)
edit4: seems to be a timing issue where a quick tap doesn't invoke quotes, not sure if it's apple devices being weird or if it can be solved with code. It works on all mentioned platforms and browsers if l tap slightly longer than l'm used to.
Does not seem to work on Safari on iOS 10.3.3, but not like l'm expecting to see this work for old software anyway.
Edit: Safari on iOS 12.0 doesn't seem to work either.
Edit2: Experimenting with Chrome on iOS 12.0 and it does work but rather inconsistently, some parts of my sentence quoting, some parts not. I'll look into this tomorrow and figure out if it's a bug or my devices acting weird.
Edit3: Couldn't resist experimenting a little more before going to bed. Apparently it only works with a slightly longer tap on "Reply" than usual, since a short tap(0.1-0.2s l think) does not invoke the quote function but only the reply window.
A slightly longer tap(0.3-0.4s or so) does work and quotes the selected text.
Not sure if this is my device acting up.
Tested on:
2017 iPad Pro running iOS 12.0 in Chrome and Safari;
iPhone 5c running iOS 10.3.3 in Safari
That's odd, there shouldn't be any relation to the length of the tap. About the only thing I can think of (and I have no idea if this is right) is that maybe it's clearing your selection when you release the tap, so holding it a little longer allows it to grab the selection, but releasing quickly doesn't give it enough time to do so (but it should be extremely fast, so that would be surprising).
You were always selecting text from inside a single comment? It won't work if you select text that isn't inside a comment, or make a large selection that crosses over multiple comments.
Yep, always inside a comment. Tested going over it's limits as well which didn't work as expected.
I'll actually go sleep now though, l'll look into the issue tomorrow as the deselect thing you mention sounds plausible. (good excuse to use a high-speed camera l guess ;)
Haha, a high-speed camera is probably pretty excessive for trying to figure it out. Remind me tomorrow and I can try moving the selection-capturing code so that it's the first thing that happens when you tap the reply button, that might solve it if something earlier in the process is clearing the selection.
It's not. I can confirm that a quick tap on reply with text highlighted doesn't activate the quote mechanic on even the latest iOS 12.1.4 released Feb 7 (also using 2017 iPad Pro) but a slightly longer press, shy of activating text highlighting again, does seem to work.
That's a weird one. Hopefully deimos' idea of moving the capturing code around solves it. :/
p.s. @deimos, might this have something to do with the iOS "fast-tap/click" mechanic that WebKit uses based on viewport width and initial-scale?
https://webkit.org/blog/5610/more-responsive-tapping-on-ios/
https://trac.webkit.org/changeset/191644/webkit
Perhaps specifically related to its behavior on focused input fields?
https://trac.webkit.org/changeset/233225/webkit
If moving the capturing code around doesn't solve it, perhaps playing around with touch-action CSS properties or using preventDefault() somehow might be able to?
Works on Safari on iOS (12.1.4). :)
It works on my Android phone.
Are subquotes a thing?
Edit: yes they are, and they don't work with quick quotes. Should I post it in the bug tracker?
I wouldn't add an issue for it. Making that work with the quick quotes would be quite difficult, and there would just be other edge cases that are probably almost impossible to fix, like selecting two chunks of text with a quote between them. It doesn't really need to be an incredibly in-depth feature that can handle everything, it's just supposed to be an easy way to quickly quote some text.
It's definitely a reddit thing. Looks like some "Deimos" guy wrote the code, I can probably get him to implement it here.
If I remember right, I think it was inspired by Github: https://github.blog/2013-02-04-quick-quotes/
I realize this is a "noise" comment, but this gave me a very sensible chuckle.
Yep, though selecting text properly still is a pain.
I intuitively do it since I'm used to Reddit, and expect the to-be-quoted message to show up in the box, but it doesn't. And I keep forgetting that Tildes doesn't have this feature ;)
I've made a separate post, thanks!
That's great idea, I really like it. I've made gitlab issue for it.
However it'll be quite hard to discover this feature if it gets implemented, it'd probably need to be included in the welcome message (but it feels not significant enough to be there), or in some kind of tutorial after registration if it eventually get's made.
It could be added to the Formatting help page that's at the top right of every comment box, I'd reckon.
After it's implemented, it will be one of the many features I'll include in the "how to" guide that I'm working on. I assume that, at some point, Deimos will create an official wiki for Tildes, and I can then transfer the guide from the unofficial wiki to the official wiki.