Linking to a comment in a resolved non-diff discussion in an MR doesn't expand the discussion
When opening a direct link to a comment of a resolved non-diff discussion in an MR, the discussion isn't expanded to show the comment being linked to.
This may be due to our redesigned non-diff discussions where the first comment is shown and the rest is collapsed.
NoteableDiscussion, we have
isRepliesCollapsed which determines whether a discussion is expanded or not. This is a local property of the component with a default value based on whether the discussion is resolved or not.
This means it doesn't get affected when
discussion.expanded when the discussion is being linked to.
I also noticed that this component also has
shouldShowDiscussions which depends on
discussion.expanded but an OR condition was added to make it true all of the time.
In the template, this is also used like so:
<div v-if="shouldShowDiscussions" class="discussion-body">. We don't ever want this to be
false because the discussion would just look like a gray line.
shouldShowDiscussionsto something like:
isRepliesCollapsedand change all references to it in the template to
toggleRepliesand use the already existing
toggleDiscussionHandlerinstead. This actually triggers the
TOGGLE_DISCUSSIONmutation instead of just toggling the internal
It looks like
this.discussion.expanded is being set properly by the backend from
DiscussionEntity so we should just base the initial state on that instead of having special logic here in the view.