feat: implement auto reflow for MessageBar layouts#29328
Merged
ling1726 merged 20 commits intomicrosoft:masterfrom Sep 29, 2023
Merged
feat: implement auto reflow for MessageBar layouts#29328ling1726 merged 20 commits intomicrosoft:masterfrom
ling1726 merged 20 commits intomicrosoft:masterfrom
Conversation
Adds an initial implementation of MessageBar that includes design for different intents and multiline handling.
…eat/initial-implementation
Collaborator
📊 Bundle size report🤖 This report was generated against b5f4971b4b04d5a02983ec472c4cc565ebd98d80 |
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 649 | 619 | 5000 | |
| Button | mount | 320 | 316 | 5000 | |
| Field | mount | 1086 | 1079 | 5000 | |
| FluentProvider | mount | 692 | 709 | 5000 | |
| FluentProviderWithTheme | mount | 73 | 86 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 63 | 60 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 69 | 71 | 10 | |
| InfoButton | mount | 10 | 16 | 5000 | |
| MakeStyles | mount | 861 | 856 | 50000 | |
| Persona | mount | 1719 | 1703 | 5000 | |
| SpinButton | mount | 1342 | 1354 | 5000 |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 7ccaa4f:
|
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: b5f4971b4b04d5a02983ec472c4cc565ebd98d80 (build) |
packages/react-components/react-message-bar-preview/stories/MessageBar/Reflow.stories.tsx
Outdated
Show resolved
Hide resolved
packages/react-components/react-message-bar-preview/stories/MessageBar/ManualLayout.stories.tsx
Show resolved
Hide resolved
packages/react-components/react-message-bar-preview/src/components/MessageBar/useMessageBar.ts
Outdated
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Outdated
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Outdated
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Show resolved
Hide resolved
.../react-components/react-message-bar-preview/src/components/MessageBar/useMessageBarReflow.ts
Show resolved
Hide resolved
layershifter
approved these changes
Sep 29, 2023
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.
Implements automatic reflow logic under the new layout option
auto. This will switch betweensinglelineandmultilinelayouts based on single line content overflow. According to the design spec, when the message content of the MessageBar wraps to a second linemultilinelayout should always be usedThe reflow is handled by a resize observer and setting

white-space: nowrapon the MessageBar to detect content overflow when the resize container observes eventsAddresses: #22579