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

Calcite tree - allow selection of parent category w/out selecting children #6912

Closed
capeoples opened this issue May 3, 2023 · 9 comments
Closed
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Online Issues logged by ArcGIS Online team members. c-tree Issues that pertain to the calcite-tree and related components design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.

Comments

@capeoples
Copy link

Description

We would like to have a property on the calcite tree that just allows for selecting the parent, without selecting children. We also want to make sure that this enhancement is accessible.


Currently in the calcite tree, when a parent is expanded / selected, it automatically selects all of the children.
Screen Shot 2023-05-03 at 11 40 02 AM

When applied to filters in ArcGIS Online, this creates a scenario that is confusing / overwhelming for users, as there could be many nested filters under a parent. There is also a need to select just the parent in many filter use cases. Current example:
Screen Shot 2023-05-03 at 11 45 52 AM

Acceptance Criteria

Allow for a selecting just the parent in a tree without selecting children.

Relevant Info

This example from w3.org of a File Directory for a Treeview illustrates the behaviour we are looking for. Here's a link directly to the codepen example.

Which Component

Calcite tree

Example Use Case

No response

Priority impact

p1 - need for current milestone

Esri team

ArcGIS Online

@capeoples capeoples added 0 - new New issues that need assignment. enhancement Issues tied to a new feature or request. needs triage Planning workflow - pending design/dev review. labels May 3, 2023
@github-actions github-actions bot added impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone ArcGIS Online Issues logged by ArcGIS Online team members. labels May 3, 2023
@geospatialem geospatialem added the design Issues that need design consultation prior to development. label May 3, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels May 3, 2023
@geospatialem geospatialem added this to the 2023 May Priorities milestone May 3, 2023
@geospatialem geospatialem added p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 5 A few days of work, definitely requires updates to tests. labels May 3, 2023
@geospatialem
Copy link
Member

@SkyeSeitz @ashetland Could you take a peek at this one? The solution will likely be a new prop on tree, which would only select the parent item and not the child(ren). This pattern would differ from what is currently offered when a parent item is expanded and selected.

@ashetland ashetland added the c-tree Issues that pertain to the calcite-tree and related components label May 3, 2023
@geospatialem
Copy link
Member

Possible related issue: #6509, which is a bug request on tree-item related to child action and selection - also targeted for the May release.

@SkyeSeitz SkyeSeitz self-assigned this May 4, 2023
@SkyeSeitz
Copy link

Some thinky thoughts and notes on interaction behavior so we can align and discuss any open ended questions :)
Documented at this file.

@paulcpederson
Copy link
Member

@SkyeSeitz that design covers our workflow really well. This is a change to how the children mode operates, but I think it's a good change and much more intuitive.

@ashetland
Copy link

Agreed. Nice work Skye. Do we think we can clean up hover states on this as well to make things more clear or does that need to wait to get this implemented faster?

@paulcpederson
Copy link
Member

I can add hover changes as part of this pr if the designs are done in the very near future

@SkyeSeitz
Copy link

Thank you, @paulcpederson! Hover states are ready for review here.
image

@SkyeSeitz
Copy link

SkyeSeitz commented May 4, 2023

Link to prototype with different hover state options. I am favoring the second in this list labeled "Background hovers without action" as it provides distinct hover states between: selecting & expanded a parent item, just expanding, and just the triggering the action. The background also consistently extends to the left when hovering over the icon + text container, whether it is a parent item with decedents, item without decedents, or child item.

Screen.Recording.2023-05-04.at.3.37.40.PM.mov

@paulcpederson paulcpederson added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels May 5, 2023
jcfranco pushed a commit that referenced this issue May 6, 2023
#6926)

**Related Issue:** #6912, #6444, #6509

## Summary

Updates the interaction model of trees to adhere to the [new
design](https://www.figma.com/file/R0B6ljDBIyKPtEa5GXjSjx/Tree-%5Bparent%2Fchildren-selection%5D-%5B6912%5D?node-id=1-76826&t=GOElQQiBF6PkKrgN-0).
The key changes to the interaction model are:

1. Tree items will expand when they are clicked (#6444)
2. Child selection modes will not automatically display all children of
a selected item as selected (#6912)
3. Clicking a slotted action inside a tree item will not select the tree
item (#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.
@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 2 - in development Issues that are actively being worked on. labels May 6, 2023
@geospatialem geospatialem added ready for dev Issues ready for development implementation. and removed design Issues that need design consultation prior to development. labels May 6, 2023
@geospatialem
Copy link
Member

Verified in 1.4.0-next.10 with selection-mode="children".

Note: To ensure the PR made the upcoming release the hover states above were not part of the effort, but will be added to a future upcoming milestone.

verify-tree-parent-selection-does-not-select-children

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Online Issues logged by ArcGIS Online team members. c-tree Issues that pertain to the calcite-tree and related components design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 5 A few days of work, definitely requires updates to tests. impact - p1 - need for current milestone User set priority impact status of p1 - need for current milestone p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.
Projects
None yet
Development

No branches or pull requests

6 participants