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!
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:
// If there's a draft, open the create topic composer
if (model.draft) {
this.controllerFor('composer').open({
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.