Add CategoryTrait that gives a name to a category of nodes. Provide
implementations for String, &str and ().
Add NodeTemplateTrait::node_finder_categories to list categories to
which the template belongs, defaults to an empty Vec.
Node finder now displays at the top a collapsible header for each
category and corresponding nodes inside of them. Nodes without a
category are displayed below, so the behavior of programs that don't
adapt to use categories remains the same. The collapsible headers
behave as follows:
For empty query, all categories are collapsed
Otherwise:
Categories that contain no matching nodes are ommited.
Matching categories are now opened by default -- it's assumed
that filtered results are more manageable and can now be
unwrapped.
The user can normally un/collapse each category, but if the
query is changed, the default is applied.
Update the example to use this feature.
This change will break all existing programs and the simplest fix to
that is adding type CategoryType = (); in the implementation of
NodeTemplateTrait. Default associated types are not supported, so
this can't be avoided with this design.
CategoryTrait
that gives a name to a category of nodes. Provide implementations forString
,&str
and()
.NodeTemplateTrait::node_finder_categories
to list categories to which the template belongs, defaults to an emptyVec
.This change will break all existing programs and the simplest fix to that is adding
type CategoryType = ();
in the implementation ofNodeTemplateTrait
. Default associated types are not supported, so this can't be avoided with this design.