Skip to content
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

🎉 Documentation Section Examples Redesign #4449

Merged
merged 87 commits into from
Mar 16, 2021

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Jan 26, 2021

... and starting to move towards playgrounds within examples

I'll be moving these bits and pieces over to new PR's as some of these updates are already in other PR's and will cause conflicts.

The Buttons page is the best example usage of the new pattern.

Screen Shot 2021-01-26 at 15 46 19 PM

These are the basic ideas to implement in this PR:

  • Moves examples to be contained within a panel
  • Moves the tabs to below the rendered example, but always keeps the render visible when tabbing through the code options
  • Re-uses the same props table layout/display and component as the playground props table
  • Makes it available to put the playground directly in a docs section as an alternative example
  • Starts a pattern of how to better handle the display of non-component docs

We don't need to take this PR and update every playground usage right now, the separate pages still work. We'll just do a slow migration after this PR merges.

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
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • [ ] Added or updated jest tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes This probably could be better. But I'll be sure to do a follow up
  • [ ] A changelog entry exists and is marked appropriately

@cchaos cchaos added the documentation Issues or PRs that only affect documentation - will not need changelog entries label Jan 26, 2021
@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor Author

cchaos commented Jan 26, 2021

I've added some more context to the summary of this PR. It's going to mainly be a side-project for me, so it will move slowly. That is unless someone else is keen to take the baton. Just raise your hand here so we know whose currently working on it.

There's still a good amount of refactoring to do and some bug fixes, but overall the pieces are in place.

@elizabetdev
Copy link
Contributor

✋🏽 I'm keen to help!

@cchaos cchaos changed the title [DRAFT] 😯 Docs Redesign-ish [DRAFT] 😯 Documentation Section Examples Redesign Jan 28, 2021
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

# Conflicts:
#	src-docs/src/views/button/button_ghost.js
#	src-docs/src/views/button/button_group.js
#	src-docs/src/views/utility_classes/utility_classes.js
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

Copy link
Contributor Author

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

I'd like to wrap up this PR since I think most dependencies have been merged now. There will still be a time period where we'll need to move all the playgrounds into the examples, but I think its ok to follow up.

There's also PLENTY more do to do cleanup the code, especially with more Typescripting, but another ok for follow up.

The only other thing to consider is if we want to just comment out the getting started section for now until we have better text formatting. @miukimiu ?

Comment on lines -181 to -184
onSort = (componentName) => {
const { sortedComponents } = this.state;
if (
!sortedComponents[componentName] ||
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This table Props column sorting, I think, is the only thing that didn't get moved to the Playground table. It still may be nice to add back in.

@cchaos cchaos changed the title [POC] 😯 Documentation Section Examples Redesign 🎉 Documentation Section Examples Redesign Mar 11, 2021
@cchaos cchaos marked this pull request as ready for review March 11, 2021 21:00
@kibanamachine
Copy link

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

@elizabetdev
Copy link
Contributor

elizabetdev commented Mar 11, 2021

The only other thing to consider is if we want to just comment out the getting started section for now until we have better text formatting. @miukimiu ?

Yes! I commented out the getting started section. 🙌🏽

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@snide snide self-requested a review March 15, 2021 17:51
Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

I did a manual functional test of all our example pages. Overall things work extremely well. These were the only small issues I noticed.

Long prop types no longer scroll within their container.

image

image

This one actually happens in all "display" and "form" playgrounds

image

image

This one happens in a lot of the charts examples

image

@cchaos
Copy link
Contributor Author

cchaos commented Mar 15, 2021

Long prop types no longer scroll within their container.

Grr... ok 👀

Playgrounds need to be move

Yes, there are a lot of these. And I want to do them in follow ups because I want to evaluate the "right" places to move them to; especially ones that are more than one component. Basically, it require thought and want to get this initial change in first then my task is to fix up all the pages.

Move Guidelines button

😆 You're constantly pushing for this and I honestly don't thing that's a very discoverable place to put such an important navigational element. And how would the button behave? Is it a toggle button? I like the explicit tabs of "Show me the examples vs Show me the Guidelines".

This one happens in a lot of the charts examples

I thought I had this fixed, but likely I just need to adjust for if the tabs don't exist to remove any padding and/or the whole bottom panel.

- Don’t display bottom split panel if no tabs or tabcontent
- Fix code blocks in prop table
@kibanamachine
Copy link

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

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Approved on functionality. I think figuring out the consistent pattern for playgrounds should be a follow up.

@cchaos
Copy link
Contributor Author

cchaos commented Mar 16, 2021

I think figuring out the consistent pattern for playgrounds should be a follow up.

Yep, immediately! 😸

@kibanamachine
Copy link

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

@cchaos cchaos merged commit 87803b4 into elastic:master Mar 16, 2021
@cchaos cchaos deleted the move-playground branch March 16, 2021 19:38
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants