-
Notifications
You must be signed in to change notification settings - Fork 0
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
Redesign filter sidebar #112
Conversation
Pull Request Test Coverage Report for Build 7835391112
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can address the overlapping content before merge that would be great. If that proves hard to track down, I'd be okay with a ticket to loop back on it.
Otherwise this feels like what was requested to me and works with either mouse or keyboard navigation. 👍🏻
<div class="filter-options"> | ||
<ul class="category-terms list-unbulleted"> | ||
<% values.each do |term| %> | ||
<li class="term"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app/views/search/results.html.erb
Outdated
@@ -64,7 +64,8 @@ | |||
<% if @filters.present? %> | |||
<aside class="col1q filter-container"> | |||
<div id="filters"> | |||
<h2>Available filters</h2> | |||
<h2 class="hd-3">Filter your results</h2> | |||
<h3 class="hd-4"><em><%= @pagination[:hits] %> items</em></h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hits value is a bit confusing for larger sets as displayed here.
Search for "organic chemistry" and it displays 10000 items
. It should probably display something something more like 10,000+ items
. I think we should expect TIMDEX API/OpenSearch to report "more than 10000 items" as "10000" and adjust the UI to anticipate that.
If you want to handle that in a separate ticket that is fine with me.
7c01cb1
to
c3cd424
Compare
The latest commit addresses the initial feedback on this, both from this review and from Darcy (I shared it with her in a meeting yesterday afternoon). There are also a couple of things that came up while I was doing some testing related to the code review/QA feedback. More details in the commit message. I opened GDT-173 to meet Darcy's request of preserving menu state between page loads. I experimented with that a fair amount today but couldn't get it to work, and it was taking enough time that I figured a separate ticket was appropriate. |
Why these changes are being introduced: The filter sidebar can become unwieldy, as all available filters are shown at all times. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/GDT-127 * https://mitlibraries.atlassian.net/browse/GDT-173 * https://mitlibraries.atlassian.net/browse/GDT-174 How this addresses that need: This restyles the filter sidebar as dropdown menus. In so doing, it also changes some behavior in the filter logic: * Number of results is listed in the filter sidebar header. * Clicking an applied filter removes that filter (this replaces the previous removal mechanism, which removed all applied filters). * Applied filters are highlighted with an `x` symbol, to indicate that it can be removed on click. (Previously, the 'applied' filter was added, but we hadn't done anything with it.) * The first filter dropdown in the sidebar is always open, even if no filters are applied. Not addressed in this commit: * Darcy asked that we persist menu state between page loads, such that an open menu always remains open unless a user closes it manually (e.g., if all filters have been removed in that category). This proved relatively complex, so I opened GDT-173 to address it. * There are some visual differences in how the sidebar appears in smaller viewports. This is covered in GDT-174. Side effects of this change: * Some tests have been updated to reflect the new logic. * One potential a11y issue with filter categories is having to navigate through a bunch of filter opens before getting to the next category. We might want to add skip-content links if this feels onerous. * The JS for the dropdown menus is so minimal that I included it in the view as a `script` tag. * The filter container is now above the results in the DOM.
c3cd424
to
d965215
Compare
Why these changes are being introduced:
The filter sidebar can become unwieldy, as all available filters are shown at all times.
Relevant ticket(s):
https://mitlibraries.atlassian.net/browse/GDT-127
How this addresses that need:
This restyles the filter sidebar as dropdown menus. In so doing, it also changes some behavior in the filter logic:
Side effects of this change:
script
tag, but I'm happy to load it via Sprockets if that's preferable.Developer
our guide and
all issues introduced by these changes have been resolved or opened as new
issues (link to those issues in the Pull Request details above)
Code Reviewer
(not just this pull request message)
Requires database migrations?
NO
Includes new or updated dependencies?
NO