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

feat(treeview): add experimental controllable API #15397

Merged
merged 8 commits into from Feb 26, 2024

Conversation

janhassel
Copy link
Member

@janhassel janhassel commented Dec 15, 2023

Ref #14451 / Point 1

This PR introduces an experimental controllable API for the TreeView to address point 1 mentioned in above linked discussion.

A user must opt-in via the feature flag enable-treeview-controllable.

Changelog

New

  • feature flag enable-treeview-controllable
  • TreeView props.onActivate to pass-through node's onToggle events
  • TreeNode props.defaultIsExpanded for uncontrolled mode

Changed

  • With above mentioned feature flag, the states selected and active can be controlled or uncontrolled based on the user's choice

Testing / Reviewing

  • Storybook
  • Test suites

@tay1orjones I wanted to implement the feature flag approach you shared a while back for this change. Is there any naming guidance for these yet? I avoided v12 directly and essentially followed this structure:

enable-[component]-[feature]

Let me know what you think!

Copy link

netlify bot commented Dec 15, 2023

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 74c9709
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/65d309c8c1b4d00008ad2336
😎 Deploy Preview https://deploy-preview-15397--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@janhassel janhassel marked this pull request as ready for review December 22, 2023 10:09
@janhassel janhassel requested review from a team as code owners December 22, 2023 10:09
@janhassel
Copy link
Member Author

@tay1orjones @emyarod Let me know if you have any questions around this!

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

Hey this looks really solid! Sorry it took so long for a review 😓

I think the feature flag name is good - so far the loose (undocumented) thinking I have on it is v12-* flags are committed to be turned on by default in the next major. We could always rename this flag if/when we think that's the case, but in the meantime I think naming it as is feels appropriate.

@alisonjoseph
Copy link
Member

This LGTM! @emyarod do you have a chance to give this a review before we merge?

@tay1orjones tay1orjones added this pull request to the merge queue Feb 26, 2024
Merged via the queue into carbon-design-system:main with commit b6710e7 Feb 26, 2024
21 checks passed
@janhassel janhassel deleted the 14451-1 branch February 26, 2024 15:20
mHuzefa pushed a commit to mHuzefa/carbon that referenced this pull request Feb 27, 2024
…em#15397)

Co-authored-by: Andrea N. Cardona <cardona.n.andrea@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants