LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtOct 20, 2026, 1:21 PM
updatedAtOct 20, 2026, 2:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/19904
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 20, 2026, 2:05 PM

Changing a filter drops the active sort, while the header still shows it

neo-opus-ada
neo-opus-ada commented on Oct 20, 2026, 1:21 PM

Context

Found in team:engine release testing, 2026-10-20. A read-only headless sweep reproduced it 2/2 in four examples, and I reproduced it directly in examples/grid/animatedRowSorting (headless Chrome, dev server). The steps: type a in the Firstname field (7 rows, insertion order), then click the Firstname header, which sorts them ascending. Refining the field to am then gives Sam, William, Amanda instead of Amanda, Sam, William. Clearing the field brings back insertion order. Through all of it the header keeps its ascending arrow and store.sorters is unchanged.

The sweep saw the same in examples/grid/issues (search, sort Opened, refine the search), examples/tableFiltering and examples/grid/contentSizedRows. 13.3's header menus and search make this path routine: sort a column, then narrow by menu or search.

The Problem

Once a filter is active, every later filter change returns the rows in the order they had when the collection was first filtered, not in sorter order. A filter whose value is null still counts as active, so clearing a field does not restore the sort either.

The Architectural Reality

  • src/collection/Base.mjs#filter: the branch for no active filters re-applies the sorters (needsSorting = true → me.doSort(me.items, true)). The branch for active filters rebuilds _items from evaluateFilters() and does not.
  • evaluateFilters() walks this.allItems?._items. allItems is created from _items on the first filter, and doSort() sorts only _items, so allItems keeps its creation-time order from then on.
  • 13.2.0 has the same filter() shape (it also iterates allItems._items), so this is not a 13.3 regression.
  • Design authority: filter() itself, which re-applies the sorters on its no-filter branch. That makes "the filtered items follow the sorters" the method's own contract, and the active-filter branch breaks it. Also the Collections guide's Sorting Data: "Neo.collection.Sorter instances are used to sort the items within a collection."

The Fix

In filter(), re-apply the active sorters after either branch, whenever the collection has sorters. Keep remote sorting and filterMode: 'primitive' behaving as they do today.

Acceptance Criteria

  • AC-1 (unit): a sorted collection with an active filter keeps sorter order when the filter's value changes, and when it is cleared to null.
  • AC-2 (unit): without sorters, filtering keeps today's order.
  • AC-3 (e2e): in examples/grid/animatedRowSorting, filter a, sort Firstname, refine to am: the rows read Amanda, Sam, William. The case fails on dev and passes with the fix.
  • AC-4: the collection, store and grid unit suites stay green.

Out of Scope

  • Keeping allItems itself in sorter order. Re-sorting the filtered result is enough here.
  • Remote sorting and filtering.

Related

  • #19669 / #19673 (the column filters that use evaluateFilters), and the 13.3 header-menu and search chapters (#19712).

Live latest-open sweep: checked the latest open issues at 2026-10-20T11:21Z, plus open-issue searches for "filter sort order lost", "sort after filter" and "refilter sorted": no equivalent. MC sweep: no prior decision. Own-assignment sweep: none overlapping.

Origin Session ID: ad84dc14-8baf-4f95-a7dd-a9e224f51c31 Retrieval Hint: "collection filter evaluateFilters allItems drops sort order"

tobiu referenced in commit 7605559 - "fix(collection): a filter change keeps the active sort (#19904) (#19907) on Oct 20, 2026, 2:05 PM
tobiu closed this issue on Oct 20, 2026, 2:05 PM