Conversation
|
✅ Deploy Preview for astro-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for astro-stencil ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull Request Overview
Demonstrates independent selection behavior for multiple tree instances by scoping selection logic to each rux-tree, adds a sample in index.html, and covers the change with a new Playwright test.
- Scope selection handling to the current tree element rather than the entire document
- Add a side-by-side example of two trees in the documentation
- Introduce a Playwright test to verify independent selections across multiple trees
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/web-components/src/index.html | Added a section showing two rux-tree instances side-by-side to illustrate independent selections |
| packages/web-components/src/components/rux-tree/test/tree.spec.ts | Added a new test (allows independent selections across multiple trees) to validate selection isolation |
| packages/web-components/src/components/rux-tree/rux-tree.tsx | Updated _handleNodeSelected to query only nodes within the current tree (this.el) instead of document |
Comments suppressed due to low confidence (2)
packages/web-components/src/components/rux-tree/rux-tree.tsx:54
- [nitpick] The variable name
allNodesis ambiguous; consider renaming it totreeNodesorlocalNodesto clarify that it only refers to nodes within this tree instance.
const allNodes = this.el.querySelectorAll('rux-tree-node')
packages/web-components/src/index.html:111
- Add an
aria-label(or similar accessible name) to eachrux-treeto distinguish them for assistive technologies, e.g.,aria-label="Navigation Tree"andaria-label="File System Tree".
<rux-tree>
Brief Description
We want to allow selections to stay active when there are multiple trees on a page.
JIRA Link
https://rocketcom.atlassian.net/jira/software/projects/AP/boards/119?assignee=712020%3A6a79a1e3-7381-4656-9516-c09792ad18be%2C60e2c268bd7f5d006886d1bf%2C712020%3A58e256f4-325a-4523-ae75-89831b3bbeab&selectedIssue=AP-561
Related Issue
General Notes
Run the below command from the
web-componentsdirectory to run just the tree testsnpx playwright test src/components/rux-tree/test/tree.spec.ts
There are two trees in the index.html playground you can test locally with
npm run startfrom theweb-components directoryMotivation and Context
This came from a git hub issue report.
#1407
Issues and Limitations
Types of changes
Checklist