Skip to content

Conversation

@ling1726
Copy link
Contributor

Adds the new limit prop to Toaster which will limit the number of visible toasts on the page.

This is done internally using a priority queue based on the creation date. This will also support toast priorities in the queue.

Addresses #27827

Adds the new `limit` prop to `Toaster` which will limit the number of
visible toasts on the page.

This is done internally using a priority queue based on the creation
date. This will also support toast priorities in the queue.

Addresses microsoft#27827
@ling1726 ling1726 marked this pull request as ready for review May 15, 2023 15:55
@ling1726 ling1726 requested a review from a team as a code owner May 15, 2023 15:55
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 15, 2023

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 69258af:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented May 15, 2023

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 91 90 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 703 721 5000
Button mount 378 373 5000
Field mount 1290 1306 5000
FluentProvider mount 913 908 5000
FluentProviderWithTheme mount 109 118 10
FluentProviderWithTheme virtual-rerender 91 90 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 116 109 10
InfoButton mount 15 24 5000
MakeStyles mount 1126 1098 50000
Persona mount 2047 2004 5000
SpinButton mount 1566 1577 5000

@size-auditor
Copy link

size-auditor bot commented May 15, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: bfd75793f7ec35cec23e0b4f785ededb82a0e1dd (build)

@fabricteam
Copy link
Collaborator

fabricteam commented May 15, 2023

📊 Bundle size report

Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
533 B
341 B
global-context
createContextSelector
560 B
352 B
react-accordion
Accordion (including children components)
86.064 kB
26.1 kB
react-alert
Alert
93.534 kB
22.497 kB
react-avatar
Avatar
57.754 kB
15.041 kB
react-avatar
AvatarGroup
15.632 kB
6.258 kB
react-avatar
AvatarGroupItem
73.968 kB
19.552 kB
react-badge
Badge
23.512 kB
7.197 kB
react-badge
CounterBadge
24.416 kB
7.506 kB
react-badge
PresenceBadge
32.094 kB
8.367 kB
react-button
Button
36.724 kB
9.458 kB
react-button
CompoundButton
43.873 kB
10.939 kB
react-button
MenuButton
41.411 kB
10.791 kB
react-button
SplitButton
49.635 kB
12.364 kB
react-button
ToggleButton
54.866 kB
11.367 kB
react-card
Card - All
86.061 kB
24.345 kB
react-card
Card
80.997 kB
22.895 kB
react-card
CardFooter
9.158 kB
3.844 kB
react-card
CardHeader
11.048 kB
4.538 kB
react-card
CardPreview
9.963 kB
4.192 kB
react-checkbox
Checkbox
34.268 kB
10.793 kB
react-combobox
Combobox (including child components)
87.251 kB
28.1 kB
react-combobox
Dropdown (including child components)
85.635 kB
27.697 kB
react-components
react-components: Button, FluentProvider & webLightTheme
64.855 kB
17.852 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
203.937 kB
57.086 kB
react-components
react-components: FluentProvider & webLightTheme
36.086 kB
11.9 kB
react-datepicker-compat
DatePicker Compat
220.303 kB
58.486 kB
react-dialog
Dialog (including children components)
90.972 kB
27.056 kB
react-divider
Divider
17.399 kB
6.298 kB
react-field
Field
18.864 kB
7.004 kB
react-image
Image
11.479 kB
4.573 kB
react-infobutton
InfoButton
127.977 kB
39.012 kB
react-infobutton
InfoLabel
131.26 kB
40 kB
react-input
Input
24.024 kB
7.682 kB
react-label
Label
10.104 kB
4.185 kB
react-link
Link
12.304 kB
5.061 kB
react-menu
Menu (including children components)
128.254 kB
39.184 kB
react-menu
Menu (including selectable components)
131.238 kB
39.7 kB
react-overflow
hooks only
11.214 kB
4.271 kB
react-persona
Persona
64.675 kB
16.968 kB
react-popover
Popover
114.969 kB
35.392 kB
react-portal
Portal
11.649 kB
4.262 kB
react-portal-compat
PortalCompatProvider
6.446 kB
2.186 kB
react-positioning
usePositioning
24.008 kB
8.798 kB
react-progress
ProgressBar
13.856 kB
5.434 kB
react-provider
FluentProvider
18.033 kB
6.666 kB
react-radio
Radio
27.282 kB
8.661 kB
react-radio
RadioGroup
11.312 kB
4.71 kB
react-select
Select
25.357 kB
8.798 kB
react-slider
Slider
34.164 kB
11.024 kB
react-spinbutton
SpinButton
33.934 kB
10.328 kB
react-spinner
Spinner
20.882 kB
6.798 kB
react-switch
Switch
29.806 kB
9.274 kB
react-table
DataGrid
147.583 kB
40.523 kB
react-table
Table (Primitives only)
44.348 kB
12.347 kB
react-table
Table as DataGrid
130.142 kB
33.083 kB
react-table
Table (Selection only)
78.056 kB
19.084 kB
react-table
Table (Sort only)
77.386 kB
18.896 kB
react-tags
Tag
21.687 kB
7.868 kB
react-text
Text - Default
12.492 kB
4.92 kB
react-text
Text - Wrappers
15.624 kB
5.232 kB
react-textarea
Textarea
27.451 kB
9.046 kB
react-tooltip
Tooltip
46.708 kB
16.376 kB
react-utilities
SSRProvider
180 B
159 B
🤖 This report was generated against bfd75793f7ec35cec23e0b4f785ededb82a0e1dd

