-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Specifically: * Clean up results summary in filter header, as requested by Jeremy. * Fix scrollbar overlapping with content, as requested by Jeremy * The first filter menu in the list should always remain open, as requested by Darcy. * CSS changes for applied filters, as requested by Darcy (black, not bolded, add 'x' icon). * Move filters container above results. This was not specifically requested by anyone, but it makes keyboard navigation more reasonable and will be needed when we add styling for smaller viewports. Not addressed in this commit: * Darcy expressed usability concerns about the scroll boxes on mobile. I tested them on my phone and didn't find them to be difficult to use, so I'm leaving them in for now. They also seem to be navigable by keyboard and screen reader. * One potential a11y issue is having to navigate through a bunch of filter opens before getting to the next category. I can discuss this with Darcy in QA, unless the code reviewer has a strong opinion. * If keyboard nav does feel onerous, an alternative solution is to hide the bulk of filter options behind a 'See all' link. * Darcy has requested that we persist menu state between page loads. In other words, if a filter drop-down menu is open, it should remain open until a user manually closes it, even if they have deselected all filters in that group. I think this is complex enough to warrant a separate ticket. (I've spent the better part of today experimenting with Turbolinks and Stimulus, both of which should be able to achieve this, but I haven't been able to achieve the desired results.)
- Loading branch information
Showing
5 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module ResultsHelper | ||
def results_summary(hits) | ||
hits.to_i >= 10000 ? '10,000+ items' : "#{number_with_delimiter(hits)} items" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'test_helper' | ||
|
||
class ResultsHelperTest < ActionView::TestCase | ||
include ResultsHelper | ||
|
||
test 'if number of hits is equal to 10,000, results summary returns "10,000+"' do | ||
hits = 10000 | ||
assert_equal '10,000+ items', results_summary(hits) | ||
end | ||
|
||
test 'if number of hits is above 10,000, results summary returns "10,000+"' do | ||
hits = 10500 | ||
assert_equal '10,000+ items', results_summary(hits) | ||
end | ||
|
||
test 'if number of hits is below 10,000, results summary returns actual number of results' do | ||
hits = 9000 | ||
assert_equal '9,000 items', results_summary(hits) | ||
end | ||
end |