Skip to content

[TreeView] Refactor the tree view internals to prepare for headless API#13311

Merged
flaviendelangle merged 6 commits intomui:masterfrom
flaviendelangle:refacto-tree-view
Jun 12, 2024
Merged

[TreeView] Refactor the tree view internals to prepare for headless API#13311
flaviendelangle merged 6 commits intomui:masterfrom
flaviendelangle:refacto-tree-view

Conversation

@flaviendelangle
Copy link
Member

@flaviendelangle flaviendelangle commented May 30, 2024

  • Move extractPluginParamsFromProps inside useTreeView
  • Simplify the LogExpandedItems doc example (remove support for the root slot)
  • Remove the default plugin list in favor of one list per Tree View component we export (so that RichTreeView can have plugin that SimpleTreeView does not have)

@flaviendelangle flaviendelangle added the scope: tree view Changes related to the tree view. This includes TreeView, TreeItem. label May 30, 2024
@flaviendelangle flaviendelangle self-assigned this May 30, 2024
@mui-bot
Copy link

mui-bot commented May 30, 2024

Deploy preview: https://deploy-preview-13311--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 37de3bd

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 10, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 10, 2024
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 10, 2024
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jun 10, 2024
@flaviendelangle flaviendelangle changed the title [TreeView] Refacto the tree view internals to prepare for headless API [WIP] [TreeView] Refacto the tree view internals to prepare for headless API Jun 11, 2024
@flaviendelangle flaviendelangle marked this pull request as ready for review June 11, 2024 14:03
const forwardedProps = {} as Omit<TProps, keyof PluginParams>;

Object.keys(props).forEach((propName) => {
const prop = props[propName as keyof typeof props] as any;
Copy link
Member

Choose a reason for hiding this comment

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

We had similar issues for normalizing plugins in charts without using any. If one day you find a better solution than your current one, I would be interested :)

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Given the types of Object.keys I think there is no better solution for now 😢

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

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

Seems good, but I don't know tree view well enough to spot room for improvement

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.

Looks good, nice improvement🚀 I really like that we now have a plugin list per component 💙

@noraleonte noraleonte changed the title [TreeView] Refacto the tree view internals to prepare for headless API [TreeView] Refactor the tree view internals to prepare for headless API Jun 12, 2024
@flaviendelangle flaviendelangle merged commit b38bef8 into mui:master Jun 12, 2024
@flaviendelangle flaviendelangle deleted the refacto-tree-view branch June 12, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tree view Changes related to the tree view. This includes TreeView, TreeItem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants