doc(AttributeTable): add badge for obsolete parameter#7564
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds 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 AttributeTablesequenceDiagram
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
Class diagram for AttributeTable and related components after obsolete badge changeclassDiagram
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]."
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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 bothen-US.jsonandzh-CN.jsonso 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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
Substringto 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.
Link issues
fixes #7563
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Indicate obsolete attributes more clearly in the AttributeTable component UI and modernize related type formatting code.
Enhancements: