Only allow Starting a new discussion on a line that doesn't yet have a Draft note created on it
Summary
Adding more than one Draft note to the same thread hasn't been possible up until now.
By introducing the ability to add Multiple Discussions in the same line (#32452 (closed)), we've introduced a bug and change in this pattern where we were able to add multiple drafts in the same line.
This caused two things
- The form Start a new discussion showed above the draft: easily resolvable.
- Only the last Draft note is rendered: not so easily resolvable.
There are other issues with rendering multiple (endless) drafts in the same line that should be addressed properly on an explicit UX effort. Issue to be created soon.
Steps to reproduce
- Go to any MR with a discussion on any line
- Click Start a new discussion
- Start a review
- Click start a new discussion
- Add a comment to the review.
- Click start a new discussion
- Add a comment to the review.
- Notice only one Draft is shown.
Example Project
Every project has this behavior.
What is the current bug behavior?
Form is shown above the draft.
Only last draft note is shown.
What is the expected correct behavior?
Two acceptable scenarios, discussed with @mvanremmerden:
- We show the form beneath the Draft Notes. Show all Draft notes added in the same line. (example screenshot)
or
- Per the pattern up to now, we disable the Start a new discussion form when a Draft note is present on that line (not if it is present in a Discussion on that line, only if the Draft note is the top comment in a new discussion. (example screenshot)
We've opted for solution 2 as interim solution as it doesn't break existing pattern and allows for a new functionality to be used.
We want to pursue solution outlined in 1. soon after with a proper solution.
Relevant logs and/or screenshots
Expected:
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)