Advanced Search: remembering which fieldset collapse preferences per-user
Following PR31226, where one person expressed that they heavily use the "Display results as" feature, @nicol suggested that perhaps we could save this preference on a per user basis. We could even save this preference for all fieldsets.
Maybe someones uses "display results as" a lot, others are probably annoyed because they heavily use Activities, Relationships or various Custom Fields. Maybe they never use the Basic Criteria. (and it's honestly the first time I hear about someone using that feature - nice feature, but really mind-bending for most users)
In other words:
- We keep the current Advanced Search behaviour of collapsing the Search Settings initially, and only show Basic Criteria
- If the user uncollapses the Search Settings, then it becomes a sticky preference in the future. Whenever they go to the Advanced Search (on new searches), the Search Settings will be uncollapsed.
- This same behaviour would apply to other fieldsets as well, such as Address, Events, Custom Fields (and groups of fields in them).
In a sense, users setup their UI preferences once, and then it's sticky.
Technically, it might be implemented as a localstorage setting in the browser (simpler, and we can improve later if necessary).
In theory, this could lead to getting rid of the "Collapse this set in Advanced Search" setting on Custom Groups, but that can be decided later. That could be upsetting to uses with a lot of custom fields, and we have previously done some rather big changes in the past, such as always displaying all custom fields (when we renamed the "optimize for search" setting).
I found one possible bug: in most situations, if we uncollapse the fieldsets without selecting anything, it's fine. One exception: relationships. If we uncollapse relationships, it automatically filters by contacts who have an active relationship. I think that's a bug? It's definitely not coherent with other search sections.