Skip to content

Hide draft comment note text when editing the comment

Thomas Randolph requested to merge tor/defect/hide-draft-text-during-edit into master

What does this MR do and why?

For #417908 (closed)

Problem

When editing a draft comment added to the Overview page (not on any diff), the body of the draft remains visible when the editor text box is open.

Cause

The CSS that hides the text body is specific to Overview timeline entries that have a specific structure (namely: notes must appear in a list as the immediate descendant of a .timeline-entry). Draft comments do not follow that specific structure (they are still in timeline entries, and they are still in a list item, it's just structured slightly differently). As a result, the display: none that hides the .note-text never applies.

Solution

Rather than try to restructure how solo draft notes are displayed in HTML (potentially causing many side effects!) or reconfigure the existing CSS to also apply to the solo draft notes HTML (potentially causing many side effects!), this fix adds a single rule that applies to this slightly different structure and also applies display: none; the same way the other notes hide their text.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Before After
draft-comment-edit-before draft-comment-edit-after

How to set up and validate locally

Please see the associated issue for replication steps.

Edited by Thomas Randolph

Merge request reports