Skip to content
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

fix(tree): allow selection of parent category w/out selecting children #6926

Merged
merged 6 commits into from
May 6, 2023

Conversation

paulcpederson
Copy link
Member

Related Issue: #6912, #6444, #6509

Summary

Updates the interaction model of trees to adhere to the new design. The key changes to the interaction model are:

  1. Tree items will expand when they are clicked (Tree component parents will not open or close when user clicks on parent name #6444)
  2. Child selection modes will not automatically display all children of a selected item as selected (Calcite tree - allow selection of parent category w/out selecting children #6912)
  3. Clicking a slotted action inside a tree item will not select the tree item (Clicking tree item action also selects it #6509)

Note: this pr does not address the hover states in that design. We are coming down to the wire and I want to give time for code review. I can help address the styling/focus/hover/accessibility aspects of the tree next release.

@paulcpederson paulcpederson requested a review from a team as a code owner May 5, 2023 18:20
@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label May 5, 2023
Copy link
Member

@driskull driskull left a 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! Just had some feedback on filtering out specific elements from the onclick handler.

src/components/tree-item/tree-item.tsx Outdated Show resolved Hide resolved
@paulcpederson paulcpederson requested a review from driskull May 5, 2023 19:03
@paulcpederson
Copy link
Member Author

Running the e2e again as they somehow started failing? Is this normal?

Copy link
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

👍 ✨

@paulcpederson
Copy link
Member Author

paulcpederson commented May 5, 2023

@driskull or @jcfranco do you have any ideas on the e2e tests? Seeing it locally too. I went back to the commit that passed and it also failed, so wondering what could have changed?

Error: Protocol error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.

hmmm, the actions runner reports a tooltip test failing.

Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖
↖🌳↖↖↖🌳↖🌳🌳🌳↖↖🌳🌳🌳↖🌳🌳🌳🌳↖🌳↖
↖🌳🌳↖↖🌳↖↖🌳↖↖🌳↖↖↖↖🌳↖↖↖↖🌳↖
↖🌳↖🌳↖🌳↖↖🌳↖↖🌳↖↖↖↖🌳🌳🌳↖↖🌳↖
↖🌳↖↖🌳🌳↖↖🌳↖↖🌳↖↖↖↖🌳↖↖↖↖↖↖
↖🌳↖↖↖🌳↖🌳🌳🌳↖↖🌳🌳🌳↖🌳🌳🌳🌳↖🌳↖
↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖↖

I'll take a look at the unstable test. 👀

@@ -165,23 +165,26 @@ export class Tree {
(target.hasChildren &&
(this.selectionMode === "children" || this.selectionMode === "multichildren")));

// deselecting a parent in multichildren should deselect all the children
Copy link
Member

Choose a reason for hiding this comment

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

I think this comment can be dropped as the line below is expressive enough.

@jcfranco
Copy link
Member

jcfranco commented May 5, 2023

I'll take a look at the unstable test. 👀

Talked to @driskull and I think found a way to stabilize the tooltip tests. Feel free to skip them (https://github.com/Esri/calcite-components/blob/master/src/components/tooltip/tooltip.e2e.ts#L730 and https://github.com/Esri/calcite-components/blob/master/src/components/tooltip/tooltip.e2e.ts#L791) to get this installed and I'll submit a separate PR for restoring/stabilizing the skipped tests.

@paulcpederson
Copy link
Member Author

I skipped the tests and addressed the pr comment, will see how the e2e tests go

@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 6, 2023
@jcfranco jcfranco merged commit 601ec67 into master May 6, 2023
@jcfranco jcfranco deleted the paulcpederson/tree branch May 6, 2023 02:20
@github-actions github-actions bot added this to the 2023 May Priorities milestone May 6, 2023
@jcfranco
Copy link
Member

jcfranco commented May 6, 2023

Thanks again, @paulcpederson! Can you open a follow-up issue for the pending styling/focus/hover/accessibility updates?

@geospatialem
Copy link
Member

Added a follow-up issue targeted for August regarding the hover states in #6930.

@paulcpederson were there other considerations with styling, focus or a11y for another follow-up issue? Didn't see other context in Figma or the linked issues.

@paulcpederson
Copy link
Member Author

Nope, the styling was left as is for now. I think your hover states issue should cover updating that. Accessibility has it's own issue IIRC. Nothing more to open for this, thanks for opening that issue. And thanks @jcfranco for the merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants