plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Drag and drop feature of comment editor does not work properly when editing a comment

Open urvashigupta7 opened this issue 6 years ago • 17 comments

When a file is uploaded using drag and drop feature it gets added in different text box.

Steps to reproduce bug :

  • Add file in comment box using drag and drop (Don't post new comment just add the file)
  • Try editing any existing comment, the file will get added in wrong textbox

ezgif com-video-to-gif (8)

urvashigupta7 avatar Oct 23 '20 04:10 urvashigupta7

@cesswairimu @jywarren is this something i can take up?

ghost avatar Oct 24 '20 11:10 ghost

Hi, thanks @urvashigupta7 for opening this, I tested locally and it works fine. @KarenEfereyan could you please check on https://stable.publiclab.org/ could be its fixed but its not deployed yet. If you find the issue on stable you can go ahead. Thanks all

cesswairimu avatar Oct 24 '20 12:10 cesswairimu

Hi @cesswairimu. I am unable to add images while editing the comment on https://stable.publiclab.org/ . It just shows never-ending uploading

Screenshot from 2020-10-24 18-49-21

urvashigupta7 avatar Oct 24 '20 13:10 urvashigupta7

Great investigation, thanks @urvashigupta7, would you like to work on this or should @KarenEfereyan give it a try

cesswairimu avatar Oct 24 '20 15:10 cesswairimu

Great investigation, thanks @urvashigupta7, would you like to work on this or should @KarenEfereyan give it a try

@urvashigupta7 would you like to work on it? Thanks cess

ghost avatar Oct 25 '20 09:10 ghost

@KarenEfereyan You can try this out 😄 Thanks!!

urvashigupta7 avatar Oct 25 '20 10:10 urvashigupta7

@cesswairimu could you please assign this to me?

ghost avatar Oct 25 '20 22:10 ghost

@KarenEfereyan You can try this out 😄 Thanks!!

I see that you are a competitive programmer. I have been long interested in that. Could you tell me more about it?

ghost avatar Oct 25 '20 23:10 ghost

Go ahead @KarenEfereyan

cesswairimu avatar Oct 26 '20 07:10 cesswairimu

@KarenEfereyan You can try this out smile Thanks!!

I see that you are a competitive programmer. I have been long interested in that. Could you tell me more about it?

Sure @KarenEfereyan . I would be happy to help. Let us just connect on twitter, we can discuss about this there.

urvashigupta7 avatar Oct 26 '20 12:10 urvashigupta7

@cesswairimu @urvashigupta7 things have been tough on my side recently. Can you help me with the solving of this issue?

ghost avatar Nov 11 '20 17:11 ghost

@urvashigupta7 i'm unable to replicate the issue. I dragged and dropped files several times and afterward went ahead to edit comments and there are no irregularities. Or am i mistaken?

ghost avatar Nov 12 '20 01:11 ghost

Hi @KarenEfereyan. Edit comment does not work on https://stable.publiclab.org/ but I see edit comment works fine locally. But I am facing the issue I tried to show in the gif above.

urvashigupta7 avatar Nov 12 '20 03:11 urvashigupta7

Hi @KarenEfereyan. Edit comment does not work on https://stable.publiclab.org/ but I see edit comment works fine locally. But I am facing the issue I tried to show in the gif above.

Oh okay. Thanks so much

ghost avatar Nov 12 '20 07:11 ghost

Hello all, thank you for investigating and documenting this so carefully. I'm going to edit the title to add some specificity that this is during editing a comment. It may also be different depending on if the edited comment was just made (with no page refresh) or if it was there already, since newly made comments are inserted using JavaScript instead of being built-in at the time the page is prepared by Ruby.

I'm going to mark this as part of the overall Comment Editor project but whoever would like to work on it, i recommend writing a test that very specifically demonstrates this behavior, of editing a comment then drag-and-dropping an image - and to copy and adapt the test from this example:

https://github.com/publiclab/plots2/blob/a23a3f98a1847a4d6b7f241299a98dfa877d66ee/test/system/comment_test.rb#L136-L156

Thank you so much!

jywarren avatar Dec 01 '20 17:12 jywarren

and linking to #8775

jywarren avatar Dec 01 '20 17:12 jywarren

I'm researching this bug right now, and I can consistently reproduce it. Here are some instructions for those curious:

Steps to Reproduce Bug

  1. Upload an image to the main comment form (at the bottom of page).
  2. Open an edit comment form.
  3. Upload an image to the edit comment form.
  4. The image doesn't end up in edit form (expected behavior). Instead it ends up in the main comment form (actual behavior).

Bug Notes

  • This bug is present in research notes, and questions (not wikis).
  • This bug is also present between an edit comment form, and a 'Reply to this comment' form.
    • ie. you can reproduce it if you follow the instructions above, and replace 'main comment form' with 'Reply to this comment' form.
  • The bug is present regardless of whether or not you upload via select, or drag-and-drop.
  • The bug is present only when an edit comment form is involved.
    • For example, cross-wiring doesn't happen when you upload into the main comment form, then upload into a 'Reply to this comment' form.

I wrote a system test demonstrating this behavior and will open a PR for it shortly.

noi5e avatar Dec 27 '20 05:12 noi5e