Show warning when MR description will be replaced with generated content
What does this MR do and why?
For #415369 (closed)
Like choosing an MR template, applying content that a generative language model created will completely obliterate any content already in the MR description field.
In the first pass of this feature, that happened without interruption, which could be surprising to users and lose their entered content.
This update interrupts the replacement of the content by showing a warning (modeled exactly from the template chooser warning, including a similar code integration) which waits for the user to confirm the content replacement before actually doing it.
Implementation notes
- This roughly matches the way that the MR description template chooser works
- We're connecting HAML-rendered (pure) DOM through "unrelated" Vue code which responds to an Observable stream of data from a GraphQL, so it's not the most optimal solution
Screenshots or screen recordings
Before | After | |
---|---|---|
Replace/Approve | before | after-approve |
Cancel | after-cancel | |
Close | after-close |
How to set up and validate locally
Follow the validation steps from the original implementation MR.
In that process, you will see the new warning banner, and you can interact with the three elements (approve, close, or cancel).
For convenience, here (collapsed) is what all the of tests passing looks like, so you can review the high-level descriptions separately from the code:
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.