[Bug] Auto-extended filter range does not apply existing criteria to newly entered rows
Before you submit this issue, have you checked the following options?
- Is this really a problem?
- I have searched the GitHub Issues for similar issues, but did not find anything.
Affected packages and versions
@univerjs/sheets-filter on dev at cfb245a2f9f2e1b8a7cac1b17b76b794cbb96460.
Reproduction link
The existing controller test fixture initializes a filter on rows 3–5 with blank: true on column 0. Using that fixture:
- Execute
SetRangeValuesMutationwith{ unitId: 'test', subUnitId: 'sheet1', cellValue: { 6: { 0: { v: 'test' } } } }. - Inspect
sheetsFilterService.getFilterModel('test', 'sheet1'). - Compare
getRange().endRowandfilteredOutRows.has(6).
This exercises the same auto-extension code path used when a nonblank value is entered immediately below an existing filter range. The reproduction above uses the repository test harness.
Expected behavior
The filter range extends to row 6 and applies its existing criterion immediately. filteredOutRows.has(6) should be true, so the nonmatching row is hidden.
Actual behavior
The range extends to row 6, but filteredOutRows.has(6) remains false. A regression assertion added to the controller test fails on the unmodified commit with expected false to be true. The auto-extension handler calls FilterModel.setRange() without executing the registered recalculation mutation.
Related work
#1936 concerns the selection used when a filter is first created. This happens when an existing filter grows after a cell edit. #7673 changed filter mutation and formula-service behavior, but did not change this auto-extension controller path.
System information
Reproduced in the repository's Vitest harness on Windows with Node v24.11.1 and pnpm 11.19.0; no browser is required for the test reproduction.
Source: dream-num/univer