I think there should be a view in your profile of all open drafts that you have.
I’ve made a small mockup:
I think there should be a view in your profile of all open drafts that you have.
I’ve made a small mockup:
I would love this, @codinghorror is less enthused about it, not sure why though.
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.
Okay, yeah, I agree. Shelve it until after 1.0 or something, then.
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.
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.
This is moving along fairly well, but I have a few questions/issues:
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.I went ahead and set up the PR: https://github.com/discourse/discourse/pull/6143
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.)
First of all for getting this merged!
I am looking at this now and have some bits of feedback:
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.
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.
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.
You should pick the avatar of the user I am replying to vs the avatar of the topic OP.
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.
Remove draft does a full screen refresh which is somewhat jarring, it should simply remove the row.
We should add a keyboard shortcut to get to drafts
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.
First of all, thank you so much @pmusaraj for taking the time to add this feature 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
(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.)
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 ?
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.
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.
Bug: Whenever I delete a draft, the entire list goes away and I need to refresh to delete the next one.
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.
This is now complete.