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

[data grid] Improve support of long cells content #7323

Open
oliviertassinari opened this issue Dec 25, 2022 · 3 comments
Open

[data grid] Improve support of long cells content #7323

oliviertassinari opened this issue Dec 25, 2022 · 3 comments
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer new feature New feature or request

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Dec 25, 2022

Summary 💡

This issue is a continuation of #1040. We might have an opportunity to improve the UX for end-users when using a table. This surfaced with @prakhargupta1 when using a Toolpad app mui/toolpad#1484.

Facts:

  1. When the content of the cell overflow, end-users only have one option: resize the column width to see the content.
  2. Column resizing is a Pro feature, so not available for community users https://mui.com/x/react-data-grid/column-dimensions/#resizing.
  3. Developers can use getRowHeight auto: https://mui.com/x/react-data-grid/row-height/#dynamic-row-height to wrap a row.

Problems

  1. Cell expander. For some use cases, it's better to have a single line per row to quickly scan the data. So getRowHeight auto isn't an option. Resizing the columns is painful so isn't an option either. A cell expander would improve the UX but the problem is that it's not easy to pull off. e.g. how to wrap text in cell of DataGrid #1040 (comment):

Screenshot 2022-12-25 at 13 23 24

  1. Wrapping configuration per column. A hybrid cell wrapping tradeoff is possible for some use cases: keep a single line for more of the cells but wrap a few. This requires setting getRowHeight auto and forcing some of the cells to overflow on a single line. The problem is that it's not easy to pull off:

Screenshot 2022-12-25 at 13 28 05

Some like Elastic UI go as far as allowing end-users to configure it, not just developers:

Screenshot 2022-12-25 at 13 27 28

Options

For pain 1. we could either:

  • Do nothing, leave the developer to figure this out on their own. This is what Toolpad will need to figure out.
  • Add a demo in the docs to implement this.
  • Add a boolean for developers to enable a cell expander automatically, shown to end-users when the cell overflow.

For pain 2. we could either:

  • Do nothing, leave the developer to figure this out on their own. This is what Toolpad will need to figure out.
  • Add a demo in the docs to implement this.
  • Add a boolean for each row to say if it can overflow or not
  • Allow end-users to configure which column should wrap.

Examples 🌈

Screenshot 2022-12-25 at 13 25 42

Screenshot 2022-12-25 at 13 26 32

Screenshot 2022-12-25 at 13 28 05

Screenshot 2022-12-25 at 14 00 19

Motivation 🔦

Improve the browsing experience

@oliviertassinari oliviertassinari added component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request status: waiting for maintainer These issues haven't been looked at yet by a maintainer design: ux labels Dec 25, 2022
@oliviertassinari oliviertassinari changed the title [data grid] [data grid] Improve support of long cells content Dec 25, 2022
@MBilalShafi MBilalShafi moved this to 🆕 Needs refinement in MUI X Data Grid Dec 27, 2022
@MBilalShafi MBilalShafi removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 27, 2022
@cherniavskii
Copy link
Member

Related issue: #2851

@oliviertassinari
Copy link
Member Author

Once we solve this, we might want to revert #7682.

@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer and removed design: ux labels Aug 18, 2023
@cherniavskii
Copy link
Member

@gerdadesign Can you look into this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer new feature New feature or request
Projects
Status: 🆕 Needs refinement
Development

No branches or pull requests

4 participants