Add new Icon parameter to BitChoiceGroup (#12078)#12079
Add new Icon parameter to BitChoiceGroup (#12078)#12079msynk merged 3 commits intobitfoundation:developfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR adds external icon support to the BitChoiceGroup component. A new Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroup.razor.cs (1)
444-464:⚠️ Potential issue | 🔴 Critical
GetIconNameis dead code and should be removed.The search across the codebase confirms this
internalmethod has no callers. Other components (Message, Timeline, NavBar, Breadcrumb, Nav) have their ownGetIconNamemethods that are actively used, but the BitChoiceGroup version remains unused after the rendering was switched to useGetIconinstead.
🤖 Fix all issues with AI agents
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/ChoiceGroup/_BitChoiceGroupItemDemo.razor.samples.cs`:
- Around line 569-583: The sample Razor string example12RazorCode is missing the
Bootstrap Icons stylesheet needed by BitIconInfo.Bi("calendar-month"); update
example12RazorCode to include the Bootstrap Icons CSS link (the same link used
in the actual demo) alongside the existing FontAwesome link so the Bi icon
renders correctly.
🧹 Nitpick comments (3)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroupOption.cs (1)
36-38: Minor inconsistency in XML doc example formatting.The examples have inconsistent spacing around
=: Line 36 usesIcon="..."(no spaces) while lines 37-38 useIcon = ...(with spaces). Same issue exists inBitChoiceGroupItem.cslines 32-34.Proposed fix for consistency
/// <example> - /// Bootstrap: Icon="BitIconInfo.Bi("gear-fill")" - /// FontAwesome: Icon = BitIconInfo.Fa("solid house") - /// Custom CSS: Icon = BitIconInfo.Css("my-icon-class") + /// Bootstrap: Icon = BitIconInfo.Bi("gear-fill") + /// FontAwesome: Icon = BitIconInfo.Fa("solid house") + /// Custom CSS: Icon = BitIconInfo.Css("my-icon-class") /// </example>src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroupItem.cs (1)
38-41: Consider adding a deprecation hint or cross-reference to theIconNamedoc.Now that
Iconexists and takes precedence, theIconNamesummary could mention: "For external icons, preferIconinstead." This would help guide API consumers toward the right property.Proposed doc enhancement
/// <summary> - /// The icon to show as content of the BitChoiceGroup item. + /// The built-in Fluent UI icon name to show as content of the BitChoiceGroup item. + /// For external icon libraries, use <see cref="Icon"/> instead. /// </summary> public string? IconName { get; set; }This applies to both
BitChoiceGroupItem.csandBitChoiceGroupOption.cs.src/BlazorUI/Bit.BlazorUI/Components/Inputs/ChoiceGroup/BitChoiceGroup.scss (1)
231-235: Commented-out CSS rules should be removed or uncommented.Lines 234 and 254 have commented-out
widthproperties (//width: var(--bit-chg-ico-size);and//width: unset;). These look like debug artifacts. If the width is intentionally omitted (to let external icon libraries control sizing), remove the comments. If it's needed, uncomment them.The static analysis also flags these for missing a space after
//and a missing empty line before the comment (stylelintscss/double-slash-comment-whitespace-inside,scss/double-slash-comment-empty-line-before).🔧 Proposed fix: remove commented-out rules
.bit-chg-ico { speak: none; display: inline-block; - //width: var(--bit-chg-ico-size); }.bit-chg-ico { - //width: unset; }
...emo.Client.Core/Pages/Components/Inputs/ChoiceGroup/_BitChoiceGroupItemDemo.razor.samples.cs
Show resolved
Hide resolved
|


closes #12078
Summary by CodeRabbit
New Features
Documentation