package templates // CollectionRules is the SMART-collection editor (plan item 3.4): the // unified filter builder in the collection's scope. One vocabulary // (services.FilterFieldsPayload — the same wire the All-Books builder // renders), one engine: Apply writes the tree to the collection and // the qf engine drives membership everywhere. Legacy rules arrays // preload as their CONVERTED tree (RulesToFilterTree) — the upgrade // happens at the first Apply, never silently at load. templ CollectionRules(user User, collection CollectionData, fieldsJSON string, treeJSON string, scope string) { Smart Collection - { collection.Name } - Bookhoard @Header(user, "/collections")
{ collection.Icon }

{ collection.Name }

⚡ Smart if scope == "episodes" { Episodes scope — membership recomputes live from the tree below. } else { Books scope — membership recomputes live from the tree below. }

Filter tree

@FilterBuilderRows("item")
}