"Show/Hide whitespace changes" button resets diff view mode
When loading a diff with a view mode given in the URL (e.g.
?view=inline), and then switching the view mode via the button, the "Show whitespace changes" (or "Hide whitespace changes") button resets the view to the one from the URL.
Steps to reproduce
- Load a diff with a view mode in the URL
- Click the opposite view mode button
- Click the "Show/Hide whitespace changes" button
This bug is reproducible on GitLab.com:
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/7834/diffs?view=inline– note the view mode in the URL parameter.
- Click "Side-by-side"
- Click "Hide whitespace changes"
What is the current bug behavior?
The diff view is reset to inline mode
What is the expected correct behavior?
The diff view mode remains on the selected "Side-by-side".
Output of checks
This bug happens on GitLab.com
I think this happens because the URL for the "Show/Hide whitespace changes" button is calculated on page load and not updated when the view mode is switched later.
This issue is related to the other "URL of the whitespace button" ones: