Page 1 of 2

Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 3:54 pm
by v12mike
The current system for handling drafts is a bit of a unicorn, and lacks several features that users commonly want, such as BBCode support, attachment support, and probably others that I have not thought of yet.

In my experience, the users who most need to use the drafts facility are creating long, and complicated posts containing tables, attachment and formatting etc. For these posts, the existing drafts system is useless.

My proposal is to completely re-implement the inner workings behind the drafts UI such that drafts are edited in exactly the same way as normal posts, and are saved (as normal posts) with a new visibility flag value that makes them visible only to the user who creates them. This would have similarities to soft delete, but the user (and moderators) would have control of when to convert them to normal posts.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 5:48 pm
by david63
Totally agree

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 6:06 pm
by warmweer
v12mike wrote:
Thu Sep 12, 2019 3:54 pm
In my experience, the users who most need to use the drafts facility are creating long, and complicated posts containing tables, attachment and formatting etc. For these posts, the existing drafts system is useless.
Which is why with long and complicated posts I try to (if I don't forget) write stuff in a text editor and then copy paste to preview.
And yes, is has happened that I've lost all formatting when saving a draft. I see no reason for a NO vote, nor for not voting, so 12 points (but only 1 yes) from the Belgian jury (I hope the other Belgian juries act similarly, scratch Belgian).

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 6:44 pm
by AbaddonOrmuz
This could help with this idea too:

viewtopic.php?f=436&t=2189611

Posts awaiting approval could be set as draft.

Both features seems that would do something very similar.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 6:48 pm
by v12mike
I had forgotten about draft PMs (never had the need for them), but they should be dropped or reworked in a similar manner.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Sep 12, 2019 6:52 pm
by v12mike
AbaddonOrmuz wrote:
Thu Sep 12, 2019 6:44 pm
This could help with this idea too:

viewtopic.php?f=436&t=2189611

Posts awaiting approval could be set as draft.

Both features seems that would do something very similar.
Funny that you should mention that, I have just completed coding of that feature (PR at: https://github.com/phpbb/phpbb/pull/5686) and while working on that I realised that a bit more work on the visibility code could also work for draft posts.

Drafts are more complicated (than unapproved posts) because the existing UI needs (in some aspects) to be respected, and existing drafts need to be migrated.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Sep 13, 2019 8:13 am
by Talk19Zehn
Hi, I agree in principle with the basic proposals. +10

BTW: As far as i know ...
Note: The default function in phpBB ===> "... Save drafts..." ---> separates e.g. attachments and they are not included in the drafts, only continued by name! In the personal profile the user can manage drafts, but in this area these attachments from the drafts are not recorded.

In the ACP you will find such attachments as orphaned file attachments. At least it used to be that way. And in my opinion this is even a BUG from my point of view, which you already know from earlier times. The sense and purpose to manage these attachments in drafts in the orphaned file attachments does not open up to me so purely formally
.

Furthermore, it is very useful to revise the area for drafts.

Best Regards

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Mon Oct 14, 2019 3:52 pm
by Toxyy
v12mike wrote:
Thu Sep 12, 2019 3:54 pm
such as BBCode support, attachment support
Implemented these on another board myself, not really too difficult. Just some html wrappers IIRC for the bbcode bit.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Mon Oct 14, 2019 4:14 pm
by v12mike
Toxyy wrote:
Mon Oct 14, 2019 3:52 pm
v12mike wrote:
Thu Sep 12, 2019 3:54 pm
such as BBCode support, attachment support
Implemented these on another board myself, not really too difficult. Just some html wrappers IIRC for the bbcode bit.
Feel free to submit a patch.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Thu Oct 24, 2019 7:44 pm
by v12mike
I have been prototyping some aspects of this feature, and it does not seem to be too fearsome.

The approach that I have taken is to treat saved drafts more or less as submitted posts, but with a new visibility code that makes them invisible to most normal forum operations. A bit of tweaking of the posting editor allows them to be edited and re-saved or deleted.

I have decided that the existing interfaces for loading drafts (via the UCP or a button in the posting editor) are not fit for purpose, as they are not intuitive places to find drafts, and are too confusing. So I have implemented an new "Your drafts" search (very similar to the "your posts" search) as the means of re-loading a saved draft.

I have set up a demo board with the current prototype code at http://xmv6.uk/new_drafts_demo1/ you may create an account on that board and try the drafts facility and give some feedback. It is far from complete, there is no handling of draft PMs and there are several cosmetic issues, not to mention lack of migration files and tests...

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Oct 25, 2019 5:35 am
by v12mike
I have had some comments from "Drifter" (who probably has a different handle here), with my response:
Thanks for your comments.
Drafter wrote:
Thu Oct 24, 2019 8:21 pm
1 - In the post editor next to cancel | save draft | preview | submit | delete - how about a 'your drafts' button.
The best positioning of "your drafts" links or buttons is difficult to decide. Loading a draft after clicking "New topic"/"New post" just feels wrong to me.
Ergonomically, they should be put next to the "New topic" and "Post Reply" buttons, Perhaps if a button is placed there, but only if the user has existing drafts in that forum/topic.
Perhaps also a button in the Quick Edit pane next to the "Full editor" button?
Drafter wrote:
Thu Oct 24, 2019 8:21 pm
2 - On the 'your drafts' page, the edit draft button could be in the same place as the 'edit post' button, along with a 'delete draft'
I think I agree with that, and my first (abandoned) prototype of the feature used the viewtopic template which had the "Edit" etc. buttons. The current incarnation is using the search results template which does not have buttons (maybe buttons should be generally added there?).
Drafter wrote:
Thu Oct 24, 2019 8:21 pm
3 - The drafts listed on the 'your drafts' page could have a different colour background - they look much like a normal post so a different colour background would prevent anyone from getting mixed up and accidentally deleting them etc.
An interesting thought. Changing colours is a bit of a grey area (excuse the pun), as unless there is already a background colour used elsewhere in a similar way, it would involves changes to prosilver and other styles. As a style maintainer I would need convincing of the need for this.

I will look into draft PMs next, before tackling the cosmetic issues.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Oct 25, 2019 6:20 am
by 3Di
An interesting thought. Changing colours is a bit of a grey area (excuse the pun), as unless there is already a background colour used elsewhere
Yes, there is the unapproved posts' color (light red iirc).
v12mike wrote:
Thu Sep 12, 2019 3:54 pm
but the user (and moderators) would have control of when to convert them to normal posts.
Hmmm, that's the point I do not like, therefore I can't vote.
Is it possible, as of now, that someone can make my drafts visible?

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Oct 25, 2019 6:40 am
by v12mike
3Di wrote:
Fri Oct 25, 2019 6:20 am
An interesting thought. Changing colours is a bit of a grey area (excuse the pun), as unless there is already a background colour used elsewhere
Yes, there is the unapproved posts' color (light red iirc).
I had overlooked that, I will see how well it works in this template.
3Di wrote:
Fri Oct 25, 2019 6:20 am
v12mike wrote:
Thu Sep 12, 2019 3:54 pm
but the user (and moderators) would have control of when to convert them to normal posts.
Hmmm, that's the point I do not like, therefore I can't vote.
Is it possible, as of now, that someone can make my drafts visible?
I have not implemented any visibility of drafts to moderators, and I don't now intend to.
It may be a good idea to place a limit on the number of draft posts that any user can have.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Oct 25, 2019 7:54 am
by david63
v12mike wrote:
Fri Oct 25, 2019 6:40 am
It may be a good idea to place a limit on the number of draft posts that any user can have.
Just as long as it is a custom setting - preferably at group level.

Re: Re-implement "Drafts" as normal posts visible only to the poster

Posted: Fri Oct 25, 2019 8:00 am
by v12mike
3Di wrote:
Fri Oct 25, 2019 6:20 am
An interesting thought. Changing colours is a bit of a grey area (excuse the pun), as unless there is already a background colour used elsewhere
Yes, there is the unapproved posts' color (light red iirc).
I just tested this with some unapproved posts, and (using prosilver) I don't see this red background. Can you give an example of how to show it?

Its not that I don't know how to create a red background, but I would rather follow an existing precedent.