Loading
Hide Explain Code button while blame is shown in the blob viewer
What does this MR do and why?
When blame is turned on in the blob viewer, the Explain Code ("?") button clashes with the blame info column. This MR hides the button while blame is shown by adding !this.showBlame to shouldRenderAiGenie in blob_content_viewer.vue. This is the minimal fix from the issue's implementation plan. The button comes back as soon as blame is turned off.
Closes #606181 (closed).
Screenshots or screen recordings
Before and after screenshots of the blob viewer with blame turned on will be added.
How to set up and validate locally
- Run
yarn jest ee/spec/frontend/repository/components/blob_content_viewer_spec.js. - In GDK, make sure Explain Code is available for your user and project (GitLab Duo turned on).
- Open a source file in a repository, for example a
.jsor.rbfile. - Select some code and check that the Explain Code ("?") button shows.
- Select Blame. Select some code again and check that the button does not show.
- Turn blame off. Select some code and check that the button shows again.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.
This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.