feat(ui): add accessible VS Code-parity Tree - #1065
Draft
EhabY wants to merge 3 commits into
Draft
Conversation
EhabY
force-pushed
the
feat/ui-tree-suite
branch
from
August 5, 2026 14:11
510e466 to
309f05d
Compare
EhabY
force-pushed
the
feat/ui-tree-suite
branch
9 times, most recently
from
August 12, 2026 13:23
65c0990 to
efc2a15
Compare
Tree and TreeItem components with ARIA tree semantics, roving tabindex, hierarchy navigation, buffered type-ahead, multi-select, sticky scroll, and VS Code-parity styling across the shared, Modern, and stable styles. Collapsed branches unmount and row re-renders are scoped to the rows that changed. Review hardening is folded in: range-anchor seeding, selection-echo tab stop handling, modifier clicks that never toggle expansion, sticky backgrounds only while pinned, React 19 ref cleanups, Shift+Home/End ranges, Escape to clear, and Ctrl+Shift+A passthrough. Closes #1037
EhabY
force-pushed
the
feat/ui-tree-suite
branch
6 times, most recently
from
August 12, 2026 16:44
1297bb2 to
2daa1c2
Compare
Tree now takes nodes plus expandedIds instead of composed TreeItem children, and renders every visible node as a flat sibling row with declared aria-level, posinset, and setsize, the projection VS Code, react-arborist, and headless-tree converged on. treeModel.ts owns the projection; order, visibility, and hierarchy derive from data, so the store's DOM queries, the item registry, the hierarchy context, and the subtree-commit reconcile all disappear, and refs forward natively. The folder splits by concern: store/ for interaction state, sticky/ for pinning, with per-part unit tests. Sticky scroll becomes a widget with VS Code semantics: a pinned-count cap (stickyScrollMaxItemCount), a 40% viewport cap, per-level indentation with twisties, the deepest row sliding out as its subtree ends, scroll and resize tracking, click to reveal and focus the real row, and the twistie collapsing the pinned branch in place. The pure math lives in stickyState.ts. PageUp/PageDown move focus by the scroller's viewport in rows, with Shift extending the selection like the other navigation keys. Benchmarks, 5,020 expanded rows in jsdom with the React Compiler, median of three: mount 965ms to 695ms, 20 arrow keydowns 249ms to 89ms. Virtualization, if ever needed, is a windowed slice over the same projection.
EhabY
force-pushed
the
feat/ui-tree-suite
branch
from
August 12, 2026 16:56
2daa1c2 to
d794977
Compare
EhabY
force-pushed
the
feat/ui-tree-suite
branch
from
August 13, 2026 13:03
3a55395 to
3fe1ebe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a controlled, accessible
Treecomponent to@repo/uiwith current VS Code workbench behavior and visuals.aria-activedescendantCloses #1037
Architecture
treeModel.ts,treePolicy.ts, andtreeTransition.tsare pure.useTreeAdapter.tsis the thin React and DOM boundary. Rendering stays split between normal rows and sticky behavior rather than placing all state and behavior in one component.The flat visible model supports future windowing, but this Tree is not currently virtualized.
Diff composition
Measured against
origin/main...HEADwithgit diff --numstat:Production source to automated test code is approximately 1.06:1. Counting stories and visual fixtures as test support gives 1,832 production lines to 2,082 test and visual verification lines.
Performance
Measured in development-mode jsdom against the first data-driven architecture at
d794977:These are relative development-mode measurements, not browser frame-time guarantees.
Validation
pnpm test:webview --reporter=dot: 45 files, 381 tests passedpnpm typecheckpnpm format:checkpnpm storybook:cigit diff --checkImplementation plan and decisions
This pull request description was updated by Coder Agents on behalf of @EhabY.