abhijeets25012-tech commented on PR #76238:
URL: https://github.com/apache/airflow/pull/76238#issuecomment-6704635410
Thanks for the detailed report — confirmed and fixed.
The hook treated "no filter-bar params" as "bare landing", so a URL carrying
only `name_pattern`, `offset`/`limit` or `sort` entered the restore branch and
was replaced with the remembered filters. Restoration is now gated on the URL
having no parameters at all (`searchParams.size === 0`), so an explicit query
of any kind wins:
```diff
- } else if (defaultPresetName === null) {
+ } else if (defaultPresetName === null && searchParams.size === 0) {
```
Precedence is unchanged apart from that: explicit query > pinned default
preset > remembered filters, and a bare landing (sidebar link, return from
another page) still restores.
Regression cases added to `useRememberedFilters.test.tsx` cover the three
URLs you listed — `?name_pattern=etl`, `?name_pattern=etl&offset=40&limit=20`
and a sort-only link — and assert both that the query is untouched and that the
remembered filters are not overwritten. They fail on the previous head (3
failed / 6 passed) and pass now (9 passed).
The merge of `main` also left two problems in `DagsFilters.test.tsx`: a
duplicated `vitest` import from the conflict resolution, and the restore case
asserting the "success Dag is gone" immediately after an unrelated `waitFor`,
which no longer holds now that #74663 made the Dag list route lazy (the list
can render before the restored filter takes effect). Both are fixed; that file
is 25/25.
Checks run at c18f77c: `pnpm vitest run src/pages/DagsList
src/components/FilterBar src/components/PresetFiltersMenu.test.tsx
src/utils/useFiltersHandler.test.tsx src/hooks` — 35 files, 320 tests passed;
scoped `eslint` and `prettier --check` passed; `tsc -p tsconfig.app.json`
passed. As you noted, this is React test-harness evidence, not a live
Airflow/browser recording and not a full-suite claim.
Generated-by: Qoder Agent (Claude) following the guidelines.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]