A reference for MPDB's style and design decisions.
How to populate the summary of the current search criteria.
Search criteria with almost all the stuff filled in. The sections should be expand/collapseable.
Since we decided that the user can choose a location either by entering coordinates or choosing a region/country combination (not both), the Location part will display only one of these:
.
This can get kinda crazy. I was trying to come up with ways to represent what the user has selected in a meaningful way that also fits in this tiny space. I decided that the hierarchy would have to be compromised a bit. By that I mean if a node has children, it is considered a top-level category, whether it has a parent node or not. This way, a summary can be built, with one "sentence" for each category of Mineral that has some or all children selected.
But, just like everything in life, there is an exception to this rule. The exception occurs when we do not want to "repeat" data. An example would be "All Tectosilicates". We would not want to also display "All Silica", because that is implied.
I think the following pseudo-code will help:
if category.selected == 0 || category.selected == category.total && category.hasparent && category.parent.selected > 1: do not show else if category.selected == category.total: show "All [category]" else if category.total > 6 && category.unselected <= 3: show "All [category] except [unselected1], [unselected2], [unselected3]" else if category.selected > 1: show "[category]: [selected1], [selected2], ..., [selectedN]"
Other things to note: if a child has children, it is only considered 'selected' by its parent when it has all its children selected. Also, if some (but not all) of its children are selected, its display name should be prepended with "some " when being displayed inside its parent:
if category.hasparent && category.selected < category.total && category.selected > 0 && category.parent.selected > 1: in parent show "some [category]" // (regardless of whether it is in an "except" statement or not) // valid example: "All Tectosilicates except some Silica" // valid example: "Tectosilicates: Sodalite, some Silica, Leucite" // invalid example: "Tectosilicates: some Silica" // instead, this should just be "Silica: Coesite, Quartz"