Skip to content

Add missing new ItemCheckIcon parameter to BitDropdown (#12217)#12218

Merged
msynk merged 4 commits intobitfoundation:developfrom
msynk:12217-blazorui-dropdown-missing-new-icon
Mar 28, 2026
Merged

Add missing new ItemCheckIcon parameter to BitDropdown (#12217)#12218
msynk merged 4 commits intobitfoundation:developfrom
msynk:12217-blazorui-dropdown-missing-new-icon

Conversation

@msynk
Copy link
Copy Markdown
Member

@msynk msynk commented Mar 28, 2026

closes #12217

Summary by CodeRabbit

  • New Features
    • Added customizable checkmark icon support to multi-select dropdown components. Users can now provide custom icon definitions or select alternative icon names from the Fluent UI icon set to personalize the visual appearance of selected item indicators. The component defaults to an "Accept" icon when no custom configuration is specified.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 74f490b3-a93a-4b60-a874-95907d2ea215

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Added customization support for the checkmark icon in BitDropdown multi-select items through two new parameters (ItemCheckIcon and ItemCheckIconName) and a helper method to derive CSS classes, enabling external icon customization while maintaining a default "Accept" icon.

Changes

Cohort / File(s) Summary
BitDropdown Component
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs
Added ItemCheckIcon and ItemCheckIconName parameters to enable checkmark icon customization. Introduced GetItemCheckIconCssClasses() helper method that resolves CSS classes with precedence for ItemCheckIcon over ItemCheckIconName and defaults to "Accept" icon.
BitDropdown Item Template
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/_BitDropdownItem.razor
Updated check icon element to use dynamically generated CSS classes from GetItemCheckIconCssClasses() instead of hard-coded "Accept" icon classes.
BitDropdown Demo Component
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/Dropdown/BitDropdownDemo.razor.cs
Added ItemCheckIcon and ItemCheckIconName parameters to the demo component for interactive configuration testing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A checkmark hops with custom flair,
No more fixed icons everywhere!
Accept or custom—take your pick,
The dropdown's magic works so quick.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements the ItemCheckIcon parameter requested in issue #12217, enabling external/custom icons for dropdown item checkmarks.
Out of Scope Changes check ✅ Passed All changes are focused on adding ItemCheckIcon and ItemCheckIconName parameters to BitDropdown and related demo files, directly addressing the linked issue requirements.
Title check ✅ Passed The title accurately describes the main change: adding the ItemCheckIcon parameter to BitDropdown for customizing multi-select item checkmark icons.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Adds support for customizing the multi-select item checkmark icon in BitDropdown, aligning it with existing external-icon patterns across the component library.

Changes:

  • Added ItemCheckIcon (BitIconInfo?) and ItemCheckIconName (string?) parameters to BitDropdown.
  • Updated dropdown item rendering to use resolved icon CSS classes for the checkmark icon.
  • Documented the new parameters in the demo page metadata.

Reviewed changes

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

File Description
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/Dropdown/BitDropdownDemo.razor.cs Adds demo/API docs entries for the new icon parameters.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/_BitDropdownItem.razor Switches the multi-select checkmark <i> to use resolved icon classes instead of hardcoded Fluent icon classes.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs Introduces new parameters and a helper to resolve checkmark icon CSS classes.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs`:
- Around line 575-578: The GetItemCheckIconCssClasses method uses
ItemCheckIconName ?? "Accept" which only defaults on null and not on empty
strings; update the logic in GetItemCheckIconCssClasses to treat empty (and
optionally whitespace) ItemCheckIconName as missing by using
string.IsNullOrEmpty or string.IsNullOrWhiteSpace (e.g., default to "Accept"
when ItemCheckIconName is null/empty) before calling
BitIconInfo.From(ItemCheckIcon, ...), referencing the GetItemCheckIconCssClasses
method and the ItemCheckIcon/ItemCheckIconName properties so the checkmark icon
isn't lost when a blank name is provided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 22f0baac-908a-47e8-bbf2-47d9e225c108

📥 Commits

Reviewing files that changed from the base of the PR and between 44492ed and 5b35e3c.

📒 Files selected for processing (3)
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/BitDropdown.razor.cs
  • src/BlazorUI/Bit.BlazorUI/Components/Inputs/Dropdown/_BitDropdownItem.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Inputs/Dropdown/BitDropdownDemo.razor.cs

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

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

@msynk msynk changed the title Add missing new ItemItemIcon parameter to BitDropdown (#12217) Add missing new ItemCheckIcon parameter to BitDropdown (#12217) Mar 28, 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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

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

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

@msynk msynk merged commit 4367f09 into bitfoundation:develop Mar 28, 2026
7 checks passed
@msynk msynk deleted the 12217-blazorui-dropdown-missing-new-icon branch March 28, 2026 19:09
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.

Missing new Icon implementation from the BitDropdown component

3 participants