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

[docs] Improve Tree View demos #10268

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 7, 2023

I notice on #10255 that https://mui.com/x/react-tree-view/#custom-icons-border-and-animation demos is broken:

Screen.Recording.2023-09-07.at.19.40.18.mov
  1. It animates on load while it shouldn't. It can be solved like this [Spring] Disable animation on initial render pmndrs/react-spring#485 (comment).
  2. It creates an overflow scrollbar. It can be solved with overflowX: hidden, see how even with an overflow y, it continues to work:
Screen.Recording.2023-09-07.at.19.44.17.mov

Along the way, I improved a bit in the other demos:

  • Use less vertical space when possible
  • Use minHeight over height in the case we add more items in the demos and forgot about this property (same for developer who copy the demos)
  • Use smaller tree when the demos doesn't need the larger one
  • Fix the second demo of https://mui.com/x/react-tree-view/#contentcomponent-prop. I assume JSS migration to Emotion broke it.
  • Move the sx style outside of the TreeView node when they are supposed to simulate the side nav container the tree view will be rendered into but not relevant for the children.

Preview: https://deploy-preview-10268--material-ui-x.netlify.app/x/react-tree-view/

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! labels Sep 7, 2023
@mui-bot
Copy link

mui-bot commented Sep 7, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-10268--material-ui-x.netlify.app/

Updated pages

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms -215.7 1.6 -215.7 -93.26 88.904
Sort 100k rows ms 630.4 1,248.1 1,237.5 1,086.52 233.081
Select 100k rows ms 528.4 650.4 618.2 605.92 41.288
Deselect 100k rows ms 114 205.7 176.7 171.96 31.678

Generated by 🚫 dangerJS against 471553c

@flaviendelangle
Copy link
Member

@noraleonte I let you have a look at this one 👼

Copy link
Contributor

@noraleonte noraleonte left a comment

Choose a reason for hiding this comment

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

Thanks for picking this up! 🎉 The changes make sense and I like how optimized the vertical space is now 🎉

@oliviertassinari oliviertassinari merged commit 3baabd8 into mui:master Sep 8, 2023
@oliviertassinari oliviertassinari deleted the tree-view-polish-demos branch September 8, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants