-
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
Add toggle for filters on mobile UI #123
Conversation
Pull Request Test Coverage Report for Build 8146694535Details
💛 - Coveralls |
ef0766e
to
c74f1df
Compare
c74f1df
to
8714317
Compare
** Why are these changes being introduced: * The result filters are awkward on a mobile display, and may only be needed for some users. Rather than having them display by default, and take up space that is very precious, we want to only show a UI control to expose them when needed. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/gdt-174 ** How does this address that need: * This adds a button above the filters panel markup, and adds a few classes to the existing markup at the top of the filters panel. * With CSS, we hide the filters panel on the smallest screens using a new hidden-sm class. This class is then toggled via javascript when the user clicks on the UI button. * The javascript is part of a new file - app/javascript/filters.js - which is loaded by the filters partial. ** Document any side effects to this change: * I'm not sure where best to add the .hidden-sm class to this codebase. For now I'm adding it to a new _layouts module. * During initial testing, it feels awkward to have competing scroll bars in the filter UI by imposing a maximum height on the panels. Because the user has now chosen explicitly to show the filters, it feels better to just have them take up the space they need, rather than making the user navigate overlapping scroll bars on a linear display. So this overrides the maximum filter panel height.
8714317
to
c570cd3
Compare
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.
Now that we have a layouts
partial, I wonder if we should move these rules to it? If you agree, I can make that change amid another change or two that Darcy has requested to the 'Ask Us' panel.
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.
Sorry for the rescinded review. The code looks good, but we actually want this to break at 768px. See the 'results page' section of the UI details doc.
Adam rightly pointed out that the mockups in this ticket called for the mobile filter behavior to kick in at the medium screen size (below 768), not small (below 480). This swaps the change over to that screen size, replacing -sm with -md as needed.
Thanks for catching the needed break point - I've pushed a commit to make this all take effect at the medium screen size, not small. As for whether we move those other rules into |
Why are these changes being introduced:
The result filters are awkward on a mobile display, and may only be
needed for some users. Rather than having them display by default,
and take up space that is very precious, we want to only show a UI
control to expose them when needed.
Relevant ticket(s):
https://mitlibraries.atlassian.net/browse/gdt-174
How does this address that need:
This adds a button above the filters panel markup, and adds a few
classes to the existing markup at the top of the filters panel.
With CSS, we hide the filters panel on the smallest screens using a
new hidden-sm class. This class is then toggled via javascript when
the user clicks on the UI button.
The javascript is part of a new file -
app/javascript/filters.js
-which is loaded by the filters partial.
Document any side effects to this change:
I'm not sure where best to add the .hidden-sm class to this codebase.
For now I'm adding it to a new _layouts module.
During initial testing, it feels awkward to have competing scroll
bars in the filter UI by imposing a maximum height on the panels.
Because the user has now chosen explicitly to show the filters, it
feels better to just have them take up the space they need, rather
than making the user navigate overlapping scroll bars on a linear
display. So this overrides the maximum filter panel height.
Developer
Env
A11y
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)
Stakeholder
Requires database migrations?
NO
Includes new or updated dependencies?
NO
Code Reviewer
(not just this pull request message)