Disable commenting on invalid lines (no identifier or in renamed files)
What does this MR do and why?
Disables the comment button on a line of code if:
- The file has no changes other than being moved, which causes an error when trying to save
- The line of doesn't have a
line_code
assigned, which would make commenting impossible
This MR also fixes an existing bug with disabled comment buttons that would change the text color (and thus the color of the icon), but leave the background (since it's disabled), leading to the icon looking like it disappears.
Screenshots or screen recordings
Before (master ) |
After (this branch) | |
---|---|---|
Trying to comment on any line in a file that is only moved and/or renamed | ||
Trying to comment on a line displayed by GitLab but isn't part of the source file |
How to set up and validate locally
Please use the reproduction steps from the associated issue (rename a file in an MR).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #239326 (closed)
Edited by Thomas Randolph