Skip to content

doc(Samples): update AttributeTable items use Type#7542

Merged
ArgoZhang merged 4 commits intomainfrom
doc-comment
Jan 19, 2026
Merged

doc(Samples): update AttributeTable items use Type#7542
ArgoZhang merged 4 commits intomainfrom
doc-comment

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Jan 19, 2026

Link issues

fixes #7541

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Switch sample component demos to use AttributeTable’s Type-based API instead of manually-supplied attribute lists.

Enhancements:

  • Update numerous sample pages to bind AttributeTable via the Type parameter for each component instead of passing precomputed Items collections.
  • Remove custom attribute provider helpers for DockView-related components that are no longer needed with Type-based AttributeTable usage.
  • Add or restore AttributeTable sections for several samples that previously lacked attribute documentation, aligning them with the new Type-based pattern.

Copilot AI review requested due to automatic review settings January 19, 2026 09:27
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jan 19, 2026

Reviewer's Guide

Refactors sample pages to use the reflection-based AttributeTable Type parameter instead of manually-supplied Items collections, and deletes now-unused attribute metadata helpers, simplifying documentation for many components.

Updated class diagram for AttributeTable usage in samples

classDiagram
    class AttributeItem {
        string Name
        string Description
        string Type
        string ValueList
        string DefaultValue
    }

    class AttributeTable {
        +AttributeItem[] Items
        +Type Type
    }

    class DockViews_Index {
        -static AttributeItem[] GetAttributes()
        -static AttributeItem[] GetDockContentAttributes()
        -static AttributeItem[] GetDockComponentAttributes()
    }

    AttributeTable "*" o-- "*" AttributeItem

    DockViews_Index ..> AttributeItem : builds_items_before
    DockViews_Index ..> AttributeTable : provides_Items_before

    class SampleComponentSkeletons {
    }

    class SampleComponentDockViews {
    }

    SampleComponentSkeletons ..> AttributeTable : uses_Type_after
    SampleComponentDockViews ..> AttributeTable : uses_Type_after
Loading

File-Level Changes

Change Details Files
Switch AttributeTable usage from manual Items collections to Type-based reflection across sample Razor pages.
  • Replace AttributeTable Items="@GetAttributes()" (and similar per-component attribute lists) with AttributeTable Type="typeof(ComponentOrGenericType)" for each sample page.
  • Preserve existing Title attributes where present while changing data source from Items to Type.
  • Add new AttributeTable instances for several samples that previously had none, to document their attributes via Type (for example InputGroup, Navbar, NetworkMonitorIndicator, etc.).
  • Ensure generic components use the open generic type in Type (e.g., typeof(EditorForm<>), typeof(Select<>) ).
