You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(react-tree): add design-free base hooks for Tree and TreeItemLayout - #36932
Tree behavior and TreeItemLayout state were coupled to Fluent design defaults, Fluent selector components, collapse motion, and Tabster focus management, preventing reuse as design-free primitives.
New Behavior
Adds useTreeBase_unstable and useTreeItemLayoutBase_unstable with base props/state types. The base Tree uses plain DOM focus tracking and navigation, omits design-only motion, and removes closed subtrees; the base layout uses native checkbox/radio inputs and leaves expand-icon content empty. Existing styled components retain their Fluent defaults and Tabster behavior. Includes tests for both base and styled behavior.
Pin the styled behavior that the upcoming base hooks extraction must preserve:
roving tab index, arrow/Home/End/type-ahead navigation, branch open/close,
closed subtrees not rendering, the Collapse motion on subtrees, design
defaults, the Fluent Checkbox/Radio selector, the chevron expand icon,
Tabster arrow navigation on actions and the small button context.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M9WfDGcoZcv2FA37mMYqmP
Add useTreeBase_unstable and useTreeItemLayoutBase_unstable, free of Tabster,
motion and Fluent design components, so they can back a headless Tree.
- Tree: the base hook drops appearance/size and the Collapse motion, drives the
roving tab index from plain DOM focus events and finds focusable actions
with a DOM query. Closed subtrees are not rendered without a collapse motion.
useTree_unstable wraps it, re-adding Tabster focus handling, the Collapse
motion and the design props.
- TreeItemLayout: the base hook renders a native checkbox/radio selector, no
default expand icon content, no Tabster arrow navigation on the actions and
no button context. useTreeItemLayout_unstable layers those back on.
- useTreeContextValues_unstable, renderTree_unstable and
renderTreeItemLayout_unstable accept the base state.
- Export the base types and the TreeItemLayout action slot types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M9WfDGcoZcv2FA37mMYqmP
Dmytro Kirpa (dmytrokirpa)
changed the title
Claude/sharp meitner y7rifz tree base
feat(react-tree): add design-free base hooks for Tree and TreeItemLayout
Oct 19, 2026
This bubbling document listener misses focus changes when a consumer stops propagation, for example with onFocus={event => event.stopPropagation()} on the base Tree. Programmatically focusing the third item then leaves the first item at tabIndex=0 and the focused item at -1, so re-entering the tree returns to the wrong item. Subscribe in the capture phase so tracking runs before consumer bubbling handlers, and use the same option for cleanup.
The base layout's actions role is consumer-overridable: slot.optional lets actions.role replace the default toolbar role. With actions={{ role: 'group', visible: true, ... }}, an unstyled layout matches neither selector here. In treegrid mode ArrowRight cannot enter its actions, and ArrowLeft from an action cannot return to the same item through the actions-navigation branch. Identify the actions slot with a stable internal marker or registered element reference rather than its customizable ARIA role.
- Reference count a single keyboard modality tracker per document instead
of installing document listeners for every base TreeItemLayout with actions
- Stop propagating actions.visible and actions.onVisibilityChange to the DOM
- Set inert through a ref in the treegrid test, as React 17 and 18 drop it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useTree_unstable called useFocusFinders for every nested subtree even though
only the root tree drives navigation. Pass the navigation options as a hook
that only the root branch invokes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0128HHjJ1oVRApVhfbatcMe1
This branch has not been deployed
No deployments
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
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.
Previous Behavior
Tree behavior and TreeItemLayout state were coupled to Fluent design defaults, Fluent selector components, collapse motion, and Tabster focus management, preventing reuse as design-free primitives.
New Behavior
Adds
useTreeBase_unstableanduseTreeItemLayoutBase_unstablewith base props/state types. The base Tree uses plain DOM focus tracking and navigation, omits design-only motion, and removes closed subtrees; the base layout uses native checkbox/radio inputs and leaves expand-icon content empty. Existing styled components retain their Fluent defaults and Tabster behavior. Includes tests for both base and styled behavior.Related Issue(s)