On desktop, the toolbar's Clear navigated to the bare /, dropping the search along with the filters. The results page turned back into the home page. The expected behaviour is to remove the filters and stay on the same search.
Change
Desktop Clear now uses the same handler as the phone's Clear all: it clears phase, school type, faith, local authority, gender, sixth form and admissions, and keeps the search, postcode and distance.
It is shown only once a filter is applied (it used to appear for a bare search, where it now has nothing to clear).
It is relabelled Clear all, to match the phone.
The old go-home handler and its hasActiveFilters are removed; nothing else used them.
Testing
Jest: two new cases in ResultsToolbar.test.tsx (clears filters but keeps postcode and radius; not offered for a bare search). 571/571, typecheck clean.
E2E: new journey "Clear all removes the filters and keeps the search" (desktop). Against current staging it fails as expected: the button there is still named "Clear". It can only pass after merge.
## Problem
On desktop, the toolbar's **Clear** navigated to the bare `/`, dropping the search along with the filters. The results page turned back into the home page. The expected behaviour is to remove the filters and stay on the same search.
## Change
- Desktop **Clear** now uses the same handler as the phone's **Clear all**: it clears phase, school type, faith, local authority, gender, sixth form and admissions, and **keeps the search, postcode and distance**.
- It is shown only once a filter is applied (it used to appear for a bare search, where it now has nothing to clear).
- It is relabelled **Clear all**, to match the phone.
- The old go-home handler and its `hasActiveFilters` are removed; nothing else used them.
## Testing
- Jest: two new cases in `ResultsToolbar.test.tsx` (clears filters but keeps `postcode` and `radius`; not offered for a bare search). 571/571, typecheck clean.
- E2E: new journey **"Clear all removes the filters and keeps the search"** (desktop). Against current staging it fails as expected: the button there is still named "Clear". It can only pass after merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The desktop toolbar's Clear went to the bare home URL, dropping the
search along with the filters, so it landed on the home page instead of
the unfiltered results. It now clears every filter and keeps the search,
postcode and distance, as the phone's Clear all already did. It is
offered only once a filter is applied, since with only a search there is
nothing for it to clear, and is labelled Clear all to match the phone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Desktop 'Clear all' now clears only the filters through the existing handleClearFilterValues. It keeps the search and its distance instead of pushing the bare pathname, which sent users to the home page. It also drops the old hasActiveFilters/handleClearFilters code and adds unit and e2e tests. The change is small and looks healthy, and I found nothing that would break production.
🟡 Minor
e2e/tests/journeys.spec.ts: The new 'Clear all' test was inserted between the existing doc comment ('School type offers six groups... Data-invariant...') and the test that comment describes ('school type groups and the faith filter...'). The doc comment is now detached from its test and appears to describe the Clear all test. Move the new test above that comment block.
nextjs-app/components/FilterBar.tsx: The desktop button no longer appears when only a search or postcode is applied, because it is now gated on appliedCount > 0. Desktop users therefore have no one-click way to reset a search and return home. This is probably intended, but it is a behaviour change. The button label also changed from 'Clear' to 'Clear all', so check that other tests or e2e selectors don't still match the old name.
## 🤖 AI Code Review (Claude Code)
Desktop 'Clear all' now clears only the filters through the existing handleClearFilterValues. It keeps the search and its distance instead of pushing the bare pathname, which sent users to the home page. It also drops the old hasActiveFilters/handleClearFilters code and adds unit and e2e tests. The change is small and looks healthy, and I found nothing that would break production.
### 🟡 Minor
- **e2e/tests/journeys.spec.ts**: The new 'Clear all' test was inserted between the existing doc comment ('School type offers six groups... Data-invariant...') and the test that comment describes ('school type groups and the faith filter...'). The doc comment is now detached from its test and appears to describe the Clear all test. Move the new test above that comment block.
- **nextjs-app/components/FilterBar.tsx**: The desktop button no longer appears when only a search or postcode is applied, because it is now gated on appliedCount > 0. Desktop users therefore have no one-click way to reset a search and return home. This is probably intended, but it is a behaviour change. The button label also changed from 'Clear' to 'Clear all', so check that other tests or e2e selectors don't still match the old name.
tudor
merged commit 9b765125ad into main2026-10-02 15:50:22 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
On desktop, the toolbar's Clear navigated to the bare
/, dropping the search along with the filters. The results page turned back into the home page. The expected behaviour is to remove the filters and stay on the same search.Change
hasActiveFiltersare removed; nothing else used them.Testing
ResultsToolbar.test.tsx(clears filters but keepspostcodeandradius; not offered for a bare search). 571/571, typecheck clean.🤖 Generated with Claude Code
🤖 AI Code Review (Claude Code)
Desktop 'Clear all' now clears only the filters through the existing handleClearFilterValues. It keeps the search and its distance instead of pushing the bare pathname, which sent users to the home page. It also drops the old hasActiveFilters/handleClearFilters code and adds unit and e2e tests. The change is small and looks healthy, and I found nothing that would break production.
🟡 Minor