Navigation with minimized topic draft can trigger abandon dialog


Hi there, hope everyone is having a great day :grinning:

I noticed some interesting differences in behavior between navigating around Discourse with a topic draft editor expanded vs minimized.

If the topic editor is minimized, any time you navigate from a topic to a category, you get prompted with the “abandon post” dialog. If the editor is fully expanded and you navigate in the same manner, the dialog does not appear.

Is this behavior intentional or a bug? The main reason I could see this as intentional is to remind you that you have a draft it progress, but it seems odd to bring up the “abandon post” dialog simply upon navigation. It feels like that dialog should be reserved for when you click “New Topic.” If the main idea was to remind the user, it seems more appropriate to either automatically expand a minimized draft or display some type of reminder dialog.

Let me know what you think or if I need to be any clearer in what I’m trying to explain!

(Jeff Atwood) #2

Just topic draft does this, or reply draft?


I’ve only had it happen with the topic draft. I just tried it with a reply draft and couldn’t reproduce it.

I’m just starting to try to familiarize myself with Discourse code, so this may be a dumb suggestion, but I did some digging and there was a fix made a few years ago:

I saw this addition:

  // If there's a draft, open the create topic composer
  if (model.draft) {
      action: Discourse.Composer.CREATE_TOPIC,
      draft: model.draft,
      draftKey: model.draft_key,
      draftSequence: model.draft_sequence

Would an action like that being called during navigation be what’s producing what appears to be the behavior you would expect if you clicked the “New Topic” button with a draft in place?


Here’s a screen recording of the issue. You will see the issue as I navigate to a couple of different categories with the editor minimized, then at the end I show that there is no issue when the editor is expanded.

(Sam Saffron) #5

I am going to close this as stale, @tshenry flag if this is still an issue in light of the topic draft changes I made.

(Sam Saffron) #6