src/BootstrapBlazor.Server/Components/Samples/Skeletons.razor
src/BootstrapBlazor.Server/Components/Samples/DockViews/Index.razor
src/BootstrapBlazor.Server/Components/Samples/OnScreenKeyboards.razor
src/BootstrapBlazor.Server/Components/Samples/Collapses.razor
src/BootstrapBlazor.Server/Components/Samples/Consoles.razor
src/BootstrapBlazor.Server/Components/Samples/EditorForms.razor
src/BootstrapBlazor.Server/Components/Samples/Gantts.razor
src/BootstrapBlazor.Server/Components/Samples/Steps.razor
src/BootstrapBlazor.Server/Components/Samples/Timelines.razor
src/BootstrapBlazor.Server/Components/Samples/Players.razor
src/BootstrapBlazor.Server/Components/Samples/VideoPlayers.razor
src/BootstrapBlazor.Server/Components/Samples/Alerts.razor
src/BootstrapBlazor.Server/Components/Samples/AnchorLinks.razor
src/BootstrapBlazor.Server/Components/Samples/Anchors.razor
src/BootstrapBlazor.Server/Components/Samples/AutoCompletes.razor
src/BootstrapBlazor.Server/Components/Samples/AutoFills.razor
src/BootstrapBlazor.Server/Components/Samples/AutoRedirects.razor
src/BootstrapBlazor.Server/Components/Samples/Avatars.razor
src/BootstrapBlazor.Server/Components/Samples/Badges.razor
src/BootstrapBlazor.Server/Components/Samples/BarcodeGenerators.razor
src/BootstrapBlazor.Server/Components/Samples/BarcodeReaders.razor
src/BootstrapBlazor.Server/Components/Samples/Blocks.razor
src/BootstrapBlazor.Server/Components/Samples/Buttons.razor
src/BootstrapBlazor.Server/Components/Samples/Calendars.razor
src/BootstrapBlazor.Server/Components/Samples/Cameras.razor
src/BootstrapBlazor.Server/Components/Samples/Captchas.razor
src/BootstrapBlazor.Server/Components/Samples/Cards.razor
src/BootstrapBlazor.Server/Components/Samples/Carousels.razor
src/BootstrapBlazor.Server/Components/Samples/Cascaders.razor
src/BootstrapBlazor.Server/Components/Samples/CheckboxLists.razor
src/BootstrapBlazor.Server/Components/Samples/Checkboxs.razor
src/BootstrapBlazor.Server/Components/Samples/ClockPickers.razor
src/BootstrapBlazor.Server/Components/Samples/CodeEditors.razor
src/BootstrapBlazor.Server/Components/Samples/ColorPickers.razor
src/BootstrapBlazor.Server/Components/Samples/CountButtons.razor
src/BootstrapBlazor.Server/Components/Samples/CountUps.razor
src/BootstrapBlazor.Server/Components/Samples/DateTimePickers.razor
src/BootstrapBlazor.Server/Components/Samples/DialButtons.razor
src/BootstrapBlazor.Server/Components/Samples/Dialogs.razor
src/BootstrapBlazor.Server/Components/Samples/Displays.razor
src/BootstrapBlazor.Server/Components/Samples/Dividers.razor
src/BootstrapBlazor.Server/Components/Samples/DragDrops.razor
src/BootstrapBlazor.Server/Components/Samples/Drawers.razor
src/BootstrapBlazor.Server/Components/Samples/DriverDotnetJs.razor
src/BootstrapBlazor.Server/Components/Samples/DropdownWidgets.razor
src/BootstrapBlazor.Server/Components/Samples/Dropdowns.razor
src/BootstrapBlazor.Server/Components/Samples/EditDialogs.razor
src/BootstrapBlazor.Server/Components/Samples/Empties.razor
src/BootstrapBlazor.Server/Components/Samples/ExportPdfButtons.razor
src/BootstrapBlazor.Server/Components/Samples/FileIcons.razor
src/BootstrapBlazor.Server/Components/Samples/FileViewers.razor
src/BootstrapBlazor.Server/Components/Samples/FlipClocks.razor
src/BootstrapBlazor.Server/Components/Samples/FloatingLabels.razor
src/BootstrapBlazor.Server/Components/Samples/Footers.razor
src/BootstrapBlazor.Server/Components/Samples/FullScreenButtons.razor
src/BootstrapBlazor.Server/Components/Samples/GlobalException.razor
src/BootstrapBlazor.Server/Components/Samples/GoTops.razor
src/BootstrapBlazor.Server/Components/Samples/GroupBoxes.razor
src/BootstrapBlazor.Server/Components/Samples/Handwrittens.razor
src/BootstrapBlazor.Server/Components/Samples/IFrames.razor
src/BootstrapBlazor.Server/Components/Samples/ImageCroppers.razor
src/BootstrapBlazor.Server/Components/Samples/ImageViewers.razor
src/BootstrapBlazor.Server/Components/Samples/InputGroups.razor
src/BootstrapBlazor.Server/Components/Samples/InputNumbers.razor
src/BootstrapBlazor.Server/Components/Samples/Inputs.razor
src/BootstrapBlazor.Server/Components/Samples/IntersectionObservers.razor
src/BootstrapBlazor.Server/Components/Samples/Layouts.razor
src/BootstrapBlazor.Server/Components/Samples/Lights.razor
src/BootstrapBlazor.Server/Components/Samples/LinkButtons.razor
src/BootstrapBlazor.Server/Components/Samples/ListGroups.razor
src/BootstrapBlazor.Server/Components/Samples/ListViews.razor
src/BootstrapBlazor.Server/Components/Samples/Live2DDisplays.razor
src/BootstrapBlazor.Server/Components/Samples/Logouts.razor
src/BootstrapBlazor.Server/Components/Samples/Markdowns.razor
src/BootstrapBlazor.Server/Components/Samples/Marquees.razor
src/BootstrapBlazor.Server/Components/Samples/Masks.razor
src/BootstrapBlazor.Server/Components/Samples/Meets.razor
src/BootstrapBlazor.Server/Components/Samples/Menus.razor
src/BootstrapBlazor.Server/Components/Samples/Messages.razor
src/BootstrapBlazor.Server/Components/Samples/MindMaps.razor
src/BootstrapBlazor.Server/Components/Samples/Modals.razor
src/BootstrapBlazor.Server/Components/Samples/MouseFollowers.razor
src/BootstrapBlazor.Server/Components/Samples/MultiSelects.razor
src/BootstrapBlazor.Server/Components/Samples/Navbars.razor
src/BootstrapBlazor.Server/Components/Samples/Navigation.razor
src/BootstrapBlazor.Server/Components/Samples/NetworkMonitors.razor
src/BootstrapBlazor.Server/Components/Samples/Notifications.razor
src/BootstrapBlazor.Server/Components/Samples/OfficeViewers.razor
src/BootstrapBlazor.Server/Components/Samples/OtpInputs.razor
src/BootstrapBlazor.Server/Components/Samples/Paginations.razor
src/BootstrapBlazor.Server/Components/Samples/PdfViewers.razor
src/BootstrapBlazor.Server/Components/Samples/PopoverConfirms.razor
src/BootstrapBlazor.Server/Components/Samples/Popovers.razor
src/BootstrapBlazor.Server/Components/Samples/Progress.razor
src/BootstrapBlazor.Server/Components/Samples/PulseButtons.razor
src/BootstrapBlazor.Server/Components/Samples/QRCodes.razor
src/BootstrapBlazor.Server/Components/Samples/QueryBuilders.razor
src/BootstrapBlazor.Server/Components/Samples/RDKits.razor
src/BootstrapBlazor.Server/Components/Samples/Radios.razor
src/BootstrapBlazor.Server/Components/Samples/Rates.razor
src/BootstrapBlazor.Server/Components/Samples/Repeaters.razor
src/BootstrapBlazor.Server/Components/Samples/Responsives.razor
src/BootstrapBlazor.Server/Components/Samples/RibbonTabs.razor
src/BootstrapBlazor.Server/Components/Samples/Rows.razor
src/BootstrapBlazor.Server/Components/Samples/Scrolls.razor
src/BootstrapBlazor.Server/Components/Samples/SearchDialogs.razor
src/BootstrapBlazor.Server/Components/Samples/Searches.razor
src/BootstrapBlazor.Server/Components/Samples/Segmenteds.razor
src/BootstrapBlazor.Server/Components/Samples/SelectCities.razor
src/BootstrapBlazor.Server/Components/Samples/SelectGenerics.razor
src/BootstrapBlazor.Server/Components/Samples/SelectProvinces.razor
src/BootstrapBlazor.Server/Components/Samples/SelectTables.razor
src/BootstrapBlazor.Server/Components/Samples/SelectTrees.razor
src/BootstrapBlazor.Server/Components/Samples/ShieldBadges.razor
src/BootstrapBlazor.Server/Components/Samples/SignaturePadPageResponsive.razor
src/BootstrapBlazor.Server/Components/Samples/SignaturePads.razor
src/BootstrapBlazor.Server/Components/Samples/SlideButtons.razor
src/BootstrapBlazor.Server/Components/Samples/Sliders.razor
src/BootstrapBlazor.Server/Components/Samples/SmilesDrawers.razor
src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor
src/BootstrapBlazor.Server/Components/Samples/Speeches/SpeechWaves.razor
src/BootstrapBlazor.Server/Components/Samples/Spinners.razor
src/BootstrapBlazor.Server/Components/Samples/Splits.razor
src/BootstrapBlazor.Server/Components/Samples/Splittings.razor
src/BootstrapBlazor.Server/Components/Samples/Stacks.razor
src/BootstrapBlazor.Server/Components/Samples/SvgEditors.razor
src/BootstrapBlazor.Server/Components/Samples/SweetAlerts.razor
src/BootstrapBlazor.Server/Components/Samples/SwitchButtons.razor
src/BootstrapBlazor.Server/Components/Samples/Switches.razor
src/BootstrapBlazor.Server/Components/Samples/Table/TablesCell.razor
src/BootstrapBlazor.Server/Components/Samples/Tabs.razor
src/BootstrapBlazor.Server/Components/Samples/Tags.razor
src/BootstrapBlazor.Server/Components/Samples/TaskBoard.razor
src/BootstrapBlazor.Server/Components/Samples/TextAreas.razor
src/BootstrapBlazor.Server/Components/Samples/TimePickers.razor
src/BootstrapBlazor.Server/Components/Samples/Timers.razor
src/BootstrapBlazor.Server/Components/Samples/Titles.razor
src/BootstrapBlazor.Server/Components/Samples/Toasts.razor
src/BootstrapBlazor.Server/Components/Samples/Toggles.razor
src/BootstrapBlazor.Server/Components/Samples/Toolbars.razor
src/BootstrapBlazor.Server/Components/Samples/Tooltips.razor
src/BootstrapBlazor.Server/Components/Samples/Topologies.razor
src/BootstrapBlazor.Server/Components/Samples/Transfers.razor
src/BootstrapBlazor.Server/Components/Samples/Transitions.razor
src/BootstrapBlazor.Server/Components/Samples/Typeds.razor
src/BootstrapBlazor.Server/Components/Samples/UploadAvatars.razor
src/BootstrapBlazor.Server/Components/Samples/UploadButtons.razor
src/BootstrapBlazor.Server/Components/Samples/UploadDrops.razor
src/BootstrapBlazor.Server/Components/Samples/UploadInputs.razor
src/BootstrapBlazor.Server/Components/Samples/ValidateForms.razor
src/BootstrapBlazor.Server/Components/Samples/Vditors.razor
src/BootstrapBlazor.Server/Components/Samples/Watermarks.razor
src/BootstrapBlazor.Server/Components/Samples/WinBoxes.razor
src/BootstrapBlazor.Server/Components/Samples/SelectObjects.razor
src/BootstrapBlazor.Server/Components/Samples/CherryMarkdowns.razor
src/BootstrapBlazor.Server/Components/Samples/DateTimeRanges.razor
src/BootstrapBlazor.Server/Components/Samples/Editors.razor
src/BootstrapBlazor.Server/Components/Samples/Mermaids.razor
src/BootstrapBlazor.Server/Components/Samples/PdfReaders.razor
src/BootstrapBlazor.Server/Components/Samples/Reconnectors.razor
src/BootstrapBlazor.Server/Components/Samples/SelectRegions.razor
src/BootstrapBlazor.Server/Components/Samples/Selects.razor
src/BootstrapBlazor.Server/Components/Samples/TreeViews.razor
src/BootstrapBlazor.Server/Components/Samples/UniverSheets.razor
src/BootstrapBlazor.Server/Components/Samples/UploadCards.razor
Remove now-unused manual AttributeItem helper methods for Dock sample components, relying on AttributeTable Type-based reflection instead.
  • Delete GetDockContentAttributes and GetDockComponentAttributes methods that constructed AttributeItem[] for DockContent and DockComponent.
  • Rely on AttributeTable Title+Type usage in DockViews/Index.razor to surface DockView, DockContent and DockComponent attributes.
