Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Request path contains unescaped characters
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Used NextJs React CSS Grid , FlexBox, Mobile-first workflow

#next#react#sass/scss
Achref KS 530

@AchrefFast

Desktop design screenshot for the Interactive comments section coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi everyone,

I would appreciate any feedback you can offer.

Thanks.

Community feedback

@pikapikamart

Posted

Hey, really nice work on this one. Overall, the layout for both desktop and mobile state looks really great. The reply also works great as well the upvote and downvote.

For some suggestions, here are some:

  • If you try to click the first upvote of the first comment, you can't point to it , I think it is because of the h1 being sr-hidden. You can add clip: rect(0 0 0 0); on the h1 to fix it.
  • For each of the upvote and downvote, currently it doesn't have any informative text inside it and + or - alone is not enough. What you can do is that, add an sr-only text inside it to which could be downvote comment and upvote comment, depends on where it is placed.
  • Also, I would suggest changing the html placement for each of the post. The post's body should be placed before the ratings so that when a user navigates on the component, they will traverse the user, the user's post before the rating. Because it would be confusing to first traverse the upvotes/downvotes when the content is not first reviewed by the user.
  • Adding an aria-live attribute on the element wrapping the counts so that assistive tech will announce the update to the user on what happened. You can add extra text if you want, an sr-only text. Also, you could change the span to just p tag.
  • For each of the person's img, since their name is already present, it would great to use their name as the alt value since it makes sense to do so.
  • Actually, if this were a real app, each person would be a hyperlink right. Maybe making them wrapped inside a tag? Each person's img and name. Could be right.
  • Whenever you wrap a text, always use meaningful elements and not div. Changing all those div that wraps a text should be replaced by p tag.
  • For the reply button, the arrow-svg should have an aria-hidden="true" attribute on it since it is only a decorative image.
  • Again for the reply button, adding aria-expanded attribute would make it more accessible. This way, when a user toggles it, assistive tech will inform the user that it shows or expanding something.
  • For the reply form, using the user's name on the user's avatar alt attribute would be nice.
  • Adding label for the textarea would be great. Remember to always add label for each input or textarea element. This way, when a user is using a different language, those label text will be changed as well since attribute's data is static, the placeholder won't be translated. The label will be sr-only on this one.
  • There is a confusing part on the textarea. Initially, it should be empty right because a user is still not typing anything, but since you are already adding the @_name on field, a user can press the reply to send that reply even if they haven't add anything on the textarea and it will be much confusing since it is using required and to be honest, I can't think of an approach on this one, so maybe just letting you know about this? :>>
  • When clicking now either the reply or cancel button it would be nice again to have an aria-live element or maybe you can add a toast-notification on this one. The toast's text-content will vary on the user's choice, it could be like successfully replied to {person's name} or could be like reply cancelled. Just remember to add an aria-live="polite" on the element so that it will be announced.
  • When toggling the delete button, it would be nice to set the focus to the modal. This way, user will immediately be informed on what is the content. Right now, if you use keyboard to toggle the delete, then tab again, the user won't traversed on the modal like what it should do. So when a user toggles the delete, add the aria-expanded attribute then shift the focus in the modal, so that if they tab again, they will tab inside the modal. Another feature to add as well is to have a trap focus inside the modal. Meaning they can only tab on the two options, this way the user won't be confused on where they are at now.
  • To be honest, there are lots of added aria-live on this one or some toast, for the successfully deleting a reply and adding a comment as well.

Just in general, if there are lots of state in your app that requires to send an update to the user, an aria-live would be nice or sometimes changing the focus on the pop-up element is really nice.

Aside from those, great job again on this one.

Marked as helpful

1

Achref KS 530

@AchrefFast

Posted

@pikapikamart

Hi Raymart. Thank you so much for taking the time to provide me with such detailed feedback. I sincerely appreciate your help.

I tried to fix all the points that you mentioned in your reply, which most of them was new to me, and that really helped me a lot to look into new terms and features I didn't know about before, so thanks again.

For the Web Content Accessibility (WAI-ARIA), I couldn't find a good resources that can help me improve my understanding of these concepts well enough. Can you please give some advise where I can look.

Finally, I would be really happy if you can get another look at my solution (if you have time, of course).

Thank you again 😊😊😊🙏‍🙏‍🙏‍.

1

@pikapikamart

Posted

@AchrefFast Hey, glad that you find it useful^^

Actually, I don't have a specific resource about web accessibility, I just kind of search what I need. For example, on what I suggested about aria-live, you can go mdn or just search something like aria-live mdn or you can go into w3org. Both of these sites are really really great, especially w3org since it is the advocator or go to when checking about accessibility. Have a go on either on this one.

Also, sure! But maybe this lunch time on my end, morning coding should be first right :>> But looking forwards on the site again!

Marked as helpful

1
Achref KS 530

@AchrefFast

Posted

@pikapikamart Hi raymart, thank you for your suggestion. I will make sure to take a look at both sites.

Thanks 😃.

1

@pikapikamart

Posted

@AchrefFast Hey, I just reviewed again the site and it still looks great as before and great job on implementing those other suggestions I mentioned before!

Seeing again, I missed some little things:

  • For each user's images, the word avatar could be removed since it is already an image. When using alt you don't need to add words that relates to graphic like avatar, icon, image....
  • Some text needs to be inside a meaningful element, currently, the div still contains some text and needs to be changed into p tag.
  • For each of the upvotes/downvotes p tag, you don't need to add role="region" on them, making them so will add extra navigation on assistive tech when traversing landmark elements. Removing those will be really nice. You only want to use role="region" to sections of the page where you want to highlight it.
  • Your textarea is missing the id attribute, you should change the for into an id on that one. Yeah, the add comment textarea and each of the reply textarea are using for instead of id.
  • I see that you changed the reply textarea to not submit the data when the user hasn't type any value. Neat! Though currently, when submitting an empty form, the error is only seen visually by adding that red border right. What you can do to improve is that, you can add another aria-live element that will announce if the form submission is invalid. For example:
if ( form is invalid ):
  reply1Region.textContent = "Error. Please add text to the comment field";
  reply1Textarea.setAttribute("aria-invalid", "true");

if ( form is valid ):
  reply1Textarea.removeAttribute("aria-invalid");

In general, when using an aria-live element, in order for it work is that the element should already be present inside the dom. Changing the text-content of the aria-live element will make it be announced by assistive tech, but if the element is not already present in the dom, and you just showed it with it's text content, even if it has the aria-live attribute, assistive tech won't announced it.

So for the each of the toast-notification, the element that is using the aria-live should be present initially. Then you just changed the text-content of that, but do not remove it from the dom, just hide it visually^^

I think that's about it:>>

Marked as helpful

1
Achref KS 530

@AchrefFast

Posted

@pikapikamart Hey Raymart, thank you again for your precious suggestions .

Dealing with these different "ARIA" concepts that you mentioned helped me get a good idea about how important and crucial accessibility is in a website, and I think working on them while building the website is the right way to go, because trying to add them afterward is kind of frustrating and things can get too complicated.

I think I manged to fix all the points that you addressed, so thank you again for taking the time to look into my solution. I appreciate the help so much.

Many thanks 😊.

1

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord