-
Notifications
You must be signed in to change notification settings - Fork 51
[terra-clinical-item-view] Add property to separate by row or column when in two column layout #912
Conversation
Terra.validates.element('with truncation in one column', { selector: '#ItemView-one-wrap' }); | ||
Terra.validates.element('with truncation in two columns', { selector: '#ItemView-two-wrap' }); | ||
Terra.validates.element('with truncation in one column', { selector: '#ItemView-one-truncate' }); | ||
Terra.validates.element('with truncation in two columns', { selector: '#ItemView-two-truncate' }); |
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.
Noticed that previously this was not actually pointing to the tests for truncated content. So any of the 'with truncation in one column' or 'with truncation in two columns' snapshots are going to be changed for good reason.
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.
Also some of the 'with word wrap' images have changed a bit as well - just the sizing of that image has changed but not the actual word wrap/overflow behavior. I will post recordings in the description to show this.
2eb3fa5
to
1ac0d15
Compare
...erra-clinical-item-view/src/terra-dev-site/doc/clinical-item-view/clinicalItemView.1.doc.mdx
Outdated
Show resolved
Hide resolved
How does this affect existing behavior? Will this change be passive? |
@sdadn This is essentially adding back old code to make sure we maintain an option for passivity. When this new prop is false it will revert to using the logic we had before the most recent two column accessibility updates. |
@sdadn tagging again, just want to make sure you saw my response |
ec3f4ef
to
62a81c5
Compare
while (displaysSlice.length) { | ||
displayGroups.push(displaysSlice.splice(0, 2)); |
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.
Isn't this pushing the same array information to the array multiple times?
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.
No, splice removes the first two displays from displaysSlice and pushes them together to displayGroups. So each time it's taking the top two off and pushing them. It's the same logic that was being used previously.
So displayGroups would look like [[display 1, display 2], [display 3, display 4], [display 5, display 6], [display 7, display 8]]. And by the end displaysSlice would be empty
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.
Ah right, splice
mutates the original array as opposed to slice
. +1
@@ -1,12 +1,19 @@ | |||
Terra.describeViewports('Clinical Item View', ['tiny', 'small', 'medium', 'large', 'huge', 'enormous'], () => { | |||
it('with one column displays', () => { | |||
it('with displays', () => { |
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 know this is following the previous sentence structure, but since we are updating these, we should reword these so it reads as a sentence starting with "it". E.g. "It renders with with displays" or any other more appropriate descriptor.
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.
sure thing, cf417ee
@RayGunY The old logic should be the default for passivity. A few consumers reported the recent updates causing issues. Though the question is if swapping the defaults breaks more or less consumers 😅. |
I understand what you're saying Saad. @scott what do you think? I thought we wanted to push people towards using the new logic but have the option to keep the old logic for passivity. |
@RayGunY - The conflict between passivity and accessibility is the challenge we are facing. Because consumers have not made their accessibility updates yet, I think we need to go with the passive approach and emphasize in the accessibility guide that consumers must enable the prop when they are remediating for accessibility. Other thoughts? |
@mjpalazzo that works for me, just wasn't sure which is the bigger priority in this case. I can go ahead and change the default to use the old logic. |
4ebe431
to
456b749
Compare
@@ -2,6 +2,9 @@ | |||
|
|||
## Unreleased | |||
|
|||
* Added | |||
* Added `trueColumn` prop so consumers can choose whether to separate displays in the two column layout by row or by column. |
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 `trueColumn` prop so consumers can choose whether to separate displays in the two column layout by row or by column. | |
* Added `trueColumn` prop to toggle between displaying in a two column layout by row or by column. |
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.
/** | ||
* Determines whether the displays are programmatically separated by row or as true columns when layout is set to `twoColumns`. | ||
* Screenreaders will read `trueColumn` displays from top to bottom, one column at a time. | ||
* However, this prop defaults to false and therefore the screenreader will read the displays in both columns together, left to right, one row at a time. |
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.
* However, this prop defaults to false and therefore the screenreader will read the displays in both columns together, left to right, one row at a time. | |
* However, this prop defaults to `false` and therefore the screenreader will read the displays in both columns together, left to right, one row at a time. |
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.
* Determines whether the displays are programmatically separated by row or as true columns when layout is set to `twoColumns`. | ||
* Screenreaders will read `trueColumn` displays from top to bottom, one column at a time. | ||
* However, this prop defaults to false and therefore the screenreader will read the displays in both columns together, left to right, one row at a time. | ||
* For accessibility purposes it is recommended to set trueColumn to true. |
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.
* For accessibility purposes it is recommended to set trueColumn to true. | |
* For accessibility purposes it is recommended to set trueColumn to `true`. |
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.
while (displaysSlice.length) { | ||
displayGroups.push(displaysSlice.splice(0, 2)); |
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.
Ah right, splice
mutates the original array as opposed to slice
. +1
import IconBriefcase from 'terra-icon/lib/icon/IconBriefcase'; | ||
import IconPerson from 'terra-icon/lib/icon/IconPerson'; |
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.
We can update these to use the new named exports introduced in cerner/terra-core#3915.
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.
We should probably have an example/code snippet where |
@sdadn I believe I already have something that should cover that here: https://github.com/cerner/terra-clinical/pull/912/files#diff-d43cc843d972ecc662a6ef6a0bd194724cf3d97c03658812c7a0f855e209d881R41 The other two column examples on the page are all with trueColumn=true |
Ah I missed that. Looks good then! |
Summary
What was changed:
trueColumn
prop that defaults to true. When it is set to false it reverts to handling two column layout like it was before the changes in this PR. This means the screenreader will read out left to right, up to down. Also resizing/truncation/overflow will behave slightly differently (like it was working before) than trueColumn view because displays are being handled by row.Why it was changed:
So that users can have the option to use the old layout/handling for two column in case the new changes break anything for them. Also to fix truncation behavior for partial truncation.
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9563
VO and JAWs Readouts:
VO-twoColumn-by-row.mov
JAWS-readout-by-row.mov
True two column resizing behavior is the same as before (truncated and not truncated):
truncation_resize.mov
non_truncated_resize.mov
This is the partial truncation issue I fixed:
Before
After