Skip to content

Steplist component - #5201

Merged
LFDanLu merged 32 commits into
mainfrom
steplist-component
Oct 27, 2023
Merged

Steplist component#5201
LFDanLu merged 32 commits into
mainfrom
steplist-component

Conversation

@dgrossen

@dgrossen dgrossen commented Oct 4, 2023

Copy link
Copy Markdown
Collaborator

Reviving work on the StepList component and dusting off PR #2832

  • Fixed some bugs with rtl and the use of solid/dashed lines for vertical completed steps
  • Updated stories
  • Cleaned up dependencies

Still need to add tests and docs but thought I would get the ball rolling.

StepList Component Issue - #1012

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

Comment thread packages/@react-spectrum/steplist/test/StepList.test.js Outdated
Comment thread packages/@react-spectrum/steplist/test/StepList.test.js Outdated
@rspbot

rspbot commented Oct 5, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 5, 2023

Copy link
Copy Markdown

Build successful! 🎉

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In general it's looking really good. Thank you for picking this up.

I don't seem able to undo any step except the last one
steps:
default story, keyboard navigate to the steplist and then to the last item
keyboard navigate back to the first item, only the last step is cleared out

Rest of my comments I think could be candidates for followup:

would be good to have less stories if they are covered by the controls, and instead add the more edge case stories, such as ones with steps that have long names which wrap or cause the steplist to take 100% of the width, or show them in a dialog, or maybe one with controlled selection that updates in response to events, or a disabled key in the middle but still have some enabled toward the far end. or starting with a disabled key. it'd also be good to have one with the keyboard activation set to manual

I have a feeling that we'll want/need to support links in steplists, we'll need an example of that to make sure it works
what I mean by that is specifically https://react-spectrum.adobe.com/react-spectrum/Breadcrumbs.html#links

Comment thread packages/@react-aria/steplist/src/StepListKeyboardDelegate.ts Outdated
Comment thread packages/@adobe/spectrum-css-temp/components/steplist/index.css
Comment thread packages/@adobe/spectrum-css-temp/components/steplist/index.css
Comment thread packages/@adobe/spectrum-css-temp/components/steplist/skin.css Outdated
Comment thread packages/@adobe/spectrum-css-temp/components/steplist/index.css Outdated
Comment thread packages/@react-aria/steplist/src/useStepListItem.ts Outdated
)}>
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
<a className={classNames(styles, 'spectrum-Steplist-link')} >
<VisuallyHidden {...stepStateProps}>{stepStateText}</VisuallyHidden>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not hearing "Completed" ever read out on MacOS VO

{item.rendered}
</span>
<span className={classNames(styles, 'spectrum-Steplist-marker-focus')}>
<span className={classNames(styles, 'spectrum-Steplist-marker')}>{(item.index || 0) + 1}</span>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should internationalize this number using a number formatter

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I also feel like the announcement should prioritize the step number followed by the title
so instead of it reading "Dog 2", it should say something like "Step 2, Dog"
or, it should say "Dog, step 2"

