Loading
Fix inline blame gutter requiring two clicks to open and close
What does this MR do and why?
Fixes two inline blame bugs (behind the inline_blame feature flag), both caused by the same pattern: two competing router navigations where the second one is built from a stale route and cancels or overwrites the first.
- Opening: clicking a line number link only appended
#L<n>to the URL; a second click was needed to open the blame gutter. Theblame=1push was cancelled by a hash-only replace built from the stale route. - Closing: clicking the header Blame button once didn't close the gutter. The toggle pushed a route removing
blame, which flipped the header state and triggeredviewer-changed;handleViewerChangedthen pushed a second route built from the stale query still containingblame=1, reopening the gutter (and cancelling the first push, an unhandled rejection in vue-router 3).
Both are fixed by issuing a single navigation that carries all query and hash changes together: opening threads the line hash through the blame=1 push, and closing is owned entirely by handleViewerChanged, which strips blame, sets plain, and preserves the line hash.
Screenshots or screen recordings
How to set up and validate locally
- Ensure the
inline_blamefeature flag is enabled (default-enabled beta). - Open any text file blob page.
- Click a line number link once, the URL gains
?blame=1and#L<n>, and the gutter opens. - Click the header Blame button once, the gutter closes,
blameis removed from the URL, and the#L<n>anchor is preserved.
References
- Feature issue: #430950 (closed)
- Rollout issue: #501539 (closed)
MR acceptance checklist
Evaluated against the MR acceptance checklist.
Edited by Jacques Erasmus