==== Why remove the user preference
Since {T290941}, IPInfo has used a user preference to save the expanded state of the infobox.
In general, we should be conservative about adding user preferences, as outlined in:
* https://www.mediawiki.org/wiki/Best_practices_for_extensions#Code_architecture
* https://www.mediawiki.org/wiki/Just_make_it_a_user_preference
A preference for remembering UI state seems to contravene these guidelines. (NB IPInfo also adds a few other user preferences, but the others are mandated by legal requirements (T291582) or temporary (T292802).)
We do have a URL parameter `openInfobox` that forces the infobox to be open, which is used when clicking through from the IPInfo popup (T293723), and could also be added when sharing URLs.
==== User localStorage instead
Removing the preference would mean that the infobox would no longer default to open, without the URL parameter. We should instead do this in local storage.
localStorage is documented here: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
Using localStorage in MediaWiki is documented here: https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.storage - note that `mw.storage` has no expiry, and localStorage has limited space.
==== Acceptance criteria
We do have a URL parameter that forces the infobox to be open* A user preference is no longer set true when the infobox is expanded
* The user preference is set false when the infobox is collapsed, which is used when clicking throughas this removes it from the IPInfo popup (T293723),database. and could also be added when sharing URLs.This should be commented clearly in the code.
* A key is added to mw.storage when the infobox is expanded
* The key is removed from mw.storage when the infobox is collapsed
* A comment is added, Removing the preference would mean that the infobox would no longer default to openthat if we ever remove this feature, without the URL parametere should call ` mw.storage.remove(<our-key>)` here to free up space
* mw.storage is checked when deciding whether the infobox should be expanded or collapsed. We c(The URL parameter `openInfobox` should instead do this in local storage.still take precedence.)
==== What changes will the user see?
(NB IPInfo also adds a few other user preferences,* There is currently a bug where there can be a delay between the database being updated with the user preference, and the next page refresh. but the others are mandated by legal requirements (T291582) or temporary (T292802).)This bug will be fixed.
* The preference for an expanded/collapsed infobox will only persist as long as localStorage persists