WordPress / Learn

WordPress.org Learn - The canonical source for the code and content behind https://learn.WordPress.org
274 stars 101 forks source link

UI Best Practices #2411

Closed jonathanbossenger closed 5 months ago

jonathanbossenger commented 6 months ago

Details

Learning Objectives

Related Resources and Other Notes

Automation Code

//lesson

github-actions[bot] commented 5 months ago

Lesson Development Checklist

jonathanbossenger commented 5 months ago

Script: https://github.com/jonathanbossenger/wp-content/blob/main/theme-developer-learning-pathway/07-advanced-theme-development/02-user-interface-best-practices.md

jonathanbossenger commented 5 months ago

Video for review: https://github.com/WordPress/Learn/assets/180629/3f39a751-71cd-4286-8c44-035c5b20007e

rosswintle commented 5 months ago

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

Leave an additional comment below with feedback. You can also share what you liked about this Tutorial.

This is great. Everyone should watch this!!

quitevisible commented 5 months ago

Tutorial/Lessons Review Checklist

Please tick all items you've confirmed:

Leave an additional comment below with feedback. You can also share what you liked about this Tutorial.


@jonathanbossenger I thought this was a good intro to a broad topic. Only a couple bits of feedback for me...

A good reminder of keeping the end user in mind when building sites.

jonathanbossenger commented 5 months ago

@rosswintle thanks for the review

[Optional] At around 2:34 you talk about how links should be underlined, but then all of the footer links above the link you are focussing on are not underlined. Are some kinds of links exempt from this? Should this be explained?

They actually are underlined when you hover over them, because they're all links in the footer menu, vs links in any other content, were it's possible to confuse regular text with a link. So maybe a bad example on my part. I'll re-record that section using a better example.

[Optional, but preferred] I'd like slides to break up the topics. The transition from font-sizes to form field labels at 05:28 is particularly odd, it feels like you haven't changed topic.

Yeah, I was actually thinking about that when I watched the final video, I decided if someone requested I'll add it, so here we are 😁

jonathanbossenger commented 5 months ago

@quitevisible thanks for the review

Are there plans to break this down into 2-3 parts to cover other UI topics like navigation, personas, SEO, and mobile screens?

Not at the moment, but I could certainly see how this would be useful.

During the process of creating the lessons in this pathway, @cynthianorman and I have already discussed a possible next "Advanced Theme Developer" learning pathway, with more content like what you have described.

Once this learning pathway is published, we'll probably start gathering thoughts/ideas around what to include in such a "next level" series of content. Is this perhaps sometime you would like to help us work on fleshing out?

In the first slide of bullet points, would it be helpful to show the User Experience acronym (UX) in the fourth point, as (UI) is shown in the first point? Relative to above, perhaps provide a brief explanation of difference between UI and UX, which are often used interchangeably (I think).

UI and UX are often used interchangeably, but that's because the UI affects the UX directly 😃 As discussed above, I can see a future where we have an entire module or series of modules specifically focused on UI and UX when developing themes. For now though, to get these initial developer pathways published, we're focusing on the high level ideas.

But as I said, I can definitely see down the line were we really dive deeper and deeper into certain topics (for example I can't wait to do a deep dive into REST API things 😁)

jonathanbossenger commented 5 months ago

Updated video

https://github.com/WordPress/Learn/assets/180629/29afc95a-791d-4ecc-809e-b15c5530f678

ironnysh commented 5 months ago

Tutorial/Lessons Review Checklist

Love the focus on a11y-related content here, @jonathanbossenger :-)

However, in that context, there are two recommendations mentioned in the lesson, which may be controversial:

jonathanbossenger commented 5 months ago

Hi @ironnysh thanks for the review.

I'm interested to know why you feel they may be controversial. As far as I can tell, the lesson doesn't guide the learner to do anything that goes against the guidelines you've shared.

ironnysh commented 5 months ago

Hey @jonathanbossenger, I probably shouldn't have grouped both under a11y, sorry.

So, placeholders are tricky from both usability and accessibility perspectives. Here are two resources that explain the cons:

However, :visited is more about

jonathanbossenger commented 5 months ago

Thanks for the reading material.

Placeholders: correct me if I'm wrong here, but in reading these links, its not specifically a case of "don't use placeholders at all" its more a case of "don't use placeholders without labels" and "don't use placeholders incorrectly"

In the lesson it specifically states Where possible, add placeholder text to input elements. Placeholder text shows the user an example of what to type. and Use placeholders to suggest the type of data a field requires, and not as a substitute for the field label.

Would you agree this is inline with the suggested methods from those articles?

Visited: Is your concern here that because the lesson doesn't specifically give guidance on what one should do, folks will come away thinking they can do the weird hacks you've discussed?

Most of the content of this lesson comes from the [UI Best Practices](UI Best Practices) page in the theme developer handbook, so if we're going to recommend something other than what's on that page, we probably need to get that page updated first.

ironnysh commented 5 months ago

Placeholders: actually, both sources have a similar bottom line: avoid placeholders when possible, and if you must use them, do it properly.

Visited: that, too :-) I think that styling visited links isn't as clear-cut as the other topics covered in the lesson. It's probably the only UI/UX-related item here, while the rest are accessibility “musts”.

Arguably, the UI Best Practices is a bit of a misnomer. UI is more than accessibility.

jonathanbossenger commented 5 months ago

@ironnysh understood. How does this sound as an update to these sections:

Placeholders

Theme developers will often use placeholders on input elements to show the user an example of what to type. However, when done incorrectly, placeholders can be a user experience and accessibility nightmare. So make sure to use placeholders correctly, or not at all.

If you do decide to use a placeholder, make sure that it suggests the type of data a field requires, and not as a substitute for the field label.

Visited

Instead of this line

A good trick for taking the guess work out of visited links is to color them 10%-20% darker than the unvisited links.

Replace it with this.

Ideally, you should leave the default visited and unvisited link colors as is. If you do decide to change them, the visited links should ideally be at least 10%-20% darker than the unvisited links.

ironnysh commented 5 months ago

Placeholders: perfect!

Visited: honestly, I'd leave this topic out and talk about visual hierarchy instead. It's “hard core” UI/UX, references color, and has much more impact.

Some background: using a different color for visited links is still a convention, but much less common than it was back in 2004, when Jakob Nielsen wrote his famous article. It's really about context: what makes sense for a bibliography, doesn't apply when you're designing a landing page. Know what I mean?

jonathanbossenger commented 5 months ago

Gotcha. Are you ok with then just removing this line

A good trick for taking the guess work out of visited links is to color them 10%-20% darker than the unvisited links.

From that section, and leaving the rest?

ironnysh commented 5 months ago

Deal! 😄

Thanks for your patience and openness, @jonathanbossenger!

jonathanbossenger commented 5 months ago

Always happy to learn and help improve our learn content, thank you for sharing your insights and experience.

jonathanbossenger commented 5 months ago

https://wordpress.tv/2024/05/24/user-interface-best-practices-in-theme-development/

jonathanbossenger commented 5 months ago

https://youtu.be/iWi4qqtz7Bs

jonathanbossenger commented 5 months ago

https://learn.wordpress.org/lesson/ui-best-practices/