Comment thread packages/@react-stately/steplist/src/useStepListState.ts Outdated
return {
...state,
setSelectedKey,
setLastCompletedStep,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

where is this used? can it be controlled through props selectedKey?

@dgrossen

Copy link
Copy Markdown
Collaborator Author

@snowystinger please give it another review when you get a chance. I addressed most of the feedback here and several of the items from the testing bash. I also cleaned up some things. Opted to use context instead of passing the state as a prop to the items. I also got rid of the isNavigable stuff to align more with the #1012 spec. It should also follow the XD spec more closely also

@dgrossen
dgrossen requested a review from snowystinger October 13, 2023 23:33
@rspbot

rspbot commented Oct 13, 2023

Copy link
Copy Markdown

Comment thread packages/@react-aria/steplist/test/useStepList.test.js Outdated
Comment thread packages/@react-spectrum/steplist/chromatic/StepList.chromatic.tsx Outdated
Comment thread packages/@react-spectrum/steplist/src/StepList.tsx Outdated
Comment thread packages/@react-spectrum/steplist/stories/StepList.stories.tsx
Comment thread packages/@react-spectrum/steplist/test/StepList.test.js Outdated
@rspbot

rspbot commented Oct 16, 2023

Copy link
Copy Markdown

@snowystinger

Copy link
Copy Markdown
Member

Some behavioral things I noticed:
Up and Down arrow keys will still navigate
Can't click on any of the steps anymore really in any of the stories because there are so many disabled?
I don't know if most of the stories are missing an action for 'onAction', but I don't see onAction being fired in any of the stories
What is the Default story? it doesn't seem to do anything? I think it got mixed with the fully disabled story?

In the last story, when I press next, I can go to step 4, but then if I click on step < 4, I can't get back to step 4 without clicking the next button eventually

Unsure about this one, but when individual steps are disabled, they don't display their number, yet steps around them will. I think it looks funky, not sure I like it.

@rspbot

rspbot commented Oct 17, 2023

Copy link
Copy Markdown

@dgrossen

Copy link
Copy Markdown
Collaborator Author

Up and Down arrow keys will still navigate

Fixed

Can't click on any of the steps anymore really in any of the stories because there are so many disabled?

This is because I made changes to align more with the spec: #1012
Specifically, "Users can optionally click on completed steps to jump back to them, but advancing to the next step must be done through alternate means" and "By default, the last completed step advances automatically as the selected step increases". And I spoke with XD and they confirmed that expected behavior. Sorry for the confusion, the first story/implementation allowed any steps to be clicked on.

In the last story, when I press next, I can go to step 4, but then if I click on step < 4, I can't get back to step 4 without clicking the next button eventually

I improved the stories a bit to help clear things up. I tried to rename them and added a last completed step display to help communicate what's going on. The back button and next button are disabled when on the first and last step respectively.

I also added tests that hopefully describe the expected controlled and uncontrolled (sort of) states of the step list component.

Unsure about this one, but when individual steps are disabled, they don't display their number, yet steps around them will. I think it looks funky, not sure I like it.

I wasn't able to repro this one, but I wondered if this was related to the designs not having the numbers in incomplete steps for medium size, but the large and extra large incomplete steps do? https://spectrum-contributions.corp.adobe.com/page/steplist-beta/

@rspbot

rspbot commented Oct 18, 2023

Copy link
Copy Markdown

Comment thread packages/@react-spectrum/steplist/test/StepList.test.tsx Outdated
Comment thread packages/@react-spectrum/steplist/test/StepList.test.tsx Outdated

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we should check all package jsons so we don't have extraneous dependencies, I did a spot check

Comment thread packages/@react-spectrum/steplist/package.json Outdated
Comment thread packages/@react-spectrum/steplist/package.json Outdated
Comment thread packages/@react-spectrum/steplist/package.json Outdated
@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 25, 2023

Copy link
Copy Markdown

@reidbarber reidbarber left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the isEmphasized text color may fail contrast requirements, so we may want to revisit that design. Besides that, I think this looks ready for an alpha release (after the empty documentation pages get removed.)

Comment thread packages/@react-aria/steplist/docs/useStepList.mdx

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For followup: address HCM styling, especially for disabled steplist

Comment thread packages/@react-aria/steplist/src/useStepList.ts Outdated
Comment thread packages/@react-spectrum/steplist/docs/StepList.mdx

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

don't think we need this file

"completed": "Completed: ",
"notCompleted": "Not completed: ",
"current": "Current: ",
"steplist": "Step List"

@LFDanLu LFDanLu Oct 26, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

don't think we need this line since the aria hook is the one that needs this translation?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is for localizing the VisuallyHidden component states of the step to the DOM:

<li>
  <a role="link" tabIndex="0">
    <VisuallyHidden>Completed: </VisuallyHidden>
    Details
  </a>
</li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, but we don't need "steplist" if I'm not mistaken? Only the previous three lines are used:

if (isSelected) {
stepStateText = stringFormatter.format('current');
} else if (isCompleted) {
stepStateText = stringFormatter.format('completed');
} else {
stepStateText = stringFormatter.format('notCompleted');
}

@rspbot

rspbot commented Oct 27, 2023

Copy link
Copy Markdown

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@snowystinger snowystinger mentioned this pull request Oct 27, 2023
5 tasks
@rspbot

rspbot commented Oct 27, 2023

Copy link
Copy Markdown

@rspbot

rspbot commented Oct 27, 2023

Copy link
Copy Markdown
## API Changes

unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any', access: 'private' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }
unknown top level export { type: 'any' }

@LFDanLu LFDanLu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Happy for this to be merged as is for testing and for the rest to be followup

@LFDanLu
LFDanLu merged commit d8438da into main Oct 27, 2023
@LFDanLu
LFDanLu deleted the steplist-component branch October 27, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants