Skip to content

feat: add TreeView Component#2191

Open
JoshMK wants to merge 26 commits intodevelopfrom
feat-tree
Open

feat: add TreeView Component#2191
JoshMK wants to merge 26 commits intodevelopfrom
feat-tree

Conversation

@JoshMK
Copy link
Contributor

@JoshMK JoshMK commented Jan 12, 2026

@JoshMK JoshMK changed the title Feat tree feat: add TreeView Component Jan 12, 2026
@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2191.d15792l1n26ww3.amplifyapp.com

@JoshMK JoshMK marked this pull request as ready for review January 13, 2026 23:56
@JoshMK JoshMK requested review from a team as code owners January 13, 2026 23:56
Copilot AI review requested due to automatic review settings January 13, 2026 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@dbjorge
Copy link
Contributor

dbjorge commented Jan 14, 2026

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.

@JoshMK
Copy link
Contributor Author

JoshMK commented Jan 14, 2026

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.

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.

2 participants