Skip to content

[dev-v5] Add Toast #4584

Open
vnbaaij wants to merge 25 commits intodev-v5from
users/vnbaaij/dev-v5/toast-part1
Open

[dev-v5] Add Toast #4584
vnbaaij wants to merge 25 commits intodev-v5from
users/vnbaaij/dev-v5/toast-part1

Conversation

@vnbaaij
Copy link
Copy Markdown
Collaborator

@vnbaaij vnbaaij commented Feb 27, 2026

Summary

This PR adds a feature complete Toast experience to the library, expanding both the component model and service API to support modern notification scenarios, including live-updating progress toasts.

progress toasts

Capabilities

Toast types

The library supports toast scenarios through ToastType:
• Communication
• Confirmation
• IndeterminateProgress
• DeterminateProgress

This makes it easy to model toast behavior and presentation according to Fluent guidance. See the added documentation in the demo site to get an overview of what the different types are and how they should be used.

Custom icon support

Toasts can display a custom icon through the Icon parameter and matching Icon setting.
This allows library consumers to provide icons that better match their scenario instead of relying just on intent-based defaults.

Live toast instance access

The ShowToastAsync(...) API is available for the common fire-and-forget / await-result scenario.

An additional API has been implemented to make advanced toast scenarios easier:
ShowToastInstanceAsync(ToastOptions? options = null)
ShowToastInstanceAsync(Action<ToastOptions> options)

These methods return the live IToastInstance, making it possible to:
• update a toast while it is visible
• dismiss or close it programmatically
• await its final result when needed

Rich body content for progress scenarios

Toasts can use BodyContent as the mechanism for rich, dynamic body content.
This enables scenarios such as embedding a FluentProgressBar inside the toast body and updating that content over time through:
IToastInstance.UpdateAsync(...)
IToastService.UpdateToastAsync(...)

Lifecycle clarity

Toast lifecycle tracking is clearly expressed through ToastLifecycleStatus, making status transitions explicit and easy to consume from callbacks and tests.

Behavior and UX support

Queueing and provider behavior

The toast provider manages:
• maximum visible toast count
• queue promotion
• position and offsets
• hover pause and window-blur pause
• lifecycle-driven rendering

Web component improvements

The underlying toast web component takes care of:
• animated open/close behavior
• consistent stacking and repositioning
• pause/resume timeout behavior
• accessibility updates based on intent and politeness
• event dispatch back to Blazor for lifecycle transitions

Developer experience

The toast API works well for both simple and advanced use cases:
• simple use case: call ShowToastAsync(...)
• advanced use case: call ShowToastInstanceAsync(...) and interact with the live toast instance

This especially improves scenarios such as upload/download notifications, long-running operations, and dynamic progress feedback.

Unit Tests

image

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 27, 2026

✅ All tests passed successfully

Details on your Workflow / Core Tests page.

@MarvinKlein1508 MarvinKlein1508 added this to the v5.0-RC2 milestone Mar 3, 2026
Copilot AI review requested due to automatic review settings March 18, 2026 15:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Initial WIP implementation of a new Toast component, introducing shared toast infrastructure, new toast variants, and client-side behavior to render/dismiss toasts.

Changes:

  • Added Toast core types (enums, options, instance/events) and refactored rendering to use a shared FluentToastComponentBase shell.
  • Implemented FluentToast and FluentProgressToast plus content components and styling.
  • Added a new web component (fluent-toast-b) implementation in Core.Scripts and registered it at startup; added initial demo/docs scaffolding.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
