fix(search): address review on the results toolbar
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m12s
PR Checks / Backend Smoke (pull_request) Successful in 9s
PR Checks / Build Backend (no push) (pull_request) Successful in 33s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m19s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 1m17s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 21s
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m12s
PR Checks / Backend Smoke (pull_request) Successful in 9s
PR Checks / Build Backend (no push) (pull_request) Successful in 33s
PR Checks / Build Frontend (no push) (pull_request) Successful in 1m19s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 1m17s
PR Checks / AI Code Review (Claude) (pull_request) Successful in 21s
- Refold the phone search, and resync its text, when the query changes without a submit (back/forward, "Use my location"). The summary and the unfolded input could otherwise describe two different searches. - Cap the "More filters" panel at every width, not only on phones, so an open panel scrolls inside the pinned toolbar on a short screen. - Drop the phone filter row's right-edge fade once it is scrolled to the end or does not overflow (the MOBILE.md pattern), and give focus rings room inside the scroll clip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
983a581555
commit
367a07c15d
3 files changed
+76
-13
No files matched your search
@@ -102,6 +102,14 @@ describe('the toolbar filters', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('the phone filter row', () => {
|
||||
it('drops its "more this way" fade when nothing is left to scroll', () => {
|
||||
render(<FilterBar filters={filters} />);
|
||||
// jsdom lays nothing out, so the row reads as not overflowing at all.
|
||||
expect(screen.getByRole('group', { name: 'Filters' }).className).toMatch(/controlsAtEnd/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('the folded search', () => {
|
||||
it('summarises the search and unfolds on tap', () => {
|
||||
render(<FilterBar filters={filters} />);
|
||||
@@ -119,6 +127,22 @@ describe('the folded search', () => {
|
||||
expect(screen.getByRole('button', { name: /Edit search/ })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('refolds and shows the new text when the search changes some other way', () => {
|
||||
const view = render(<FilterBar filters={filters} />);
|
||||
fireEvent.click(screen.getByRole('button', { name: /Edit search/ }));
|
||||
fireEvent.change(screen.getByRole('searchbox', { name: 'School name or postcode' }),
|
||||
{ target: { value: 'half-typed' } });
|
||||
|
||||
// Back button: the URL changes under the component, nothing is submitted.
|
||||
params = new URLSearchParams('postcode=SW170AA&radius=3');
|
||||
view.rerender(<FilterBar filters={filters} />);
|
||||
|
||||
expect(screen.getByRole('button', { name: 'Edit search: SW170AA, within 3 miles' }))
|
||||
.toBeInTheDocument();
|
||||
expect(screen.getByRole('searchbox', { name: 'School name or postcode' }))
|
||||
.toHaveValue('SW170AA');
|
||||
});
|
||||
|
||||
it('never appears in the hero, or before anything has been searched', () => {
|
||||
const { unmount } = render(<FilterBar filters={filters} isHero />);
|
||||
expect(screen.queryByRole('button', { name: /Edit search/ })).not.toBeInTheDocument();
|
||||
|
||||
Reference in new issue
Block a user