Skip to content

doc(AttributeTable): add badge for obsolete parameter#7564

Merged
ArgoZhang merged 1 commit intomainfrom
doc-attribute-tag
Jan 22, 2026
Merged

doc(AttributeTable): add badge for obsolete parameter#7564
ArgoZhang merged 1 commit intomainfrom
doc-attribute-tag

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Jan 22, 2026

Link issues

fixes #7563

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

Indicate obsolete attributes more clearly in the AttributeTable component UI and modernize related type formatting code.

Enhancements:

  • Display a danger-colored badge labeled as obsolete next to obsolete attribute values in the AttributeTable component.
  • Use range-based substring syntax when formatting generic type names for display in the AttributeTable.

Copilot AI review requested due to automatic review settings January 22, 2026 01:36
@bb-auto bb-auto Bot added the documentation Improvements or additions to documentation label Jan 22, 2026
@bb-auto bb-auto Bot added this to the v10.2.0 milestone Jan 22, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jan 22, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds an explicit 'Obsolete' badge to obsolete parameters in AttributeTable, refactors a type-name formatting helper to use range syntax, and introduces corresponding localization entries for the new badge label in English and Chinese resources.

Sequence diagram for rendering obsolete parameters with badge in AttributeTable

sequenceDiagram
  participant AttributeTable
  participant Row
  participant Localizer
  participant Badge

  AttributeTable->>Row: read IsObsolete
  alt Row_IsObsolete_true
    AttributeTable->>Row: read Value
    AttributeTable->>Localizer: indexer Obsolete
    Localizer-->>AttributeTable: localized_obsolete_text
    AttributeTable->>Badge: create Color_Danger IsPill_true content_localized_obsolete_text
    Badge-->>AttributeTable: rendered_badge_markup
    AttributeTable-->>AttributeTable: render strikethrough_value_and_badge
  else Row_IsObsolete_false
    AttributeTable->>Row: read Value
    AttributeTable-->>AttributeTable: render_normal_value
  end
Loading

Class diagram for AttributeTable and related components after obsolete badge change

classDiagram
  class AttributeTable {
    +object Localizer
    +string FormatTypeName(Type type)
  }

  class RowModel {
    +bool IsObsolete
    +string Value
  }

  class Badge {
    +enum Color
    +bool IsPill
    +string ChildContent
  }

  class Type {
    +string Name
    +Type[] GetGenericArguments()
  }

  AttributeTable --> RowModel : displays
  AttributeTable --> Badge : renders
  AttributeTable --> Type : formats_name

  note for AttributeTable "When RowModel.IsObsolete is true, renders Value with strikethrough and a danger pill Badge using Localizer[Obsolete]. FormatTypeName uses range syntax type.Name[..index]."
Loading

File-Level Changes

Change Details Files
Visually mark obsolete parameters in AttributeTable with an additional badge alongside the struck-through text.
  • Add a BootstrapBlazor Badge component rendered when a row is obsolete, positioned after the parameter value.
  • Add spacing class to the obsolete value span to separate it from the new badge.
  • Use localized text for the badge label via the existing Localizer with the new "Obsolete" resource key.
src/BootstrapBlazor.Server/Components/Components/AttributeTable.razor
Refine generic type name formatting helper implementation.
  • Replace Substring(0, index) with range-based slicing syntax to derive the generic type name prefix.
  • Keep existing behavior for composing the generic type name with its generic argument names.
src/BootstrapBlazor.Server/Components/Components/AttributeTable.razor.cs
Add localization entries for the new obsolete badge label.
  • Introduce an "Obsolete" entry in the English locale JSON for use in the AttributeTable badge.
  • Introduce a corresponding "Obsolete" entry in the Chinese locale JSON.
src/BootstrapBlazor.Server/Locales/en-US.json
src/BootstrapBlazor.Server/Locales/zh-CN.json

Assessment against linked issues

Issue Objective Addressed Explanation
#7563 Add a visible badge to indicate obsolete parameters in the AttributeTable documentation/component UI.

Possibly linked issues


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

@ArgoZhang ArgoZhang merged commit c14b931 into main Jan 22, 2026
6 checks passed
@ArgoZhang ArgoZhang deleted the doc-attribute-tag branch January 22, 2026 01:36
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:

  • Since you introduced Localizer["Obsolete"] in the UI, double-check that matching entries (with the same key and intended casing) are added to both en-US.json and zh-CN.json so the badge text localizes correctly.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since you introduced `Localizer["Obsolete"]` in the UI, double-check that matching entries (with the same key and intended casing) are added to both `en-US.json` and `zh-CN.json` so the badge text localizes correctly.

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 22, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7564   +/-   ##
=========================================
  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 PR enhances the AttributeTable component by adding a visual badge to clearly indicate obsolete parameters in the component documentation. The badge provides better visual feedback to developers when viewing deprecated API parameters.

Changes:

  • Added "Obsolete" localization strings for English and Chinese
  • Enhanced the obsolete parameter display with a danger-colored pill badge
  • Refactored string manipulation from Substring to modern range operator syntax

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/BootstrapBlazor.Server/Locales/en-US.json Added English translation for "Obsolete" label
src/BootstrapBlazor.Server/Locales/zh-CN.json Added Chinese translation for "已弃用" (Obsolete) label
src/BootstrapBlazor.Server/Components/Components/AttributeTable.razor Added Badge component to visually mark obsolete parameters with improved spacing
src/BootstrapBlazor.Server/Components/Components/AttributeTable.razor.cs Modernized string manipulation using range operator instead of Substring

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

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(AttributeTable): add badge for obsolete parameter

2 participants