tests/Core/Components/Toast/FluentToastTests.razor Minor edit in Toast test scaffold (using directive line).
src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj Adds a Properties\ folder entry to the project.
src/Core/Events/DialogToggleEventArgs.cs Makes DialogToggleEventArgs public (now part of public API surface).
src/Core/Enums/ToastPosition.cs Adds toast position enum with Description mappings.
src/Core/Enums/ToastPoliteness.cs Adds politeness enum for live region behavior.
src/Core/Enums/ToastIntent.cs Adds intent enum used for visual/accessibility semantics.
src/Core/Components/Toast/Services/ToastService.cs Adjusts generic dispatch and restricts toast component types.
src/Core/Components/Toast/Services/ToastOptions.cs Adds timeout option for toasts.
src/Core/Components/Toast/Services/ToastInstance.cs Adds trimming annotations and generalizes stored toast component type.
src/Core/Components/Toast/Services/ToastEventArgs.cs Updates event args to work with new toast base component.
src/Core/Components/Toast/Services/IToastInstance.cs Adds trimming annotation to component type.
src/Core/Components/Toast/FluentToastProvider.razor.cs Uses DynamicComponent with parameters builder and toast-type validation; adds IL2111 suppression.
src/Core/Components/Toast/FluentToastProvider.razor Switches provider to DynamicComponent rendering; adds IL2111 suppression.
src/Core/Components/Toast/FluentToastContent.razor.cs Adds owned content component backing class for FluentToast.
src/Core/Components/Toast/FluentToastContent.razor Adds default visual template for FluentToast.
src/Core/Components/Toast/FluentToastComponentBase.razor.css Adds CSS for toast content layout.
src/Core/Components/Toast/FluentToastComponentBase.razor.cs Introduces shared toast base: shell rendering, toggle handling, service integration.
src/Core/Components/Toast/FluentToastComponentBase.razor Adds the fluent-toast-b host element and binds parameters/events.
src/Core/Components/Toast/FluentToast.razor.cs Removes old Razor-based FluentToast component implementation.
src/Core/Components/Toast/FluentToast.razor Removes old Razor markup for toast wrapper.
src/Core/Components/Toast/FluentToast.cs Adds new code-based FluentToast built on the new base/shell.
src/Core/Components/Toast/FluentProgressToastContent.razor.cs Adds owned content component backing class for FluentProgressToast.
src/Core/Components/Toast/FluentProgressToastContent.razor Adds default visual template for progress toast.
src/Core/Components/Toast/FluentProgressToast.cs Adds new progress toast component built on the new base/shell.
src/Core.Scripts/src/Startup.ts Registers the new Toast web component in startup.
src/Core.Scripts/src/Components/Toast/FluentToast.ts Implements fluent-toast-b custom element (popover + stacking + timeout + a11y).
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/FluentToast.md Adds initial Toast documentation page.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/Examples/FluentToastDefault.razor Adds placeholder example file (currently empty).
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/DebugPages/DebugToastContent.razor Updates debug content markup to match new toast layout.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/DebugPages/DebugToast.razor Expands debug page with multiple toast scenarios using the toast service.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 24, 2026

Summary - Unit Tests Code Coverage

Summary
Generated on: 03/30/2026 - 12:57:00
Coverage date: 03/30/2026 - 12:56:32
Parser: Cobertura
Assemblies: 1
Classes: 231
Files: 319
Line coverage: 98.9% (9775 of 9874)
Covered lines: 9775
Uncovered lines: 99
Coverable lines: 9874
Total lines: 35184
Branch coverage: 92.6% (4783 of 5162)
Covered branches: 4783
Total branches: 5162
Method coverage: Feature is only available for sponsors
Tag: 5739_23745720598

Coverage

