Skip to content

Add FluentValidationMessage#4472

Draft
vnbaaij wants to merge 18 commits intodev-v5from
users/vnbaaij/dev-v5/validation-message
Draft

Add FluentValidationMessage#4472
vnbaaij wants to merge 18 commits intodev-v5from
users/vnbaaij/dev-v5/validation-message

Conversation

@vnbaaij
Copy link
Copy Markdown
Collaborator

@vnbaaij vnbaaij commented Jan 20, 2026

With this PR you can use FluentValidationMessage to display the validation message like the standard Blazor ValidationMesage
Also, the FluentField has been adapted so the validation messages will be displayed in the message part of the field.

Unit Test need to be validated still

Move form code to codebehind
Process review comments
- Comment CSS to check if it can be deleted
- Do not fill MessageTemplate by default
- Make FieldCondition use FluentText for each messsage and use the 'message' slot (instead of div's with FluentTexts)
- Use correct style/color in FieldParameterCollection
- Use Parameter/Attribute/Default for TextInput Message
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 22, 2026

Unit Tests

  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_GetOptionValue_DefaultWhenTypesAreDifferent
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_Manual
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_OptionFunctions
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentSelectTests.FluentSelect_GetOptionValue_DefaultWhenTypesAreDifferent
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_Enum
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_Default
  • ❌[FAILED] Microsoft.FluentUI.AspNetCore.Components.Tests.Components.List.FluentListboxTests.FluentListbox_Label

Details on your Workflow / Core Tests page.

- Do not put each condition in its own message slot
- Update tests and verified files
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 22, 2026

Summary - Unit Tests Code Coverage

Summary
Generated on: 01/22/2026 - 14:39:39
Coverage date: 01/22/2026 - 14:39:30
Parser: Cobertura
Assemblies: 1
Classes: 214
Files: 299
Line coverage: 98.7% (7428 of 7520)
Covered lines: 7428
Uncovered lines: 92
Coverable lines: 7520
Total lines: 29191
Branch coverage: 92.4% (4210 of 4552)
Covered branches: 4210
Total branches: 4552
Method coverage: Feature is only available for sponsors
Tag: 5103_21252337621

Coverage

Microsoft.FluentUI.AspNetCore.Components - 98.7%
Name Line Branch
Microsoft.FluentUI.AspNetCore.Components 98.7% 92.4%
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.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 100% 92%
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 98.1% 88.3%
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 90.5% 88.5%
Microsoft.FluentUI.AspNetCore.Components.FluentDataGridCell`1 100% 95.2%
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% 76%
Microsoft.FluentUI.AspNetCore.Components.FluentEmoji`1 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentErrorBoundary 97.6% 93.7%
Microsoft.FluentUI.AspNetCore.Components.FluentField 100% 96.9%
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.FluentFieldParameterCollector 100% 97%
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 94% 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 90.6% 81%
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 94.4% 89.4%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterPane 98.5% 85%
Microsoft.FluentUI.AspNetCore.Components.FluentMultiSplitterResizeEventArgs 100%
Microsoft.FluentUI.AspNetCore.Components.FluentNav 100% 95%
Microsoft.FluentUI.AspNetCore.Components.FluentNavCategory 100% 96%
Microsoft.FluentUI.AspNetCore.Components.FluentNavItem 100% 90.3%
Microsoft.FluentUI.AspNetCore.Components.FluentNavSectionHeader 100% 100%
Microsoft.FluentUI.AspNetCore.Components.FluentOption`1 100% 100%
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.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 96.5% 76.4%
Microsoft.FluentUI.AspNetCore.Components.FluentTimePicker`1 100% 81.1%
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.FluentValidationMessage`1 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.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 97.3% 95.1%
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.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%

- Add more unit tests
@MarvinKlein1508 MarvinKlein1508 added this to the v5.0-RC2 milestone Mar 3, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 10:45
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

Adds a new FluentValidationMessage component (Fluent-styled equivalent to Blazor’s ValidationMessage) and updates FluentField to surface EditContext validation messages in the field’s message slot, alongside extensive test/snapshot and demo documentation updates.

Changes:

  • Introduce FluentValidationMessage<TValue> (+ styling) and unit tests.
  • Extend FluentField/IFluentField to track a bound expression/field and render EditContext validation messages in the message slot.
  • Update demos/docs and refresh many bUnit Verify snapshots impacted by the FluentField message rendering changes.

Reviewed changes

Copilot reviewed 74 out of 74 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/Core/Components/Switch/FluentSwitchTests.razor Tweaks label trimming to account for tabs in rendered markup.
tests/Core/Components/Switch/FluentSwitchTests.FluentSwitch_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Switch/FluentSwitchTests.FluentCheckbox_Required.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Switch/FluentSwitchTests.FluentCheckbox_ReadOnly.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Switch/FluentSwitchTests.FluentCheckbox_LabelTemplate.verified.razor.html Snapshot update reflecting new rendered structure/formatting.
tests/Core/Components/Slider/FluentSliderTests.FluentSlider_Slot_Thumb.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Slider/FluentSliderTests.FluentSlider_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioTests.FluentRadio_LabelWidth.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioTests.FluentRadio_LabelTemplate.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioTests.FluentRadio_Label.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioTests.FluentRadio_HorizontalOrientation.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioTests.FluentRadio_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioGroupTests.FluentRadioGroup_WithChildContent.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioGroupTests.FluentRadioGroup_Items.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Radio/FluentRadioGroupTests.FluentRadioGroup_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentSelectTests.FluentSelect_OptionFunctions.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentSelectTests.FluentSelect_Manual.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentSelectTests.FluentSelect_Label.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentSelectTests.FluentSelect_Enum.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentSelectTests.FluentSelect_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentComboboxTests.FluentCombobox_OptionFunctions.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentComboboxTests.FluentCombobox_Manual.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentComboboxTests.FluentCombobox_Label.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentComboboxTests.FluentCombobox_Enum.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/List/FluentComboboxTests.FluentCombobox_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Forms/FluentValidationMessageTests.cs Adds unit tests validating rendering, updates, precedence, and missing-EditContext behavior.
tests/Core/Components/Field/FluentFieldTests.razor Adds tests for validation-message integration and Field/For precedence scenarios.
tests/Core/Components/Field/FluentFieldTests.FluentField_Size-small.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_Size-medium.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_Size-large.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_Size-99.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_Size-[empty].verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageState-warning.verified.razor.html Snapshot update reflecting new message rendering behavior.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageState-success.verified.razor.html Snapshot update reflecting new message rendering behavior.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageState-error.verified.razor.html Snapshot update reflecting new message rendering behavior.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageState-99.verified.razor.html Snapshot update reflecting new message rendering behavior.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageState-[empty].verified.razor.html Snapshot update reflecting new message rendering behavior.
tests/Core/Components/Field/FluentFieldTests.FluentField_MessageIcon.verified.razor.html Snapshot update reflecting new message slot markup (wrapper + FluentText).
tests/Core/Components/Field/FluentFieldTests.FluentField_DefaultTemplate.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Field/FluentFieldTests.FluentField_Default.verified.razor.html Snapshot update reflecting new rendered structure/message behavior.
tests/Core/Components/Field/FluentFieldParameterCollectorTests.razor Renames/updates selector tests and adds ValueExpression tests.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Size-medium.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Size-large.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Size-999.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Size-[empty].verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_ShowIndeterminate.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Shape-square.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Shape-circular.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Shape-999.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Shape-[empty].verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_LabelTemplate.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_EnableThreeState.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Checkbox/FluentCheckboxTests.FluentCheckbox_Default.verified.razor.html Snapshot update reflecting new rendered structure.
tests/Core/Components/Base/InputBaseTests.cs Updates expected styling behavior for MessageState.
tests/Core/Components/Base/ComponentBaseTests.cs Excludes FluentValidationMessage<> from generic component tests due to required EditContext setup.
src/Core/Components/TextInput/FluentTextInput.razor.cs Enhances required-message derivation by reading [Required] attribute ErrorMessage via ValueExpression.
src/Core/Components/Forms/FluentValidationMessage.razor.css Adds styling for FluentValidationMessage output.
src/Core/Components/Forms/FluentValidationMessage.razor.cs Implements FluentValidationMessage behavior and EditContext subscription lifecycle.
src/Core/Components/Forms/FluentValidationMessage.razor Renders field validation messages with icon and styling.
src/Core/Components/Field/Readme.md Documentation wording/grammar improvements.
src/Core/Components/Field/IFluentField.cs Extends the field contract with ValueExpression to support field identification.
src/Core/Components/Field/FluentFieldParameterCollector.cs Replaces prior selector with collector; adds ValueExpression and changes message selection defaults.
src/Core/Components/Field/FluentField.razor.css Ensures message slot content displays as block.
src/Core/Components/Field/FluentField.razor.cs Adds EditContext tracking, FieldIdentifier inference, and validation message integration.
src/Core/Components/Field/FluentField.razor Renders validation messages (and custom messages) in the field message slot.
src/Core/Components/Field/Condition/FluentFieldCondition.cs Adjusts how multi-condition message templates are built/rendered.
src/Core/Components/Base/FluentInputBase.cs Implements IFluentField.ValueExpression and improves disposal semantics.
examples/Tools/FluentUI.Demo.SampleData/Starship.cs Extends sample model with Password validation attributes and adjusts other validation.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Forms/Forms.md Adds FluentValidationMessage to docs and API section.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Forms/Examples/BasicForm.razor.css Adds layout CSS for the updated basic form example.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Forms/Examples/BasicForm.razor Updates the form example to mention/show validation-message support (currently commented).
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Field/Examples/FieldStatesExample.razor Updates the field states example to run inside an EditForm and bind values.
examples/Demo/FluentUI.Demo.Client/Documentation/Components/Field/Examples/FieldMessageMultipleConditions.razor Marks the sample as Required to trigger message behavior.
.github/instructions/blazor.instructions.md Adds repository guidance for Blazor component/app patterns.
Comments suppressed due to low confidence (2)

src/Core/Components/Field/FluentFieldParameterCollector.cs:108

  • MessageCondition now defaults to FluentFieldCondition.Never when neither the FluentField nor the input component sets it. This makes Message/MessageState/MessageIcon effectively never render for most components that only set Message (e.g., helper text in demos) unless callers explicitly set MessageCondition. Consider restoring the previous default (Always), or defaulting to Always when Message/MessageTemplate/MessageState is provided to avoid a breaking regression.
    tests/Core/Components/Field/FluentFieldParameterCollectorTests.razor:51
  • Typo in comment: "defaukt" → "default".

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

else
{

<FluentText Color="@(Parameters.MessageState is null ? Color.Error : Color.Info)" Size="@TextSize.Size200" Style="display: flex; align-items: center;">
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The message rendering uses Color.Info for any non-null MessageState, so Success/Warning/Error all get the same color. This also diverges from FluentFieldParameterCollector.StateToIcon/StateToMessage behavior and makes MessageState largely meaningless. Consider mapping MessageState to the appropriate FluentText color (e.g., Success→Success, Warning→Info/Warning, Error→Error) instead of treating all states as Info.

Suggested change
<FluentText Color="@(Parameters.MessageState is null ? Color.Error : Color.Info)" Size="@TextSize.Size200" Style="display: flex; align-items: center;">
@{
var messageColor = Color.Info;
if (Parameters.MessageState is null)
{
messageColor = Color.Error;
}
else
{
var stateName = Parameters.MessageState.ToString();
if (string.Equals(stateName, "Success", System.StringComparison.OrdinalIgnoreCase))
{
messageColor = Color.Success;
}
else if (string.Equals(stateName, "Warning", System.StringComparison.OrdinalIgnoreCase))
{
messageColor = Color.Warning;
}
else if (string.Equals(stateName, "Error", System.StringComparison.OrdinalIgnoreCase))
{
messageColor = Color.Error;
}
else
{
messageColor = Color.Info;
}
}
}
<FluentText Color="@messageColor" Size="@TextSize.Size200" Style="display: flex; align-items: center;">

Copilot uses AI. Check for mistakes.
Comment on lines +81 to +90
builder.OpenComponent<FluentText>(0);
builder.AddComponentParameter(1, "As", TextTag.Span);
builder.AddComponentParameter(2, "Color", item.State == MessageState.Error ? Color.Error : Color.Info);
//builder.AddAttribute(4, "slot", "message");
builder.AddAttribute(5, "style", "display: flex; align-items: center;");
builder.AddAttribute(6, "ChildContent", (RenderFragment)(contentBuilder =>
{
builder.AddContent(2, coloredMessage);
}
contentBuilder.AddContent(0, FluentField.CreateIcon(item.Icon ?? FluentFieldParameterCollector.StateToIcon(item.State)));
contentBuilder.AddContent(1, item.Message);
}));
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

FluentFieldCondition.Build assigns Color.Info for any state other than Error, which means Success messages render with the same color as Warning/Info. If MessageState.Success is intended to be visually distinct, map Success to Color.Success (and Warning to the appropriate color) to keep state semantics consistent.

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +216
private static FieldIdentifier CreateFieldIdentifier(LambdaExpression accessor)
{
var method = typeof(FieldIdentifier).GetMethod("Create", BindingFlags.Public | BindingFlags.Static)!;
return (FieldIdentifier)method.MakeGenericMethod(accessor.ReturnType).Invoke(null, [accessor])!;
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

CreateFieldIdentifier uses GetMethod("Create") without disambiguating overloads. If FieldIdentifier gains another public static Create overload, this can start returning the wrong method at runtime. Consider selecting the method by signature (name + IsGenericMethodDefinition + parameter count/type) or caching the MethodInfo to avoid repeated reflection.

Copilot uses AI. Check for mistakes.
/// </summary>
[Required]
[MinLength(8, ErrorMessage = "Password is too short")]
[RegularExpression(@"[A-Z][a-z]{\d}+", ErrorMessage = "Password must contain at least one uppercase letter, one lowercase letter and one digit")]
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The RegularExpression pattern "[A-Z][a-z]{\d}+" is not a valid regex quantifier ({\d} will throw at runtime when validation runs). If the intent is to require at least one uppercase, one lowercase, and one digit, update the pattern accordingly (e.g., using lookaheads or a corrected quantifier).

Suggested change
[RegularExpression(@"[A-Z][a-z]{\d}+", ErrorMessage = "Password must contain at least one uppercase letter, one lowercase letter and one digit")]
[RegularExpression(@"^(?=.*[A-Z])(?=.*[a-z])(?=.*\d).+$", ErrorMessage = "Password must contain at least one uppercase letter, one lowercase letter and one digit")]

Copilot uses AI. Check for mistakes.
public string? Identifier { get; set; }

/// <summary>
/// The unique identifier for the starship.
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

The XML doc summary for Password is a copy/paste of Identifier ("The unique identifier for the starship"). Please update it to describe the password field to avoid misleading generated docs.

Suggested change
/// The unique identifier for the starship.
/// The password used to secure access to the starship.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,7 @@
.fluent-validation-message {
display: flex;
color: var(--colorPaletteRedForeground1);
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

CSS uses --colorPaletteRedForeground1 for the error text color, while other components typically use the shared alert tokens (var(--error), var(--warning), etc.). Using var(--error) here would better align with the library's existing theming tokens and keep behavior consistent across components.

Suggested change
color: var(--colorPaletteRedForeground1);
color: var(--error);

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 13
<p>
This form uses the Fluent UI input components. It uses a `DataAnnotationsValidator` and `FluentValidationSummary`.
This form uses the Fluent UI input components. It uses a `DataAnnotationsValidator`, a `FluentValidationSummary`
and `FluentValidationMessage`s.

Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

This example text says the form uses FluentValidationMessages, but all FluentValidationMessage usages in the markup are currently commented out. Either uncomment at least one instance to demonstrate it, or adjust the description so it matches what the page actually renders.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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