-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fixed Reading List on Mobile + Small Improvements #12755
Fixed Reading List on Mobile + Small Improvements #12755
Conversation
I've scrapped some component tests that existed for this and will write some end to end tests instead. |
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.
I know it's a Draft PR but you added me as reviewers so here I am :D
-
Desktop UI regression. This one is IMO a blocker - afair we didn't want to replace sidebar nav with
select
field everywhere but only on smaller breakpoint(s). Bigger breakpoints should keep the left sidebar. This is similar to what we do on notifications and settings and that's likely the pattern we want to keep elsewhere.
-
Going back to main view - blocker as well. When I choose a tag I can no longer go back to "main" view of Reading list - without any tag selected. That should probably be its own option in the select like "Everything" or something..
-
a11y issue - blocker too. When I use keyboard to choose a tag in this select, then hit
Shift + Tab
to go to previous field (search field), the filtering is being reset:Nagranie.z.ekranu.2021-02-22.o.09.24.50.mov
It's probably because search field, even if empty, is running a call and returns results matching the query (query is empty so it return everything). In other words, we should probably limit search field to only search through current view (selectedTag).
Not a blocker but something to think about in future is being able to reflect the current filter with URL. In other words, when you change the filtering we could update the browser's URL too to dev.to/readinglist/javascript
. I'm aware it's something we don't have right now so there's no expectation to build it :D But you know, just something to keep in back of our heads.
import { ItemListItem } from './components/ItemListItem'; | ||
import { ItemListItemArchiveButton } from './components/ItemListItemArchiveButton'; |
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.
We should at some point look into components names: ItemListItem
is probably not very descriptive...
onBlur={(event) => { | ||
// We need blur for a11y, but we also don't want to make the same search query twice | ||
// if the tag hasn't changed since the previous onChange. | ||
const { value } = event.target; | ||
|
||
if (value === selectedTag) { | ||
return; | ||
} | ||
|
||
onSelectTag(event); | ||
}} |
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.
Can you help me understand what does it do? I couldn't notice any difference when I removed this part of code.
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.
^ I bump this question.
@ludwiczakpawel, I must have misread the comment about select. I thought we wanted it for desktop as well. I'll look at the other issues as well you mentioned. In regards to keeping the filter in the URL, I completely agree, but that should be a separate PR a that changes how the entire state is managed for this component. |
@nickytonline just to make sure I'm not making things up right now :D:
^ that's also being mentioned in other comments in the same issue. |
@ludwiczakpawel, @lisasy I've reworked this. The sidebar remains until we hit the smallest breakpoint. I took some liberties from some minor spacing changes, so let me know what you think. @aitchiss, I also reworked the side bar to be a group of checkboxes even though visually it looks the same. It helps with the keyboard nav and voice over. Here is the loom video, https://www.loom.com/share/c78e3427cfdf4b5ba01506ddd01ace32 Tests are still broken, but I will sort that out. |
I'm putting this on hold after I'm back as I'm looking into a higher priority issue in tegards to service workers, but if you can take this for a test drive @lisasy, @ludwiczakpawel, and @aitchiss, it'd be much appreciated. The only blocker for this PR at the moment is tests. |
As mentioned, I'll resume this when I'm back from my time off, but I put up some e2e tests @aitchiss. I discovered that Cypress is not evaluating |
@nickytonline just turn it to "Ready for review" when ready :) |
I can't seem to review this PR on my local dev, so my feedback is based on the video in the description. On the smallest breakpoint, there ought to be appropriate margin around the heading, search input, dropdown, and button so that these components aren't touching the edges of the device. |
That seems to be the way the crayon layout class works, but I can definitely add margin. Also, those videos are out of date as that was my initial pass. I'll be posting updated videos shortly and will pull this out of draft mode. |
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.
Checked this locally on desktop and android mobile and all looking good - I just have some v minor change requests/suggestions 🙂
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.
NICE!
Co-authored-by: Suzanne Aitchison <[email protected]>
…fix-reading-list-view-on-mobile
I also tested this in iOS 14.4.2 and all looks good. |
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.
Nice! 🚀
Details
What type of PR is this? (check all applicable)
Description
Implements changes proposed in #11983. One notable change is that we only filter by one tag at a time now.
Before
Mar-09-2021.15-48-54.mp4
After
Mar-31-2021.19-34-29.mp4
Related Tickets & Documents
Closes #11983
QA Instructions, Screenshots, Recordings
The reading list section should still be able to archive and unarchive reading list items.
Archiving
Unarchiving
Filtering
Filtering the Reading List
Filtering the Archive
To test the same functionality in the archived view:
UI accessibility concerns?
I fixed the markup so that everything is contained within the
<main />
landmark now. There is a colour contrast issue with the<select />
being reported, but this is not related to the work in the PR. This appears to be more of a global issue with<select />
s. cc: @ludwiczakpawel@aitchiss, the fieldset on the left when on the medium breakpoint and up is now a group of radio buttons since we only allow for filtering on one tag now. The keyboard navigation appears to be working well as is Voice Over, but please take it for a spin to see if there are any gaps in the work there.
Added tests?
have not been included
[Forem core team only] How will this change be communicated?
Will this PR introduce a change that impacts Forem members or creators, the
development process, or any of our internal teams? If so, please note how you
will share this change with the people who need to know about it.
Admin Guide, or
Storybook (for Crayons components)
or in a forem.dev post
replace this line with details on why this change doesn't need to be
shared
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?