src/BootstrapBlazor.Server/Components/Samples/DockViews/Index.razor.cs
Normalize file headers and BOM at the top of several files.
  • Remove stray BOM character before the license or @page directive on multiple Razor and C# files so they start cleanly with // Licensed... or @page.
  • This is a non-functional formatting cleanup aligning headers with repository standards.
src/BootstrapBlazor.Server/Components/Samples/DockViews/Index.razor.cs
src/BootstrapBlazor.Server/Components/Samples/*.razor (many of the modified Razor files)

Assessment against linked issues

Issue Objective Addressed Explanation
#7541 Update sample documentation code to use the AttributeTable Type parameter instead of manually-provided Items collections for component attributes.
#7541 Add or adjust sample code so that AttributeTable entries are generated based on the component types for all relevant sample components.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label Jan 19, 2026
@bb-auto bb-auto Bot added this to the v10.2.0 milestone Jan 19, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Now that most AttributeTable usages have switched to the Type-based API, check the remaining GetAttributes()/Get*AttributeItems() helpers (for example in DockViews/Index.razor.cs) and remove any that are no longer referenced to avoid leaving dead code around.
  • The new AttributeTable Type=... usages mix fully-qualified types (e.g. typeof(BootstrapBlazor.Components.Console)) and unqualified ones (e.g. typeof(ConsoleMessageItem)); consider standardizing on one style (with using statements where needed) to keep the samples consistent and easier to read.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that most `AttributeTable` usages have switched to the `Type`-based API, check the remaining `GetAttributes()`/`Get*AttributeItems()` helpers (for example in `DockViews/Index.razor.cs`) and remove any that are no longer referenced to avoid leaving dead code around.
- The new `AttributeTable Type=...` usages mix fully-qualified types (e.g. `typeof(BootstrapBlazor.Components.Console)`) and unqualified ones (e.g. `typeof(ConsoleMessageItem)`); consider standardizing on one style (with `using` statements where needed) to keep the samples consistent and easier to read.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 55ac5b9 into main Jan 19, 2026
7 of 8 checks passed
@ArgoZhang ArgoZhang deleted the doc-comment branch January 19, 2026 09:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (df71a21) to head (27d9330).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7542   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          748       748           
  Lines        33000     33000           
  Branches      4588      4588           
=========================================
  Hits         33000     33000           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 pull request refactors documentation sample pages to use the Type parameter instead of the Items parameter for the AttributeTable component. This change simplifies the code by eliminating the need for manual GetAttributes() methods in many sample files, allowing the AttributeTable component to automatically generate attribute documentation from the component types using reflection.

Changes:

  • Replaced Items="@GetAttributes()" with Type="typeof(ComponentName)" across 150+ sample files
  • Removed manual attribute generation methods from DockViews/Index.razor.cs
  • Minor whitespace cleanup (BOM removal and trailing newline normalization)

Reviewed changes

Copilot reviewed 177 out of 177 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WinBoxes.razor Updated AttributeTable to use Type parameter for WinBoxOption
Watermarks.razor Added AttributeTable using Type parameter for Watermark
VideoPlayers.razor Updated AttributeTable to use Type parameter for VideoPlayer
Vditors.razor Updated AttributeTable to use Type parameter for Vditor
ValidateForms.razor Updated AttributeTable to use Type parameter for ValidateForm
Tabs.razor Updated AttributeTable to use Type parameter for Tab (with @typeof syntax)
Searches.razor Updated AttributeTable to use Type parameter for Search<> (with @typeof syntax)
DockViews/Index.razor Updated three AttributeTables to use Type parameter
DockViews/Index.razor.cs Removed GetDockContentAttributes() and GetDockComponentAttributes() methods
(145+ other files) Similar refactoring pattern applied consistently

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

</DemoBlock>

<AttributeTable Items="@GetAttributes()" Title="@Localizer["AttTitle"]" />
<AttributeTable Type="@typeof(Tab)" />
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Inconsistent use of @typeof() syntax. In Razor files, the @ symbol is not needed within attribute values when using typeof(). The syntax should be Type="typeof(Tab)" not Type="@typeof(Tab)". While both work in Blazor, using @ is redundant within attribute values and inconsistent with the rest of the file changes.

Copilot uses AI. Check for mistakes.
</DemoBlock>

<AttributeTable Items="@GetAttributes()" />
<AttributeTable Type="@typeof(Search<>)" />
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

Inconsistent use of @typeof() syntax. In Razor files, the @ symbol is not needed within attribute values when using typeof(). The syntax should be Type="typeof(Search<>)" not Type="@typeof(Search<>)". While both work in Blazor, using @ is redundant within attribute values and inconsistent with the rest of the file changes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doc(Samples): update AttributeTable items use Type

3 participants