# Bad user experience when quoting an entire post via toolbar button

**URL:** https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773
**Category:** Feature
**Created:** [25 Agosto 2017, 1:08pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773 "2017-08-25T13:08:15Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![ralight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ralight/32/120756_2.png) [@ralight](https://meta.discourse.org/u/ralight)
#### Post date: [25 Agosto 2017, 1:08pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/1 "2017-08-25T13:08:15Z")

</div>

I was just writing a post over at [community.badvoltage.org](http://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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [25 Agosto 2017, 1:32pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/2 "2017-08-25T13:32:20Z")

</div>

What browser are you using?

> [@ralight](#):
>
> I do not think that “Quote whole post” should be a destructive operation with no chance for return.

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](https://www.igeeksblog.com/how-to-undo-and-redo-typing-on-an-ipad-iphone/), but I’ve never tested it…~~

---

<div class="post-metadata">

### Author: ![ralight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ralight/32/120756_2.png) [@ralight](https://meta.discourse.org/u/ralight)
#### Post date: [25 Agosto 2017, 1:37pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/3 "2017-08-25T13:37:51Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [25 Agosto 2017, 1:44pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/4 "2017-08-25T13:44:07Z")

</div>

Oh, I see. Undo doesn’t work. ☹

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [25 Agosto 2017, 2:04pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/5 "2017-08-25T14:04:01Z")

</div>

Undo not working was discussed in this topic

> [@Undo (Ctrl/Cmd+Z) doesn't work for Markdown](https://meta.discourse.org/t/undo-ctrl-cmd-z-doesnt-work-for-markdown/51026):
>
> You can’t undo (Ctrl/Cmd+Z) Markdown formatting (e.g., bold). Steps to replicate: Start a new topic. Write three words. Highlight the second word and press Ctrl/Cmd+B Press Ctrl/Cmd+Z Expected result: Asterisks would be removed Actual result: Different in different browsers tested (Safari & Chrome on macOS), but not the expected result.

> [@Undo (Ctrl/Cmd+Z) doesn't work for Markdown](https://meta.discourse.org/t/undo-ctrl-cmd-z-doesnt-work-for-markdown/51026/14):
>
> There are zero plans to revisit this. Closing this topic because bikeshedding. The native browser form input element behavior is what you get – if you don’t like that, take it up with your friendly neighborhood browser vendor.

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:

> <https://stackoverflow.com/questions/16195644/in-chrome-undo-does-not-work-properly-for-input-element-after-contents-changed-p/27028331#27028331>

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25 Agosto 2017, 8:12pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/6 "2017-08-25T20:12:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [25 Agosto 2017, 8:28pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/7 "2017-08-25T20:28:21Z")

</div>

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

```javascript
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)

[https://global.discourse-cdn.com/meta/original/3X/6/f/6f492f3a6111475b89012b8ec66b4fcaa20be7e4.mp4](https://global.discourse-cdn.com/meta/original/3X/6/f/6f492f3a6111475b89012b8ec66b4fcaa20be7e4.mp4)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25 Agosto 2017, 8:30pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/8 "2017-08-25T20:30:11Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [25 Agosto 2017, 11:52pm UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/9 "2017-08-25T23:52:49Z")

</div>

> [@ralight](#):
>
> 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.

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](https://global.discourse-cdn.com/meta/original/3X/d/c/dc6b9e79d1fd092dea19dd958a6bf1de1257feef.png)

pressing that button… NOW 💥

> [@ralight](#):
>
> I was just writing a post over at [community.badvoltage.org](http://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.

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [26 Agosto 2017, 12:05am UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/10 "2017-08-26T00:05:17Z")

</div>

The scenario is that you write some text like this

```plaintext
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](https://global.discourse-cdn.com/meta/original/3X/c/5/c5c44d95c68a11f8ea6ee5a1e0badfa6ae5f13c2.png) button in the toolbar.

That will give me

```plaintext
I remember at some point that codinghorror said
> this thing

```

But if I accidently select “this thing”, and then click ![41](https://global.discourse-cdn.com/meta/original/3X/c/8/c857b7babb751d9e6be61a18414c5fcffcb960df.png), 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:

> [@ralight](#):
>
> At this point I realised my error and tried to undo

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [26 Agosto 2017, 12:17am UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/11 "2017-08-26T00:17:08Z")

</div>

Why bother with any of that? There is a much simpler solution. When pressing ![image](https://global.discourse-cdn.com/meta/original/3X/f/e/fe038402c46bc6648d4127087e44c31feb26674c.jpg) this button.. **AUTOMATICALLY UNSELECT ANY COMPOSER TEXTBOX SELECTION FIRST** , then proceed as usual.

---

<div class="post-metadata">

### Author: ![ralight](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ralight/32/120756_2.png) [@ralight](https://meta.discourse.org/u/ralight)
#### Post date: [28 Agosto 2017, 9:02am UTC](https://meta.discourse.org/t/bad-user-experience-when-quoting-an-entire-post-via-toolbar-button/68773/12 "2017-08-28T09:02:17Z")

</div>

Sounds a good solution to me.
