Save show whitespace choice
What does this MR do?
Related to: #219325 (closed)
When changing "Show whitespace changes" save the selection to a cookie so that the choice is remembered on subsequent visits.
Note: I have chosen to have the querystring w
override the cookie since this makes sense to me. I imagine sharing a link to a coworker in order to discuss a change. I would want my coworker to see the same thing I do. If they have a different setting saved than me, then they will have a slightly different view.
So in order of preference: w
querystring -> cookie -> defaults to true
i.e. don't show whitespace changes.
Screenshots
Does this MR meet the acceptance criteria?
Conformity
Availability and Testing
To test:
- Go to any merge request currently in progress, or create a new one.
- Open the settings menu with the gear icon in the top right portion of the MR and Check the "Show whitespace changes" box
- Confirm checkbox is checked
- In the address bar of your browser confirm the querystring
w=0
- Still in the address bar change
w=0
tow=1
and pressenter
so that the page reloads - In settings menu confirm checkbox is not checked
- In the address bar remove the
w-1
querystring completely and pressenter
- In settings menu confirm checkbox is checked
Edited by Justin Boyson