Plots2: Make a "suggestions" comment type that can be "accepted" by the author

Created on 26 Aug 2016  ·  14Comments  ·  Source: publiclab/plots2

It might reference a specific line in the original note, and once accepted, could then be minimized in the comments section, like:

@ebarry accepted a suggestion from @jywarren 3 days ago

This would be a little like inline comments on commits in Github (example from here)

screenshot 2016-08-26 at 5 15 53 pm


This needs breaking up, but some steps could be:

  • [x] a wiki.replace(before, after) method which searches for before and replaces it with after, unit tested (done!)
  • [x] a wiki.sections method which returns an array of wiki sections split on <p> and other block-level tags (done! we now use Inline Markdown Editor
  • some way to store suggestions that have been made via the above UI button, until they're "accepted" and the wiki.replace(b, a) method is used to enact the suggested change. This may need some thought (see below)

Much related old work here: https://github.com/publiclab/plots2/issues/1005

break-me-up enhancement help wanted

Most helpful comment

For now, perhaps we could just show the suggested changes in the comments, and show a notice that says there are N suggested changes by X authors at the top of the page.

[propose:text]This would be the suggestion and [replaces]This would be the replacement[/propose] maybe???

That's quite a nice idea! Let's break this feature into the following :-

  • [x] A syntax which could be used to identify the proposed changes and replacements (e.g [propose:text]This would be the suggestion and [replaces]This would be the replacement[/propose] as suggested by @jywarren). The comment body will have something like:-

Vidit is suggesting some changes on this page, "Suggestion" in place of "replacement". The sections to be replace could be viewed here. To accept this suggestion, click here.

The 'here' button would highlight the sections to be replaced along with the suggestions in the body
just like we have here:-
tod-1

  • [x] Smaller suggestions need to be handled in some way.
  • [x] Finally a link with the comments editor which would say something like 'Suggest changes'. This would render the syntax for suggestions in the comment editor

@jywarren @steviepubliclab @mathewlippincott please update this checklist, since this is still raw and needs some refinement. We could then make issues out of the checklist!!

All 14 comments

We might want to reference a line number, but if the post is edited, it could go out of date. Do we need note revisions?

We could note line number, and when there's an edit, we could do something with diff and attach to same line number?

this is a fantastic idea. we see in our google docs collaborations that people feel more comfortable with comments and suggestions than direct edits.

I'd like to bump this one up as well for rich wikis.

We just had this feature merged which is a bit similar -- https://github.com/publiclab/plots2/pull/2000

Maybe @ViditChitkara would like to try a version of that which proposes a change to a wiki page body text?

[propose:text]This would be the suggestion and [replaces]This would be the replacement[/propose] maybe???

But this would be harder because if you did a small section like [propose:text]the[replaces]bug[/propose], then it would replace all instances of the word the with bug -- not what we want. @ViditChitkara do you have any ideas on how to narrow this a bit?

Also adding: a way to see the suggestions, both in list mode (just the comments tab of the wiki page, maybe?) and inline (much harder!!)

We could actually insert the suggestions into the wiki text itself, rather than a comment... but we'd have to record who made the suggestion too. :-/ a tough nut to crack!

For now, perhaps we could just show the suggested changes in the comments, and show a notice that says there are N suggested changes by X authors at the top of the page.

For now, perhaps we could just show the suggested changes in the comments, and show a notice that says there are N suggested changes by X authors at the top of the page.

[propose:text]This would be the suggestion and [replaces]This would be the replacement[/propose] maybe???

That's quite a nice idea! Let's break this feature into the following :-

  • [x] A syntax which could be used to identify the proposed changes and replacements (e.g [propose:text]This would be the suggestion and [replaces]This would be the replacement[/propose] as suggested by @jywarren). The comment body will have something like:-

Vidit is suggesting some changes on this page, "Suggestion" in place of "replacement". The sections to be replace could be viewed here. To accept this suggestion, click here.

The 'here' button would highlight the sections to be replaced along with the suggestions in the body
just like we have here:-
tod-1

  • [x] Smaller suggestions need to be handled in some way.
  • [x] Finally a link with the comments editor which would say something like 'Suggest changes'. This would render the syntax for suggestions in the comment editor

@jywarren @steviepubliclab @mathewlippincott please update this checklist, since this is still raw and needs some refinement. We could then make issues out of the checklist!!

This sounds good - maybe one more; some filter which, after detecting a proposed replacement, checks if there is more than 1 instance of the proposed before text in the page body. If there's more than one, then the proposal is ambiguous, and the notice could say this and warn that accepting it may result in multiple replacements?

Also, after accepting a replacement, we could show an alert saying "Read over the page to ensure your changes are correct. Click here to revert the change!

The link to revert could be generated similarly to on the Revisions tab of a wiki page. This will make it easy to go back if you've done something out of control :-P 👍

Cool! That seems to complete the feature checklist :-+1. I'll be really happy to contribute to this!!!

amazing! 👍

@ViditChitkara have you started on this one? Thanks!

Woah!! This slipped out of my mind!! I guess I hadn't started coding this but was discussed completely. Will start working on this, after I'm through with deprecating the answer related code.

We now have 'replace' methods for nodes, this is still being debugged for
Rich Wikis, but it's a good reference -- check out the wiki controller's
'replace' option! We should finish debugging it over there, but then could
extend the ability for this purpose too.

On Mon, Mar 25, 2019 at 12:40 PM Vidit notifications@github.com wrote:

Woah!! This slipped out of my mind!! I guess I hadn't started coding this
but was discussed completely. Will start working on this, after I'm through
with deprecating the answer related code.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/741#issuecomment-476280971,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ4RkFm_r5N4xYoW9ChL8sXGUnq_3ks5vaPv3gaJpZM4JueYd
.

Was this page helpful?
0 / 5 - 0 ratings