Display accurate reason why suggestion is not applicable on apply
The following discussion from !34149 (merged) should be addressed:
-
@pedroms started a discussion: (+1 comment) @patrickbajao
📝 Text: When a user merges an MR and doesn't refresh the page, the suggestions that weren't applied still show an enabledApply suggestion
button. I assume we are not updating these buttons in real-time when an MR is merged. If that is true, can we change the error message that appears when the user then presses one of those buttons, so that it uses the same tooltip text that we show when the button is disabled?To be clear, what I'm suggesting is having
This merge request was merged. To apply this suggestion, edit this file directly.
as the error message in that alert component.
In #219455 (closed), Suggestion#inapplicable_reason
was added. That can be used here to display the same message when applying suggestion fails.