Skip to content

[dev-v5] docs(tab): Clarify Header vs HeaderTemplate XML documentation on FluentTab#4765

Merged
vnbaaij merged 1 commit intomicrosoft:dev-v5from
AClerbois:users/aclerbois/dev-v5/clarify-tab-header-property
Apr 29, 2026
Merged

[dev-v5] docs(tab): Clarify Header vs HeaderTemplate XML documentation on FluentTab#4765
vnbaaij merged 1 commit intomicrosoft:dev-v5from
AClerbois:users/aclerbois/dev-v5/clarify-tab-header-property

Conversation

@AClerbois
Copy link
Copy Markdown
Collaborator

Problem

AI agents (GitHub Copilot, etc.) consistently generate Text="..." instead of Header="..." when scaffolding FluentTab components. This is because:

  1. The previous XML doc for Header said only "Gets or sets the label of the tab." — the word "label" leads models to look for a Label property (the v4 name), and when that is absent they fall back to Text, which is the convention used by other Blazor UI frameworks (Telerik, MudBlazor, …).
  2. The name Header naturally evokes rich/template content rather than a plain string, reinforcing the confusion with HeaderTemplate.
  3. Nothing in the XML docs linked the two sibling parameters together or explained which to use in each situation.

Change

Improved the XML doc summaries for both parameters on FluentTab.razor.cs:

Header (plain-text string)

/// <summary>
/// Gets or sets the text displayed on the tab.
/// This is the plain-text label shown in the tab strip (e.g., <c>Header="My Tab"</c>).
/// For rich content (icons, custom markup), use <see cref="HeaderTemplate"/> instead.
/// </summary>
/// <remarks>
/// Renamed from <c>Label</c> in v4.
/// </remarks>

HeaderTemplate (rich RenderFragment)

/// <summary>
/// Gets or sets the custom header content of the tab (supports icons and rich markup).
/// Use this instead of <see cref="Header"/> when you need more than plain text.
/// </summary>
/// <remarks>
/// Renamed from <c>Header</c> in v4.
/// </remarks>

Why this matters for AI agents

These doc summaries are extracted at build time into FluentUIComponentsDocumentation.json and served by the Fluent UI Blazor MCP server. Clearer descriptions with a concrete usage example (Header="My Tab") and an explicit cross-reference between the two properties give models the signal they need to pick the right one without hallucinating Text.

Files changed

  • src/Core/Components/Tabs/FluentTab.razor.cs

Copilot AI review requested due to automatic review settings April 29, 2026 17:16
@AClerbois AClerbois changed the title docs(tab): Clarify Header vs HeaderTemplate XML documentation on FluentTab [dev-v5] docs(tab): Clarify Header vs HeaderTemplate XML documentation on FluentTab Apr 29, 2026
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

Note

Copilot was unable to run its full agentic suite in this review.

Clarifies the XML documentation for FluentTab’s Header vs HeaderTemplate parameters to reduce confusion (especially for AI-assisted scaffolding) and encourage correct usage.

Changes:

  • Expanded Header docs to explicitly describe plain-text usage and link to HeaderTemplate for rich content.
  • Expanded HeaderTemplate docs to explicitly describe rich markup usage and link back to Header.
  • Added remarks noting the v4 parameter renames (LabelHeader, HeaderHeaderTemplate).

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

@vnbaaij vnbaaij merged commit 63fc84b into microsoft:dev-v5 Apr 29, 2026
6 of 7 checks passed
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