[11.0 RC1] Blazor AI components release notes - #37618
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical and moderate issues affect example compilation and runtime correctness.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds .NET 11 release-note coverage for experimental Blazor AI components and agentic UI scenarios.
Changes:
- Documents chat, tools, approvals, activities, state, and persistence.
- Adds illustrative screenshots.
- Updates the release-note date.
File summaries
| File | Summary |
|---|---|
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md |
Adds Blazor AI component documentation and samples. |
aspnetcore/release-notes/aspnetcore-11.md |
Updates release-note metadata. |
Review details
Suppressed comments (6)
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:1141
BlockRendererrequires a cascadedMessageListContextand throws when it isn't inside aMessageList. This standalone snippet therefore fails at runtime; place it insideChatPage.MessageListContent(or an explicitMessageList) as in the other renderer examples.
<BlockRenderer TBlock="FunctionApprovalBlock" Context="approval">
<p>Allow <code>@approval.ToolName</code> to run?</p>
<button @onclick="approval.Approve">Approve</button>
<button @onclick="() => approval.Reject()">Reject</button>
</BlockRenderer>
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:1226
- The parameterless
Deserialize<RecipeState>()uses case-sensitive default JSON options. AG-UI state snapshots normally use the web/camel-case contract (the corresponding shared-state implementation usesJsonSerializerDefaults.Web), so properties such asRecipecan remain at their defaults; define and reuse serializer options that match the server's wire contract here.
if (context.Update.RawRepresentation is StateSnapshotEvent snapshot &&
snapshot.Snapshot.Deserialize<RecipeState>() is { } state)
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:938
- The new section introduces public API identifiers such as
UIAgent,ChatPage, andIChatClientas inline code without API cross-references. The include rules require verified<xref:...>references, or a source-code link plus a TODO when API docs aren't published; apply that treatment consistently throughout this added section.
The first step in an agentic UI is often a basic conversation that streams responses and retains message history across turns. The [initial chat support](https://github.com/dotnet/aspnetcore/pull/68323) is provider- and protocol-neutral. Apps supply an `IChatClient` from `Microsoft.Extensions.AI`, and `UIAgent` converts its streaming responses into observable content blocks.
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:1242
- Add
toinpermits an app render; the sentence should saypermits an app to render.
Predictive state permits an app render an agent's proposed state change while the model is still generating it without replacing the committed state. For example, as an agent generates the complete contents of an edited document in a tool argument, the UI can progressively display the proposed document and a diff. When generation finishes, the user can accept the completed proposal or reject it and restore the committed document.
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:1252
- The parameterless
Deserialize<DocumentState>()has the same case-sensitive JSON issue: a normal camel-case AG-UI snapshot won't populate the documented state type unless the client uses matching serializer options or explicit JSON property names. Reuse the serializer contract used by the server for this predictive-state sample.
if (context.Update.RawRepresentation is StateSnapshotEvent snapshot &&
snapshot.Snapshot.Deserialize<DocumentState>() is { } predictedState)
aspnetcore/release-notes/aspnetcore-11/includes/blazor.md:1080
- Marshalling the assignment through
InvokeAsyncdoesn't schedule a render for the component that ownsaccentColor, so markup bound to this field won't update after the action completes. CallStateHasChangedafter assigning it, as the actual Components.AI client-action sample does.
await InvokeAsync(() => accentColor = color);
- Files reviewed: 2/7 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…tnet/AspNetCore.Docs into guardrex/blazor-ai-components
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Copilot reviewed 2 out of 7 changed files in this pull request and generated 4 comments.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
danroth27
left a comment
There was a problem hiding this comment.
A few sample correctness fixes before merge:
Co-authored-by: Daniel Roth <daroth@microsoft.com>
|
Sorry about the churn here. My multi-line suggestions were based on an earlier revision of the PR. Another commit landed before I posted the review, so GitHub applied the suggestions to shifted line ranges and left four examples malformed. The current branch tip still has duplicated or truncated code in the frontend action, approval renderer, shared-state, and predictive-state snippets. Please don't try to reapply the suggestions themselves. The corresponding clean, compile-validated forms are in dotnet/core#10579 and can be used as the source of truth while cleaning up these four code fences. We'll hold off on making any competing edits and wait for your update. |
|
Thanks ... yeah ... sorry. If a review isn't used with all of them arriving at once, I'm not sure when the suggestions are done. I'll fix the code blocks now. |
|
I think that gets us back in good shape. |
Addresses #36448
Addresses dotnet/core#10565
Dan, Copilot had a few suggestions. I applied them ...
AGUI.AbstractionsandAGUI.Clientpackages.BlockRendererto have a Razor @ transition ...When='@(action => action.ToolName == "set_accent_color")'Microsoft.AspNetCore.Components.AInamespace to theResearchActivityBlockclass.Wade, I only require an approval on this one at this time because I need to wait on the signal that the NuGet package for this API went live and because Dan might let me know that he wants reference article coverage for it.
Internal previews
Build report