-
Notifications
You must be signed in to change notification settings - Fork 72
Compact interactive list component layout #1869
Compact interactive list component layout #1869
Conversation
Co-authored-by: Saad Adnan <[email protected]>
@cm9361 Currently there are 2 major options:
In option 2, providing the uniqueness of the list component, I can see the situations when the customers might want the columns to grow (or shrink), but not exceed some specific width. In that case the customers can add maximumWidth (minimumWidth) to that column. That would make the list responsive, but not taking 100% of the width. That would allow the list to be responsive, but not limited to the container width. |
@adoroshk that's correct but they're appearing in a different order in the dom. Going over it with a screen reader, without using any extra controls, it reads in the wrong order. |
Per discussion with @eawww adding aria-rowindex to the rows would not solve the problem and the DOM order of items should be changed to reflect the column (top to bottom, then right to left) order of items inside the list. In order to break into columns with such DOM order without wrapping elements, the items have to be of known height. It has been also discussed that that the placeholder rows (empty spaces at the end of the list) are allowed, but must not have a role (already implemented) and aria-hidden=true (will be added in the next commit). |
… compact_interactive_list_component_layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple more things.
@@ -0,0 +1,36 @@ | |||
import React from 'react'; | |||
import CompactInteractiveList, { alignTypes } from 'terra-compact-interactive-list'; | |||
import rows from './rowsData'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make the examples more useful, all relevant implementation information should be included in the example's jsx file. For components like this, the data fed into it is important so it should be included, even if that means repeating it across examples.
In this instance, the focus of the example is the columns so the row data may not be terribly important, but there should be at least one base example that includes the row data inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a60c1c5
{ | ||
id: 'row_1', | ||
cells: [ | ||
{ content: <IconDocuments height="1.5em" width="1.5em" /> }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The icons in this file are all meaningful, so they should make use of the a11yLabel
prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in a60c1c5
packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/src/CompactInteractiveList.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/src/subcomponents/Row.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/src/subcomponents/Row.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx
Outdated
Show resolved
Hide resolved
packages/terra-compact-interactive-list/tests/jest/CompactInteractiveList.test.jsx
Outdated
Show resolved
Hide resolved
|
||
expect(wrapper).toMatchSnapshot(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we are still matching snapshots for the default component render once in our tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I need to add some tests, including an initial snapshot. Will get back to this comment once I have an update.
packages/terra-compact-interactive-list/src/subcomponents/Cell.module.scss
Outdated
Show resolved
Hide resolved
I removed widthUnit prop in 6f635df. The customer will be allowed to pass all width props for columns (such as width, maxWidth, minWidth) with valid css string. The customer is supposed to pass all width props using the same width unit, but if they fail to do so the failed prop will be disregarded, which will not break the layout, just make the column flex growing. There will be also a console warning for width unit inconsistency. |
… compact_interactive_list_component_layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Component is laid out as designed. Meets meaningful sequence requirements. Not evaluated for interactivity as this is only to serve as a base for further work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me given some minor test updates are done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 nit otherwise 👍
columnMinWidth = getValueUnitTypePair(DefaultListValues.minimumWidth[widthUnit]); | ||
} else if (columnMinWidth.unitType !== widthUnit) { | ||
// eslint-disable-next-line no-console | ||
console.warn(WARNINGS.COLUMN_MIN_WIDTH_UNIT_TYPE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd want to see if we can try to encapsulate this messaging inside a useEffect
. This will run every time the component re-renders and could potentially flood the console with excessive messages.
Summary
This PR creates the layout for the Compact Interactive List component, adds layout usage examples and tests.
What was changed:
The Compact Interactive List component layout has following features:
NOTE: Semantic Rows headers and column headers should be out of scope of this Jira and added once the key navigation is added. As they need to be hidden and the only purpose of them is to provide a row/column context with keyboard navigation, there is no way to test if they work before the keyboard navigation exists.
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9557