feat(react-toolbar): expose base hooks and types for Toolbar components#35903
Merged
dmytrokirpa merged 3 commits intomicrosoft:masterfrom Apr 21, 2026
Merged
Conversation
📊 Bundle size report
Unchanged fixtures
|
|
Pull request demo site: URL |
fc76df2 to
80ea1e9
Compare
1 task
aff6b2a to
51bf3d3
Compare
layershifter
requested changes
Apr 20, 2026
Member
layershifter
left a comment
There was a problem hiding this comment.
Default vs user props overrides
It's a bit tricky to review these changes as a small change in order could break things. As we have already faced regressions before (#35710), please cover matching changes with UTs (use linked PR for reference)
Thx
51bf3d3 to
16640c7
Compare
layershifter
added a commit
to layershifter/office-ui-fabric-react
that referenced
this pull request
Apr 21, 2026
…utput Adds the test cases flagged during review of PR microsoft#35903: - useToolbarButton: pin current behavior that user-supplied `size` is dropped (hard-forced to 'medium') while `shape` propagates through. If either changes, the assertion flips. - useToolbar: assert `aria-orientation` is omitted for horizontal toolbars and confirm Tabster arrow-navigation attributes are present on the root of the non-base hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
layershifter
added a commit
to layershifter/office-ui-fabric-react
that referenced
this pull request
Apr 21, 2026
…utput Adds the test cases flagged during review of PR microsoft#35903: - useToolbarButton: pin current behavior that user-supplied `size` is dropped (hard-forced to 'medium') while `shape` propagates through. If either changes, the assertion flips. - useToolbar: assert `aria-orientation` is omitted for horizontal toolbars and confirm Tabster arrow-navigation attributes are present on the root of the non-base hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
layershifter
added a commit
to layershifter/office-ui-fabric-react
that referenced
this pull request
Apr 21, 2026
Cherry-picks the test files from PR microsoft#35903 (excluding production code changes). Two ToolbarToggleButton assertions are adjusted to match current master behavior rather than the PR's fixed behavior — these document the spread-order bug where useToggleButton_unstable's 'secondary' default overrides the toolbar's 'subtle' default and suppresses user-supplied appearance. When the PR code lands, these assertions will need flipping, signalling the behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
layershifter
added a commit
to layershifter/office-ui-fabric-react
that referenced
this pull request
Apr 21, 2026
…utput Adds the test cases flagged during review of PR microsoft#35903: - useToolbarButton: pin current behavior that user-supplied `size` is dropped (hard-forced to 'medium') while `shape` propagates through. If either changes, the assertion flips. - useToolbar: assert `aria-orientation` is omitted for horizontal toolbars and confirm Tabster arrow-navigation attributes are present on the root of the non-base hook. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
layershifter
added a commit
to layershifter/office-ui-fabric-react
that referenced
this pull request
Apr 21, 2026
Adds the useToolbar test cases flagged during review of PR microsoft#35903: - `aria-orientation` is omitted on the root when the toolbar is horizontal. - The non-base hook wires Tabster arrow-navigation attributes onto the root; locked via inline snapshot so any upstream config change shows up in the diff. Size/shape overrides on ToolbarButton were considered but dropped — ToolbarButtonProps doesn't expose either prop, so asserting their runtime behavior would only pin implementation detail for an API that cannot be reached from TypeScript. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
|
@dmytrokirpa thx for adding tests, I merged them in #36021. Can you please rebase? Thx |
1024ec9 to
f8b3459
Compare
layershifter
approved these changes
Apr 21, 2026
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
useToolbarBase_unstable,ToolbarBaseProps,ToolbarBaseStateuseToolbarButtonBase_unstable,ToolbarButtonBaseProps,ToolbarButtonBaseStateuseToolbarDividerBase_unstable,ToolbarDividerBaseProps,ToolbarDividerBaseStateuseToolbarRadioButtonBase_unstable,ToolbarRadioButtonBaseProps,ToolbarRadioButtonBaseStateuseToolbarToggleButtonBase_unstable,ToolbarToggleButtonBaseProps,ToolbarToggleButtonBaseStaterenderToolbar_unstableto acceptToolbarBaseStateinstead ofToolbarState— the render only usesstate.root.childrenwhich is present in the base stateAll hooks and types were already implemented in the component source files (added in PR #35658) but gated behind comments in
index.ts.Tracking: #35562
🤖 Generated with Claude Code