Filter patchset level drafts from drafts section in ReplyDialog The patchset level comment is supposed to render at the top in editing mode. Given that the comment triggers a model update, it updates the "draftCommentThreads" property in GrChangeView(righfully so) and ends up being rendered twice in the reply dialog. Hence explicitly filter out the patchset level thread from the drafts container. The solution works cleanly now as it is possible to only create one patchset level draft per change. If that changes in the future then this solution would need to be adapted to ignore only the "latest" patchset level comment but should be okay to adapt in the future. Release-Notes: skip Google-bug-id: b/242982372 Change-Id: I4005ec603c8e51930e9fafb1fb1f1a3e7259c0be
diff --git a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts index e99156d..015c205 100644 --- a/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts +++ b/polygerrit-ui/app/elements/change/gr-reply-dialog/gr-reply-dialog.ts
@@ -687,7 +687,10 @@ subscribe( this, () => this.getCommentsModel().draftThreads$, - threads => (this.draftCommentThreads = threads) + threads => + (this.draftCommentThreads = threads.filter( + t => t.path !== SpecialFilePath.PATCHSET_LEVEL_COMMENTS + )) ); }