Problem
In Neo.data.TreeStore#filter() (src/data/TreeStore.mjs:612), active filters are selected with the pre-Filter#effective rule from #9331 / #9438:
const activeFilters = me.filters.filter(f => !f.disabled && f.value !== null);
This diverges from Filter#effective (src/collection/Filter.mjs:115-118), SearchFilter#effective (src/collection/SearchFilter.mjs:64-66), and Collection#splice (src/collection/Base.mjs:1601) in two directions:
- Enabled
filterBy filters without a value (value: null) are ignored:
A Filter configured with filterBy: ({item}) => ... has value: null by default and effective: true. Because f.value !== null is false, TreeStore#filter() drops it from activeFilters, skips soft hydration for its declared fields/property, leaves store.isFiltered() as false and _keptNodes as null, and projects every root/expanded node unfiltered.
- Inert empty-valued filters (
value: '' or value: [] with includeEmptyValues: true) are treated as active:
When a filter's value is cleared to '' (while includeEmptyValues is true), filter.effective is false and the filter keeps every node, yet f.value !== null is true. TreeStore#filter() soft-hydrates #allRecordsMap, allocates _keptNodes, walks the hierarchy, and sets store.isFiltered() to true (causing subsequent TreeStore#splice calls to re-run me.filter()).
Design authority: src/collection/Filter.mjs (Filter#effective and #decide, landed in #19792 / #19796) and src/collection/Base.mjs:1601 (Collection#splice hasEffectiveFilters). Promoted from @neo-opus-grace's defect-note (MESSAGE:abbaaaa0-789b-457c-9ef0-5c1b7fa6ebd6).
Acceptance Criteria
Problem
In
Neo.data.TreeStore#filter()(src/data/TreeStore.mjs:612), active filters are selected with the pre-Filter#effectiverule from#9331/#9438:const activeFilters = me.filters.filter(f => !f.disabled && f.value !== null);This diverges from
Filter#effective(src/collection/Filter.mjs:115-118),SearchFilter#effective(src/collection/SearchFilter.mjs:64-66), andCollection#splice(src/collection/Base.mjs:1601) in two directions:filterByfilters without avalue(value: null) are ignored: AFilterconfigured withfilterBy: ({item}) => ...hasvalue: nullby default andeffective: true. Becausef.value !== nullisfalse,TreeStore#filter()drops it fromactiveFilters, skips soft hydration for its declaredfields/property, leavesstore.isFiltered()asfalseand_keptNodesasnull, and projects every root/expanded node unfiltered.value: ''orvalue: []withincludeEmptyValues: true) are treated as active: When a filter's value is cleared to''(whileincludeEmptyValuesistrue),filter.effectiveisfalseand the filter keeps every node, yetf.value !== nullistrue.TreeStore#filter()soft-hydrates#allRecordsMap, allocates_keptNodes, walks the hierarchy, and setsstore.isFiltered()totrue(causing subsequentTreeStore#splicecalls to re-runme.filter()).Design authority:
src/collection/Filter.mjs(Filter#effectiveand#decide, landed in #19792 / #19796) andsrc/collection/Base.mjs:1601(Collection#splicehasEffectiveFilters). Promoted from@neo-opus-grace's defect-note (MESSAGE:abbaaaa0-789b-457c-9ef0-5c1b7fa6ebd6).Acceptance Criteria
TreeStore#filter()selects active filters viaf.effectiveso enabledfilterByfilters withvalue: nullfilter the hierarchy, soft-hydrate declaredfields/propertyin Turbo Mode, and setstore.isFiltered()totrue.f.effectiveisfalse(such asvalue: ''with defaultincludeEmptyValues: true) leavestore.isFiltered()asfalseand_keptNodesasnull.test/playwright/unit/data/TreeStore.spec.mjscover bothfilterBywithout avalue(including ancestor preservation and Turbo Mode soft hydration) and clearing a filter to''.