Microsoft.FluentUI.AspNetCore.Components - 98.9%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 98.9% 92.6%
Microsoft.FluentUI.AspNetCore.Components.AccordionItemEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.AdditionalAttributesExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.CachedServices 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarExtended 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarTitles`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Calendar.CalendarTValue 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnBase`1 97.2% 90.2%
Microsoft.FluentUI.AspNetCore.Components.ColumnKeyGridSort`1 94.4% 75%
Microsoft.FluentUI.AspNetCore.Components.ColumnOptionsUISettings 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnResizeOptions`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnResizeUISettings 100%
Microsoft.FluentUI.AspNetCore.Components.ColumnSortUISettings 100%
Microsoft.FluentUI.AspNetCore.Components.CustomEmoji 100% 100%
Microsoft.FluentUI.AspNetCore.Components.CustomIcon 100%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.Defer 100%
Microsoft.FluentUI.AspNetCore.Components.DataGrid.Infrastructure.InternalGr
idContext`1
100% 100%
Microsoft.FluentUI.AspNetCore.Components.DataGridSortEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.DateTimeProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DateTimeProviderContext 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.DefaultStyles 100%
Microsoft.FluentUI.AspNetCore.Components.Dialog.MessageBox.FluentMessageBox 100% 75%
Microsoft.FluentUI.AspNetCore.Components.DialogEventArgs 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.DialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptions 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsFooterAction 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogOptionsHeader 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult 100% 100%
Microsoft.FluentUI.AspNetCore.Components.DialogResult`1 100%
Microsoft.FluentUI.AspNetCore.Components.DialogService 100% 82.3%
Microsoft.FluentUI.AspNetCore.Components.DialogToggleEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.DropdownEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.Emoji 100% 100%
Microsoft.FluentUI.AspNetCore.Components.EmojiCompress 100% 100%
Microsoft.FluentUI.AspNetCore.Components.EmojiExtensions 100% 50%
Microsoft.FluentUI.AspNetCore.Components.EmojiInfo 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.DateTimeExtensions 98.4% 90.3%
Microsoft.FluentUI.AspNetCore.Components.Extensions.DisplayAttributeExtensi
ons
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.EnumExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FieldSizeExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Extensions.FluentInputExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FileSizeConverter 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordion 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAccordionItem 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentAnchorButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBar 97.4% 97.6%
Microsoft.FluentUI.AspNetCore.Components.FluentAppBarItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentAvatar 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentBadge 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentButton 98.4% 90.6%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendar`1 97.4% 86.8%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarBase`1 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarDay`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarMonth`1 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentCalendarYear`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCard 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCheckbox 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCombobox`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentComponentBase 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCompoundButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentCounterBadge 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGrid`1 92.5% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1 100% 95.6%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridRow`1 98.5% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDatePicker`1 97.4% 85.2%
Microsoft.FluentUI.AspNetCore.Components.FluentDialog 97.5% 89.3%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogBody 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDialogProvider 100% 73.9%
Microsoft.FluentUI.AspNetCore.Components.FluentDivider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDragContainer`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDragEventArgs`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentDropZone`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentEmoji`1 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentErrorBoundary 95.3% 93.7%
Microsoft.FluentUI.AspNetCore.Components.FluentField 100% 96.5%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldCondition 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldConditionItem 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldConditionOptions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentFieldParameterSelector 100% 98.7%
Microsoft.FluentUI.AspNetCore.Components.FluentGrid 100% 90%
Microsoft.FluentUI.AspNetCore.Components.FluentGridItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentHighlighter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentIcon`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentImage 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputBase`1 93.8% 50%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFile 100% 93.3%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileBuffer 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileErrorEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputFileEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentInputImmediateBase`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentJSModule 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCode 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeEventArgs 100% 75%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyCodeProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentKeyPressEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLabel 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLayout 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutHamburger 100% 96.6%
Microsoft.FluentUI.AspNetCore.Components.FluentLayoutItem 100% 91%
Microsoft.FluentUI.AspNetCore.Components.FluentLink 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentListBase`2 97.7% 89.1%
Microsoft.FluentUI.AspNetCore.Components.FluentListbox`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.FluentLocalizerInternal 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMenu 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuButton 100% 71.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuItem 100% 90.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMenuList 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMessageBar 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitter 100% 93.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterPane 100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterResizeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNav 100% 95.4%
Microsoft.FluentUI.AspNetCore.Components.FluentNavBase 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNavCategory 97.8% 92.1%
Microsoft.FluentUI.AspNetCore.Components.FluentNavItem 100% 89.7%
Microsoft.FluentUI.AspNetCore.Components.FluentNavSectionHeader 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOption`1 96% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentOptionString 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflow 100% 95.8%
Microsoft.FluentUI.AspNetCore.Components.FluentOverflowItem 100% 80%
Microsoft.FluentUI.AspNetCore.Components.FluentOverlay 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPaginator 100% 94.4%
Microsoft.FluentUI.AspNetCore.Components.FluentPopover 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPresenceBadge 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProgress 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProgressBar 100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.FluentProgressRing 100%
Microsoft.FluentUI.AspNetCore.Components.FluentProviders 100%
Microsoft.FluentUI.AspNetCore.Components.FluentPullToRefresh 100% 96.7%
Microsoft.FluentUI.AspNetCore.Components.FluentRadio`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentRadioGroup`1 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.FluentRatingDisplay 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSelect`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceBase`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentServiceProviderException`1 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSkeleton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSlider`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableList`1 95.8% 92.3%
Microsoft.FluentUI.AspNetCore.Components.FluentSortableListEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSpacer 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSpinner 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSplitButton 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentStack 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentStatus 100%
Microsoft.FluentUI.AspNetCore.Components.FluentSwitch 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTab 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTabs 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentText 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTextArea 100% 70%
Microsoft.FluentUI.AspNetCore.Components.FluentTextInput 100% 85%
Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker`1 100% 81.1%
Microsoft.FluentUI.AspNetCore.Components.FluentToast 100% 92%
Microsoft.FluentUI.AspNetCore.Components.FluentToastProvider 100% 92.8%
Microsoft.FluentUI.AspNetCore.Components.FluentToggleButton 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltip 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentTooltipProvider 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeItem 100% 95.3%
Microsoft.FluentUI.AspNetCore.Components.FluentTreeView 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentValidationSummary 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FreeOptionOutput 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderRequest`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult 100%
Microsoft.FluentUI.AspNetCore.Components.GridItemsProviderResult`1 100%
Microsoft.FluentUI.AspNetCore.Components.GridSort`1 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalGridItem`2 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalGridUtilities 100% 100%
Microsoft.FluentUI.AspNetCore.Components.HierarchicalSelectColumn`1 98.8% 95.5%
Microsoft.FluentUI.AspNetCore.Components.HighlighterSplitter 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Icon 100% 95%
Microsoft.FluentUI.AspNetCore.Components.IconFromImage 100%
Microsoft.FluentUI.AspNetCore.Components.IconInfo 100%
Microsoft.FluentUI.AspNetCore.Components.IconsExtensions 100% 50%
Microsoft.FluentUI.AspNetCore.Components.IFluentComponentChangeAfterKeyPres
s
100% 100%
Microsoft.FluentUI.AspNetCore.Components.IFluentLocalizer 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
ibable`1
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Infrastructure.EventCallbackSubscr
iber`1
100% 87.5%
Microsoft.FluentUI.AspNetCore.Components.InputFileInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.InputFileOptions 100%
Microsoft.FluentUI.AspNetCore.Components.InternalAppBarContext 100% 100%
Microsoft.FluentUI.AspNetCore.Components.InternalListContext`1 100%
Microsoft.FluentUI.AspNetCore.Components.KeyCodeService 100% 85.7%
Microsoft.FluentUI.AspNetCore.Components.KeyPress 100%
Microsoft.FluentUI.AspNetCore.Components.LayoutHamburgerEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.LibraryTooltipOptions 100%
Microsoft.FluentUI.AspNetCore.Components.Localization.LanguageResource 100% 100%
Microsoft.FluentUI.AspNetCore.Components.MarkupSanitizedOptions 100%
Microsoft.FluentUI.AspNetCore.Components.MenuItemEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.MessageBoxOptions 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.AppearanceExtensions 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.FluentInputAppearanceExt
ensions
100% 100%
Microsoft.FluentUI.AspNetCore.Components.Migration.TooltipPositionExtension 100% 100%
Microsoft.FluentUI.AspNetCore.Components.PaginationState 100% 81.2%
Microsoft.FluentUI.AspNetCore.Components.ProgressFileDetails 100%
Microsoft.FluentUI.AspNetCore.Components.PropertyColumn`2 100% 81.8%
Microsoft.FluentUI.AspNetCore.Components.RadioEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.RangeOfDates 100% 100%
Microsoft.FluentUI.AspNetCore.Components.SelectAllTemplateArgs 100%
Microsoft.FluentUI.AspNetCore.Components.SelectColumn`1 92.8% 88.9%
Microsoft.FluentUI.AspNetCore.Components.ServiceProviderExtensions 100%
Microsoft.FluentUI.AspNetCore.Components.SortedProperty 100%
Microsoft.FluentUI.AspNetCore.Components.SpacingExtensions 100% 97.2%
Microsoft.FluentUI.AspNetCore.Components.TabChangeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TemplateColumn`1 100% 25%
Microsoft.FluentUI.AspNetCore.Components.Theme 100% 80%
Microsoft.FluentUI.AspNetCore.Components.ThemeExtensions 94.7% 87.5%
Microsoft.FluentUI.AspNetCore.Components.ThemeService 100% 88.8%
Microsoft.FluentUI.AspNetCore.Components.ThemeSettings 100%
Microsoft.FluentUI.AspNetCore.Components.ToastEventArgs 100% 90%
Microsoft.FluentUI.AspNetCore.Components.ToastInstance 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ToastOptions 100%
Microsoft.FluentUI.AspNetCore.Components.ToastService 100% 90%
Microsoft.FluentUI.AspNetCore.Components.TooltipEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TotalItemCountChangedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TreeItemChangedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.TreeViewItem 100% 100%
Microsoft.FluentUI.AspNetCore.Components.TreeViewItemExpandedEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.UploadedFileDetails 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.AddTag 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.CssBuilder 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Debounce 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.Identifier 100% 100%
Microsoft.FluentUI.AspNetCore.Components.Utilities.IdentifierContext 100% 75%
Microsoft.FluentUI.AspNetCore.Components.Utilities.InlineStyleBuilder 100% 91.6%
Microsoft.FluentUI.AspNetCore.Components.Utilities.MarkupStringSanitized 100% 92.5%
Microsoft.FluentUI.AspNetCore.Components.Utilities.RangeOf`1 96.7% 97.2%
Microsoft.FluentUI.AspNetCore.Components.Utilities.StyleBuilder 100% 100%
Microsoft.FluentUI.AspNetCore.Components.ZIndex 100%

@vnbaaij vnbaaij changed the title [dev-v5] Initial work to add Toast [dev-v5] Add Toast Mar 25, 2026
@vnbaaij vnbaaij requested a review from Copilot March 27, 2026 16:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new “feature complete” Toast system across the Blazor component model, service APIs, provider behavior, underlying web component, docs, and tests—enabling richer notification scenarios including live-updating progress toasts.

Changes:

  • Replaces the old toast result/content-component model with a ToastService API that returns ToastCloseReason and can return a live IToastInstance for updates/dismissal.
  • Introduces a new FluentToastProvider queueing/visibility model and a new <fluent-toast-b> web component with stacking, animations, pause/resume timeout, and accessibility behavior.
  • Adds/updates extensive unit tests and demo documentation/examples for the new toast experience.

Reviewed changes

Copilot reviewed 37 out of 38 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/Core/Verify/FluentAssertOptions.cs Updates verify scrubber to ignore new ARIA attributes in rendered markup.
tests/Core/Components/Toast/ToastInstanceTests.razor Adds unit tests for new ToastInstance/ToastService behaviors.
tests/Core/Components/Toast/Templates/ToastWithInstance.razor Removes old template-based toast instance test component.
tests/Core/Components/Toast/Templates/ToastRenderOptions.cs Removes old render-options class used by the previous toast templating model.
tests/Core/Components/Toast/Templates/ToastRender.razor Removes old template-based toast rendering test component.
tests/Core/Components/Toast/FluentToastTests.razor Reworks tests to validate the new toast API, lifecycle, rendering, actions, and updates.
tests/Core/Components/Toast/FluentToastTests.FluentToast_Render.verified.razor.html Removes snapshot tied to the previous toast rendering approach.
tests/Core/Components/Toast/FluentToastProviderTests.razor Adds new tests for provider defaults, queueing, and ordering.
src/Core/Properties/AssemblyInfo.cs Adds InternalsVisibleTo to allow test access to internal members.
src/Core/Events/ToastEventArgs.cs Switches from dialog state mapping to toast lifecycle status mapping.
src/Core/Events/DialogToggleEventArgs.cs Makes toggle args public so they can be used in public APIs.
src/Core/Enums/ToastType.cs Introduces toast types (communication/confirmation/progress).
src/Core/Enums/ToastPosition.cs Adds toast placement options with attribute descriptions.
src/Core/Enums/ToastPoliteness.cs Adds ARIA politeness options for live region announcements.
src/Core/Enums/ToastLifecycleStatus.cs Adds explicit lifecycle statuses for queued/visible/dismissed/unmounted.
src/Core/Enums/ToastIntent.cs Adds semantic intent values (info/success/warning/error).
src/Core/Enums/ToastCloseReason.cs Adds close reasons returned to callers and used by lifecycle completion.
src/Core/Components/Toast/Services/ToastService.cs Refactors service API (show/dismiss/update/live instance) and lifecycle handling.
src/Core/Components/Toast/Services/ToastResult.cs Removes the old ToastResult typed result model.
src/Core/Components/Toast/Services/ToastOptions.cs Expands options with new UX/accessibility/action fields and updateable body content.
src/Core/Components/Toast/Services/ToastInstance.cs Refactors instance to support lifecycle tracking, close reasons, and updates.
src/Core/Components/Toast/Services/IToastService.cs Updates public API surface to new show/dismiss/update/live instance methods.
src/Core/Components/Toast/Services/IToastInstance.cs Updates instance contract to lifecycle + close-reason result + update API.
src/Core/Components/Toast/FluentToastProvider.razor.cs Adds provider queueing, default behaviors, and rendered-toast selection logic.
src/Core/Components/Toast/FluentToastProvider.razor Renders the new FluentToast with option-derived parameters and attributes.
src/Core/Components/Toast/FluentToastInstance.cs Removes the old FluentToastInstance base class used by template toasts.
src/Core/Components/Toast/FluentToast.razor.cs Adds lifecycle/status handling, action handlers, intent/icon mapping, and close completion logic.
src/Core/Components/Toast/FluentToast.razor Replaces old dynamic content rendering with the new <fluent-toast-b> host and slots.
src/Core/Components/MessageBar/FluentMessageBar.razor.cs Minor formatting cleanup (unrelated to toast behavior).
src/Core.Scripts/src/Startup.ts Registers the new Toast web component at startup.
src/Core.Scripts/src/Components/Toast/FluentToast.ts Adds the toast web component implementation (stacking, animations, timeout pause/resume, ARIA live behavior).
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/FluentToast.md Adds toast docs describing types, behavior, accessibility, and examples.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/Examples/FluentToastIndeterminateProgress.razor Adds an indeterminate progress toast example (service-driven).
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/Examples/FluentToastDeterminateProgress.razor Adds a determinate progress toast example using live instance updates.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/Examples/FluentToastDefault.razor Adds a default toast example with actions and status callback.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/Examples/FluentToastCustomDismiss.razor Adds a custom-dismiss example using a dismiss action link and callback.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/DebugPages/DebugToastContent.razor Removes old debug page tied to previous toast result/content approach.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Toast/DebugPages/DebugToast.razor Removes old debug page tied to generic component-to-toast rendering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vnbaaij
Copy link
Copy Markdown
Collaborator Author

vnbaaij commented Mar 27, 2026

@copilot apply changes based on the comments in this thread

@vnbaaij vnbaaij marked this pull request as ready for review March 27, 2026 17:54
@vnbaaij vnbaaij requested a review from dvoituron as a code owner March 27, 2026 17:54
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.

3 participants