-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
feat(Unification): Update Command Group UI #20465
Conversation
…sting in cypress)
… into refactor-cmd-ui
const level = model.groupLevel < 6 ? model.groupLevel : 5 | ||
|
||
for (let i = 1; i < level; i++) { | ||
groupPlaceholder.push(<span key={`${this.props.groupId}-${level}`} className={`command-group-id-${model.group} command-group-block`} />) |
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.
Should this be:
groupPlaceholder.push(<span key={`${this.props.groupId}-${level}`} className={`command-group-id-${model.group} command-group-block`} />) | |
groupPlaceholder.push(<span key={`${this.props.groupId}-${i}`} className={`command-group-id-${model.group} command-group-block`} />) |
@@ -259,53 +265,61 @@ class Command extends Component<Props> { | |||
const isSessionCommand = commandName === 'session' | |||
const displayNumOfChildren = !isSystemEvent && !isSessionCommand && model.hasChildren && !model.isOpen | |||
|
|||
let groupPlaceholder: Array<JSX.Element> = [] |
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.
This can be a const right?
let groupPlaceholder: Array<JSX.Element> = [] | |
const groupPlaceholder: Array<JSX.Element> = [] |
@@ -343,7 +357,7 @@ class Command extends Component<Props> { | |||
|
|||
return ( | |||
<ul className='command-child-container'> | |||
{_.map(model.children, (child) => ( | |||
{model.children.map((child) => ( |
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.
Is children guaranteed to be populated on model? I like the change to a standard map, but it was safe against undefined values before, just wanted to confirm.
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.
It's not super obvious, but we are checking it here. I can update this to make it cleaner: https://github.com/cypress-io/cypress/pull/20465/files/03b75937f73d056c5796aba5bdd504f1e09d8932#diff-fb0aaf9c972fca4aa414f95ac88ab9ad1619459edeab226100daaba5e55645d0R350
clickCommandLog('click') | ||
.then(() => { | ||
expect(spyTableName).calledWith('Mouse Events') | ||
expect(spyTableData).calledOnce |
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.
This is A LOT more readable 👍
* | ||
* > Expander Column | ||
* - When the log is a group log and it has children logs, it will display the chevron icon | ||
*/ |
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.
Nice comment
</div> | ||
) | ||
}) | ||
<div className='command-expander-column' onClick={() => model.toggleOpen()}> |
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.
It seems like this command-expander-column element is eating clicks when the command isn't actually toggle-able/has no children. We could selectively add the onClick based on child presence as well?
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 had the one comment related to the expander column. I ran through the stated requirements in the PR description, everything seems to be working as expected. It's looking great!
Everything seems to be working well. Nice work! |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Command Group UI Requirements
User facing changelog
TODO
How has the user experience changed?
View Percy screenshots for the most comprehensive comparisons.
Command Group Behavior Before:
Command Group Behavior After:
Screen.Recording.2022-04-21.at.8.14.32.AM.mov
PR Tasks
cypress-documentation
?type definitions
?