Implement "View file @ [SHA]" options menu item [Rapid Diffs][Diff File]
What does this MR do and why?
For #514397 (closed)
| Phase | Status |
|---|---|
| Disclosure dropdown | !182222 (merged) |
| View @ SHA |
|
| Open in Editor | !182851 (merged) |
Adds the "View @ [SHA]" menu item to the Rapid Diffs Diff File Options dropdown menu.
Please note that the overall thesis of Rapid Diffs is "render as much as statically possible on the server so it can be cached."
To that end - and since there's no non-JS implementation of GlDisclosureDropdown - the server provides as much information as it can (the static data) and the front end picks that up to provide to the Vue component.
In other words, this isn't done with Vue + an API call because we're explicitly trying to avoid that overhead in Rapid Diffs.
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 |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Enable the
rapid_diffsfeature flag:rails c=>Feature.enable( :rapid_diffs ) - Have an MR with at least 1 change
- Visit the MR's Changes tab
- Add
?rapid_diffs=trueto the URL (or&rapid_diffs=trueif there are already search parameters)- Submit the URL change to reload the page
- Open the "kebab" (vertical ellipsis "Options") menu
- Ensure the "View file @ [SHA]" menu item is present, correct, and works properly.
- You can verify this by performing the same steps but without the
rapid_diffs=trueURL search parameter, as the page will bemasterwithout it.
- You can verify this by performing the same steps but without the
Edited by Thomas Randolph

