Revert "perf(TreeView): replace O(n) TreeWalker with O(depth) sibling traversal"#7659
Conversation
… travers…" This reverts commit 63bfd67.
|
|
There was a problem hiding this comment.
Pull request overview
This PR reverts PR #7544, which replaced the TreeWalker-based O(n) navigation in getVisibleElement with an O(depth) sibling traversal approach. The revert was triggered by failing integration tests discovered after the original PR was merged.
Changes:
- Restores the original
TreeWalker-based implementation ofgetVisibleElementinuseRovingTabIndex.ts, removing all the helper functions (getNextVisibleElement,getPreviousVisibleElement,getDeepestLastDescendant, etc.) that were introduced in #7544. - Removes the test asserting that collapsed subtree children are not rendered in the DOM, which was added alongside the sibling traversal approach.
- Deletes the changeset file for the reverted change.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/react/src/TreeView/useRovingTabIndex.ts |
Reverts getVisibleElement back to the TreeWalker-based implementation |
packages/react/src/TreeView/TreeView.test.tsx |
Removes the test for collapsed subtree DOM rendering added in #7544 |
.changeset/treeview-sibling-traversal.md |
Deletes the changeset for the reverted change |
You can also share your feedback on Copilot code review. Take the survey.
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/15939 |
Reverts #7544
Found failing checks in integration testing, reverting