Skip to content

Save show whitespace choice

Justin Boyson requested to merge jdb/save-whitespace-setting into master

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

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

To test:

  1. Go to any merge request currently in progress, or create a new one.
  2. Open the settings menu with the gear icon in the top right portion of the MR and Check the "Show whitespace changes" box
  3. Confirm checkbox is checked
  4. In the address bar of your browser confirm the querystring w=0
  5. Still in the address bar change w=0 to w=1 and press enter so that the page reloads
  6. In settings menu confirm checkbox is not checked
  7. In the address bar remove the w-1 querystring completely and press enter
  8. In settings menu confirm checkbox is checked
Edited by Justin Boyson

Merge request reports