carbon-design-system / ibm-products

A Carbon-powered React component library for IBM Products
https://carbon-for-ibm-products.netlify.app/
Apache License 2.0
87 stars 120 forks source link

Datagrid design review: Sorting #3118

Closed elycheea closed 8 months ago

elycheea commented 1 year ago

Design review


Standards

Pattern and behavior

Storybook

Edited to reflect @Ashley-Bock’s review!

### Tasks
- [ ] https://github.com/carbon-design-system/ibm-products/issues/3227
- [ ] https://github.com/carbon-design-system/ibm-products/issues/3247
elycheea commented 1 year ago

@Ashley-Bock to help with this review 🙌

elycheea commented 1 year ago

@kristastarr Feel free to remove any checks that don’t apply.


Accessibility review

Keyboard

Level 1

Level 2

Text and non-text

Level 1

Level 2

Level 3

User input

N/A

Ashley-Bock commented 12 months ago

Standards

Pattern and behavior

Storybook

Ashley-Bock commented 12 months ago

No issues between guidance and storybook. Only thing to consider, do designers have to always signify which column the table is sorted by default? In storybook, it doesn't appear that it shows which column has the default sorting and the guidance doesn't mention it either.

elycheea commented 12 months ago

@Ashley-Bock I believe the default sort is actually unsorted. It might be the same as the “row index” in Storybook. @matthewgallo Don’t see any mention in our docs if we support default sort? (Linked v1 since v2 docs are undergoing the Storybook upgrade.)

kristastarr commented 11 months ago

The keyboard interactions look good, with the exception of column resizing - see #4. There are a few screenreader issues when testing with voiceover setting on Mac.

  1. Table description

    • Currently voiceover provides only a vague description of the table. Need to add aria-label, aria-describedbyor caption to provide accessible description of the table. Although this is something that the developer implementing this component will need to supply, so probably something we should mention in guidelines or possible add a prop for? See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/table_role
  2. Aria sort

    • Need to check markup of the table - should be using aria-sort so that the screenreader announces to the user that the table is sortable

Current: Screenshot 2023-07-02 at 11 27 10 AM

Current: Screenshot 2023-07-02 at 11 36 49 AM

Correct example from https://developer.mozilla.org/en-US/docs/Learn/HTML/Tables/Advanced: Screenshot 2023-07-02 at 12 03 37 PM

  1. Reading first row after clicking sort button

    • When clicking CNTRL+Option+space to click the sort button when using screenreader, the screenreader reads out the first table row, without any context. It shouldn't be reading any table content. Screenshot 2023-07-02 at 12 45 50 PM
  2. Row splitters:

    • Row splitters are not interactable via keyboard focus, but are interactable via screen reader when navigating using CNTRL+Option+ L/R/Up/Down arrows
    • When interacting via screenreader use, the row splitters aren't working properly - Was this worked on in a different PR?

Current: Screenshot 2023-07-02 at 12 06 03 PM Current: Screenshot 2023-07-02 at 12 06 56 PM

kristastarr commented 11 months ago
  1. Table contents when navigating horizontally
    • When using CNTRL+Option+L/R or Up/Down arrows to navigate horizontally through the table with the screen reader, it reads the the contents of a cell as a group, saying the same content three times. To minimize the amount of times you need to arrow L and R, the content inside the cell shouldn't be inside a group Screenshot 2023-07-02 at 12 33 39 PM

Current:

kristastarr commented 11 months ago

Text in the gray box indicates what the screenreader is reading out. Lmk if you want to talk through any of these issues if they are not clear by the descriptions 😄

elycheea commented 11 months ago

@kristastarr @matthewgallo The bit on row splitters — I think this is coming from the resizable columns feature. I think we should be able to re-add the resizing behavior so might be worth having you take a review at the behavior once we have that working again. Don’t think that one needs to be a part of the Sorting followup though.

Not sure if we have a good solution of the groups at the moment either ... I’m guessing it’s also part of a number of other extensions. Might need some ideas on how we approach this. How critical do you think this one is for our initial release? :thinking:

kristastarr commented 9 months ago

For the row splitters, yes I think it makes sense to fix it on the resizable columns feature since that impacts multiple other components.

For the groups - I don't think I delved into the code for this one, but can take a look - did you guys see what's causing them to be "grouped"?

elycheea commented 8 months ago

Opened a new issue for investigating why cells are being interpreted as groups so we can close this one!