Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Search tips" message when there are no location search results #3180

Merged
merged 2 commits into from Sep 28, 2020

Conversation

zarino
Copy link
Member

@zarino zarino commented Sep 15, 2020

Improvements to the message you get when your location search returns no results (usually because you’ve made a spelling mistake, or have used too ambiguous a street name), on fixmystreet.com and the UK council cobrands.

Screenshot_2020-09-21 Screenshot(1)

I’ve included a customised version for each cobrand, to match the layout of their respective homepages, eg:

Screenshot_2020-09-21 Screenshot(2)

The easiest way to test this out locally is to force all location searches to return as if there had been no results, eg, by updating the determine_location_from_pc function in Location.pm so that it returns early like this:

sub determine_location_from_pc : Private {
    my ( $self, $c, $pc ) = @_;

    # temporary redirect for testing out the "search tips" message
    $c->stash->{location_error_pc_lookup} = 1;
    $c->stash->{location_error} = 'Sorry, we could not find that location.';
    return;

@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #3180 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3180   +/-   ##
=======================================
  Coverage   83.66%   83.66%           
=======================================
  Files         251      251           
  Lines       15744    15745    +1     
  Branches     2942     2942           
=======================================
+ Hits        13172    13173    +1     
  Misses       1639     1639           
  Partials      933      933           
Impacted Files Coverage Δ
perllib/FixMyStreet/TestMech.pm 93.09% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6aece0d...486ccea. Read the comment docs.

@zarino zarino force-pushed the 1663-more-helpful-no-results-page branch from 6ef1cad to d27204f Compare September 21, 2020 14:39
@zarino zarino requested a review from dracos September 21, 2020 16:31
@zarino zarino marked this pull request as ready for review September 21, 2020 16:31
@zarino zarino changed the title [WIP] "Search tips" message when there are no location search results "Search tips" message when there are no location search results Sep 21, 2020
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; couple of tiny suggested changes.

CHANGELOG.md Outdated Show resolved Hide resolved
web/cobrands/zurich/_colours.scss Outdated Show resolved Hide resolved
templates/web/fixmystreet.com/around/location_error.html Outdated Show resolved Hide resolved
@zarino zarino force-pushed the 1663-more-helpful-no-results-page branch from f00abe5 to 486ccea Compare September 25, 2020 09:00
@zarino zarino requested a review from dracos September 25, 2020 09:17
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩

UK cobrands now display UK-specific postcode/address search tips, when
the geocoder returns no results. This should hopefully help people
tweak their search, to return a better result next time.

The tips are based on findings from a study we ran on geocoder misses
across all UK cobrands over March, April, May, and June 2020.
The "error" output in our new `.search-help__header` element begins and
ends with whitespace. The test really shouldn’t care about whitespace
at the start and end of HTML tags, so this commit makes page_errors
trim whitespace from the errors it passes to the tests.

Also adds `.search-help__header` as a location to find page errors!
@zarino zarino force-pushed the 1663-more-helpful-no-results-page branch from 486ccea to f63e2fe Compare September 28, 2020 11:00
@zarino zarino merged commit f63e2fe into master Sep 28, 2020
@github-pages github-pages bot temporarily deployed to github-pages September 28, 2020 11:24 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants