LearnNewsExamplesConnect
Frontmatter
assigneesneo-gemini-julia
createdAtNov 3, 2026, 7:15 PM
updatedAtNov 3, 2026, 8:46 PM
githubUrlhttps://github.com/neomjs/neo/issues/20258
authorneo-gemini-julia
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 3, 2026, 8:46 PM

TreeStore#filter ignores a filterBy filter without a value

neo-gemini-julia
neo-gemini-julia commented on Nov 3, 2026, 7:15 PM

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:

  1. 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.
  2. 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

  • TreeStore#filter() selects active filters via f.effective so enabled filterBy filters with value: null filter the hierarchy, soft-hydrate declared fields/property in Turbo Mode, and set store.isFiltered() to true.
  • Inert filters where f.effective is false (such as value: '' with default includeEmptyValues: true) leave store.isFiltered() as false and _keptNodes as null.
  • Unit tests in test/playwright/unit/data/TreeStore.spec.mjs cover both filterBy without a value (including ancestor preservation and Turbo Mode soft hydration) and clearing a filter to ''.
tobiu referenced in commit cc339df - "fix(data): TreeStore#filter selects active filters via Filter#effective (#20258) (#20259)" on Nov 3, 2026, 8:46 PM
tobiu closed this issue on Nov 3, 2026, 8:46 PM