'Drafts' view in profile


(Kane York) #1

I think there should be a view in your profile of all open drafts that you have.

I’ve made a small mockup:


Finding drafts
Discourse 2.1.0.beta4 Release Notes
(Sam Saffron) #2

I would love this, @codinghorror is less enthused about it, not sure why though.


(Jeff Atwood) #3

I don’t mind it per se, it is just a narrow power user feature that benefits few.

Btw, buttons to remove bookmarks like what you show here would be much more useful here on the bookmarks tab.


(Kane York) #4

Okay, yeah, I agree. Shelve it until after 1.0 or something, then.


(Jens) #5

I also think this is a useful feature.
It might cause confusion, when you post a reply 48h later from your drafts box, while discussion has moved on. But still cool, gmail style.


#6

I’m going to take a stab at accomplishing this feature. (There are a few other discussions of this, most notably here.)

I made a mockup similar to the initial one from @riking:

From a first look at the endpoints, I see that /draft.json is used to load, post (update) and delete an individual draft, but I didn’t find anything that loads multiple drafts. As part of the PR, I would add a new endpoint at /drafts.json that would retrieve the full list of the user’s drafts, and then display that list on the tab in the user’s profile.


Completely unread topics with recent replies should show as new
#7

This is moving along fairly well, but I have a few questions/issues:

  1. Should private draft messages (and PM replies) be included in the Drafts subtab under Activity? If not, should they go under a Drafts subtab under Messages?
  2. Currently, if a user has a draft private message, as soon as they enter the user profile route (i.e. any of the user tabs), the composer is loaded with the user’s draft. IMO, this should no longer be the case if drafts are displayed in a list.
  3. This next issue is related to the composer. If the composer is already open, when trying to modify another draft, there is a warning shown to the user, with two options: Abandon or Keep draft. In the context of drafts saved in the background, this makes sense, but with drafts visible in a list, this behaviour could be confusing the user. I did a little video to illustrate this: File “screencast 2018-07-20 19-17-28.mp4” and I think that the modal at the end should a) better identify the post it is referring to and b) a third action should be available, that is, to still keep the post as a draft but continue loading the next draft. (Or, again at the end of the video, maybe switching to another draft should not load that warning modal window, but simply load the next draft?)

#8

I went ahead and set up the PR: FEATURE: Drafts view in user profile by pmusaraj · Pull Request #6143 · discourse/discourse · GitHub

Regarding my questions in the message just above, 1) all drafts (public and private) are listed in the drafts tab under Activity, 2) the user’s draft private message will be loaded in the composer only if the user enters the /u/username/messages screen and 3) I opted for the very last option here, that is, to quietly close the previously-open composer if user resumes another draft from the list. (I found this to be the most user-friendly option.)


(Sam Saffron) #9

First of all :confetti_ball: :dancing_women::dancing_men: for getting this merged!

I am looking at this now and have some bits of feedback:

  1. If I am an admin and head to look at some other user’s drafts I should not get anything on that screen, we should keep drafts totally private here.

  2. We never expose post ids anywhere, “Reply to #11 by @sam” is possibly acceptable, maybe we just remove all of that for now to reduce confusion and noise.

image

  1. Use “Resume” instead of “Resume Draft” … Use “Remove” instead of “Remove Draft” … omit needless words… we may even be able to get away with just icons there … not sure.

  2. You should pick the avatar of the user I am replying to vs the avatar of the topic OP.

  3. We have the setting " delete drafts older than n days" set to 180 out-of-the-box. If you have old drafts we should either warn that this setting exists and soon the draft will be gone the way rain washes away tears or we should push the number further. @codinghorror what are your thoughts here.

  4. Remove draft does a full screen refresh which is somewhat jarring, it should simply remove the row.

  5. We should add a keyboard shortcut to get to drafts


#10

Thanks for merging and for the feedback, @sam, just posted a PR with fixes to all items minus #5.

For #2 I opted to remove the “Reply to #123…” altogether but I kept the text in that space for the other two cases (new topic, new private message).

For #7, I set g then d as the shortcut.


#11

First of all, thank you so much @pmusaraj for taking the time to add this feature :heart_eyes: This is an excellent addition to Discourse!


This feature is pretty much perfect as is, but I did have an afterthought:

Now that we have such a neat and tidy list of drafts, would it make sense to start allowing more than one new topic draft? Topics tend to be much larger-scale compositions than replies (not always, but more often than not). Having the ability to work on a few topic drafts at a time seems like it would be quite beneficial.

This has been talked about before quite a bit (here and to some extent here and here just to point out a few). There are some perfectly acceptable workarounds suggested, but I thought the context might have changed a little with this new drafts list feature. Just was curious if the sentiments from Team Discourse might have changed on it. No worries if not, just thought I’d ask :slightly_smiling_face:

(PS - If this is deviating too far from the topic at hand, please don’t hesitate to moderate accordingly. I wasn’t sure where the most appropriate place to bring it up would be.)


(Sam Saffron) #12

Awesome, merged this in!

Regarding:

We have a pretty good opportunity to teach people about drafts here, any ideas for some nice text here @codinghorror ?


(Jeff Atwood) #13

This looks fantastic thank you @pmusaraj – just a tiny copyedit as @sam suggested and we’re golden.


(Jerome Spaargaren) #14

This is so useful, thank you. It would be excellent if new topic drafts (and new message drafts) were also auto-saved and available in drafts.


(Sam Saffron) #15

This is already the case


(Jeff Atwood) #16

I think what he is confused about is that there can only ever be one new topic draft in flight at any given time.

But there can be infinite new reply drafts.


(Kane York) #17

Bug: Whenever I delete a draft, the entire list goes away and I need to refresh to delete the next one.


#18

I’m unable to reproduce this issue here on meta. That is, I am able to remove one draft after another, the full list doesn’t go away.