@fabricteam
Copy link
Collaborator

fabricteam commented May 15, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@ling1726 ling1726 enabled auto-merge (squash) May 15, 2023 19:12
@ling1726 ling1726 merged commit bdc00a8 into microsoft:master May 15, 2023
pauseOnHover: boolean;
toasterId: ToasterId | undefined;
priority: number;
dispatchedAt: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be under Toast

@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/[email protected] has been released which incorporates this pull request.:tada:

Handy links:

@msft-fluent-ui-bot
Copy link
Collaborator

🎉@fluentui/[email protected] has been released which incorporates this pull request.:tada:

Handy links:

marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request May 18, 2023
* master: (24 commits)
  chore(react-tabster): upgrade tabster to v4.4.2 (microsoft#27540)
  feat(react-tags): Add TagGroup with context (microsoft#27886)
  applying package updates
  fix(react-infobutton): Add aria-owns to InfoLabel (microsoft#27834)
  fix(recipes-react-components): Add a FluentProvider to the local storybook (microsoft#27746)
  chore: update RFC template (microsoft#27880)
  applying package updates
  feat: implement Toaster offset (microsoft#27854)
  feat(react-drawer): create DrawerFooter component (microsoft#27583)
  Make getKey and selection props mutually exclusive (microsoft#24048)
  Added MIGRATION.md to the Breadcrumb (microsoft#27846)
  update Github CODEOWNERS file (microsoft#27849)
  feat(react-tags): make basic Tag a button instead of div (microsoft#27858)
  chore: add test-ssr script to v9 packages (microsoft#27690)
  chore(react-tree): exports TreeItemAside unstable (microsoft#27856)
  bugfix(react-dialog): removes unnecessary grid gaps (microsoft#27845)
  applying package updates
  fix(react-textarea): Don't remove outline when filled and disabled and apply correct disabled color to text (microsoft#27837)
  feat: Implement limit for toast stacking (microsoft#27848)
  Update README.md for fluent 2 theme to include import instructions (microsoft#27847)
  ...
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request May 18, 2023
* feat/drawer-header: (24 commits)
  chore(react-tabster): upgrade tabster to v4.4.2 (microsoft#27540)
  feat(react-tags): Add TagGroup with context (microsoft#27886)
  applying package updates
  fix(react-infobutton): Add aria-owns to InfoLabel (microsoft#27834)
  fix(recipes-react-components): Add a FluentProvider to the local storybook (microsoft#27746)
  chore: update RFC template (microsoft#27880)
  applying package updates
  feat: implement Toaster offset (microsoft#27854)
  feat(react-drawer): create DrawerFooter component (microsoft#27583)
  Make getKey and selection props mutually exclusive (microsoft#24048)
  fix: move style override to outside the component
  Added MIGRATION.md to the Breadcrumb (microsoft#27846)
  update Github CODEOWNERS file (microsoft#27849)
  feat(react-tags): make basic Tag a button instead of div (microsoft#27858)
  chore: add test-ssr script to v9 packages (microsoft#27690)
  chore(react-tree): exports TreeItemAside unstable (microsoft#27856)
  bugfix(react-dialog): removes unnecessary grid gaps (microsoft#27845)
  applying package updates
  fix(react-textarea): Don't remove outline when filled and disabled and apply correct disabled color to text (microsoft#27837)
  feat: Implement limit for toast stacking (microsoft#27848)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants