Bad user experience when quoting an entire post via toolbar button

I was just writing a post over at community.badvoltage.org in reply to a topic that had already been created. After I’d finished a chunk of what I wanted to write, I decided that it needed to be block quoted. I selected the text to be quoted, then accidentally clicked “Quote whole post” rather than “Blockquote”. The end result is that my text was deleted and replaced with the whole post. At this point I realised my error and tried to undo. Nothing happened. I saw the “saved” text appear, exactly as when I’d been writing the original text. As far as I can tell, there is one draft and one alone, so once that “saved” appeared my text was lost for good.

I accept that this was my mistake, but it’s not a great user experience. I do not think that “Quote whole post” should be a destructive operation with no chance for return.

This is my first complaint in otherwise very satisfactory use of Discourse, thanks for making it.

1 Like

What browser are you using?

It isn’t a destructive operation. “Quote whole post” inserts the quote at the current cursor position.
It usually doesn’t delete any text unless you select some text before pressing “Quote whole post”. Selected text will be replaced with the quote.

But you should be able to undo the replacement with the browser’s undo function. Well, at least on a decent desktop browser. AFAIK there’s no undo function on Android (Chrome). iOS should have a hidden undo function, but I’ve never tested it…

Chrome version 60.0.3112.101 (Official Build) (64-bit) on Windows 10. I tried using Ctrl-Z and right click Undo, but neither did anything. I’ve just verified that again.

Quote whole post isn’t always a destructive operation I agree, but in this particular case it is.

Oh, I see. Undo doesn’t work. :frowning:

2 Likes

Undo not working was discussed in this topic

The issue is that Discourse’s editor buttons manipulate the <input> content directly, so the browser doesn’t know what’s going on and therefore can’t manage the undo history. Changing the editor buttons to use a technique like this, rather than modifying the <input> element directly would probably help:

6 Likes

I still agree that carrying around a GIANT and complicated undo implementation is a bit of a pointless nightmare. Browsers should do as they see fit.

1 Like

Oh yeah, definitely. The browser implementation should be fine.

My point is that currently Discourse breaks the built-in browser implementation by doing stuff like

currentContent = $('#composer').value;
newContent = currentContent + "some extra text";
$('#composer').set('value', newContent); 

The browser has no way to know that text has simply been appended. Setting the value does not add anything to the browser undo history.

This is what happens using the editor buttons at the moment:

(to be clear, after making the text bold, I just pressed cmdz repeatedly)

4 Likes

Absolutely support improving this, so we insert text at cursor as opposed to replacing all the text. It is not trivial to implement but doable.

4 Likes

Wait what? This does not happen. I have typed the above plus a quote now I am gonna press the QUOTE ENTIRE POST button in the editor (the leftmost icon)

image

pressing that button… NOW :boom:

As you can see my existing previously composed content in the post was NOT overwritten.

The scenario is that you write some text like this

I remember at some point that codinghorror said
this thing

Now, I want to make ‘this thing’ a blockquote, so I select it and click the blockquote 00 button in the toolbar.

That will give me

I remember at some point that codinghorror said
> this thing

But if I accidently select “this thing”, and then click 41, it replaces whatever I had selected in the composer with the raw text.

That behaviour is not wrong, it’s user error. The point is that it should be possible to undo that user error:

1 Like

Why bother with any of that? There is a much simpler solution. When pressing image this button… AUTOMATICALLY UNSELECT ANY COMPOSER TEXTBOX SELECTION FIRST, then proceed as usual.

4 Likes

Sounds a good solution to me.

3 Likes