Skip to content

[Docs] Update Switch writing guidelines#5558

Closed
florent-leborgne wants to merge 9 commits intoelastic:mainfrom
florent-leborgne:toggle-switch-writing-guidelines
Closed

[Docs] Update Switch writing guidelines#5558
florent-leborgne wants to merge 9 commits intoelastic:mainfrom
florent-leborgne:toggle-switch-writing-guidelines

Conversation

@florent-leborgne
Copy link
Copy Markdown
Member

Summary

This PR updates docs only. As discussed in Slack, the UX writing group suggests some updates to writing guidelines and examples about the EuiSwitch component.
With the hope of making these guidelines easier to find and use, I moved them directly in the component section.

Please let me know if there are any additional steps I should take to complete this PR, or advise a different approach.
If this approach is fine, this is something we could repeat in the future for other components.

Before:
image
image

After:
image

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox
- [ ] Props have proper autodocs and playground toggles
- [ ] Added documentation
- [ ] Checked Code Sandbox works for any docs examples
- [ ] Added or updated jest and cypress tests
- [ ] Checked for breaking changes and labeled appropriately
- [ ] Checked for accessibility including keyboard-only and screenreader modes
- [ ] A changelog entry exists and is marked appropriately

@florent-leborgne florent-leborgne added documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) labels Jan 25, 2022
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5558/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5558/

Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @florent-leborgne for opening this PR.

One of the things we considered in our slack conversation was to break down the checkbox/radio/switch components to its own page. So I pushed some changes (8bd0d90) to included a new section called "Selection controls".

Screenshot 2022-01-26 at 17 54 19

I found it having the GuideRules on the examples page a little bit confusing and it was introducing a new pattern in our docs. Normally the GuideRules only live on guidelines tabs.

Screenshot 2022-01-26 at 17 21 24

We could have these writing guidelines without the GuideRules component. Maybe just pure text. So this wouldn't introduce a new pattern.

But I decided to create a new tab "Guidelines" and move the GuideRules there.

Screenshot 2022-01-26 at 17 55 23

We talked in slack that it would be weird to have an entire page dedicated to just switch guidelines but I changed my opinion:

  • I think our users already know where to find specific component guidelines.
  • It will be weird to only see guidelines for one component. But I see this as a first step. And we should soon, include more guidelines for the rest of "Selection controls".
  • We could think of a new pattern like a flyout... But it will take time to think about the best design and routing. So for now, I think this is the best compromise.

@florent-leborgne and @gchaps what do you think of these changes?

Comment on lines +253 to +255
<EuiLink href="https://github.com/elastic/eui/pull/5119#discussion_r699717319">
table header
</EuiLink>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link doesn't seem correct.

@elizabetdev elizabetdev requested review from chandlerprall and removed request for cchaos January 26, 2022 18:05
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5558/

@florent-leborgne
Copy link
Copy Markdown
Member Author

@miukimiu Thanks a lot for the suggestion. I really like having a tab that is dedicated to guidelines. And yes with time we will find more guidelines for more components.

I would still like to make it more visible from the example section that guidelines exist for a specific component. In this case, once you've scrolled down to the "Switch" section, it's easy to miss that there are guidelines for it. Do you think a link can do the trick (until we think of a new pattern as you mentioned)?

@elizabetdev
Copy link
Copy Markdown
Contributor

@florent-leborgne yes, I think for now a link can do the trick.

Here are a few examples where we're linking to a guideline page (for inspiration):

Screenshot 2022-01-31 at 18 07 19

Screenshot 2022-01-31 at 18 06 33

Screenshot 2022-01-31 at 18 04 59

@florent-leborgne
Copy link
Copy Markdown
Member Author

Thanks for your input @miukimiu.
I've added a link to the Guidelines tab to make it easy to find:
image

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5558/

@elizabetdev
Copy link
Copy Markdown
Contributor

Thanks, @florent-leborgne! I cherry-picked your commits to #5607. I decided to have better docs and examples for all the selection controls. So I'm closing this PR in favor of #5607.

If you don't mind, I'll then add you as a reviewer in #5607. 🙂

I'll make sure to keep your contributions intact! 🎉

@elizabetdev elizabetdev closed this Feb 7, 2022
@elizabetdev elizabetdev mentioned this pull request Feb 7, 2022
3 tasks
@florent-leborgne
Copy link
Copy Markdown
Member Author

@miukimiu Thanks that makes sense! FYI the UX writing group also intends to add guidelines for more components soon. For example, I'm working with @gchaps on checkboxes this week. Do you want us to wait until you're done with your new PR, or add things on top of it?

@elizabetdev
Copy link
Copy Markdown
Contributor

To not overcomplicate, I think is better if we wait until #5607 is merged. 😄

@florent-leborgne
Copy link
Copy Markdown
Member Author

Sure thing 😁
Thanks for putting this together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants