Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new TreeView component to the Cauldron design system, enabling users to display and interact with hierarchical tree structures with support for single/multiple selection modes and custom actions.
Changes:
- Added TreeView component with TreeViewItem subcomponent supporting single/multiple selection modes
- Integrated react-aria-components library for accessibility features
- Added CSS styling for tree view with theme support
- Created comprehensive test coverage for TreeView functionality
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/styles/tree-view.css | CSS styles for TreeView component with light/dark theme support |
| packages/styles/index.css | Import statement for tree-view.css |
| packages/react/src/index.ts | Export statement for TreeView component |
| packages/react/src/components/TreeView/index.tsx | Main TreeView component definition |
| packages/react/src/components/TreeView/TreeViewItem.tsx | TreeViewItem subcomponent with selection handling |
| packages/react/src/components/TreeView/TreeView.test.tsx | Test suite for TreeView component |
| packages/react/src/components/Checkbox/index.tsx | Added onChangeToggle prop to Checkbox component |
| packages/react/package.json | Added react-aria-components dependency |
| package.json | Added packageManager field |
| docs/pages/components/TreeView.mdx | Documentation for TreeView component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
It'd be good to go back to design and clarify the expected behavior of the checkboxes - the figma doesn't clarify explicitly, but some of the examples it cites (eg, Fluent 2) use a pattern where selecting a parent would implicitly select all children, and unselecting a child would implicitly set the parent to either an indeterminate or unselected state (depending on if other siblings were still selected). adobe/react-spectrum#6589 suggests that it might be challenging to actually implement that ourselves without patching the spectrum tree view and that we'd likely prefer to wait for adobe/react-spectrum#8800 rather than implement it ourselves, but we should make sure that stakeholders/design are ok with the current behavior in the meantime. |
Good points, Dan. Also a quick technical note for anyone reviewing this: Adobe actually has two component libraries available that we can use - Spectrum and React Aria Components. I ended up choosing React Aria Components since unlike Spectrum, it doesn't make style assumptions and allows us to incorporate our existing Deque theming into new components. |
Closes:
https://github.com/dequelabs/axe-reports/issues/2952
#1290