Skip to content

Add new Icon parameters to BitTimeline (#12100)#12101

Open
msynk wants to merge 1 commit intobitfoundation:developfrom
msynk:12100-blazorui-timeline-new-icons
Open

Add new Icon parameters to BitTimeline (#12100)#12101
msynk wants to merge 1 commit intobitfoundation:developfrom
msynk:12100-blazorui-timeline-new-icons

Conversation

@msynk
Copy link
Member

@msynk msynk commented Feb 16, 2026

closes #12100

Summary by CodeRabbit

  • New Features

    • Timeline components now support external icon libraries (FontAwesome, Bootstrap Icons) via BitIconInfo
    • Added Icon property to BitTimelineItem, BitTimelineOption, and BitTimelineNameSelectors
    • Icon parameter takes precedence over IconName when both are set
  • Documentation

    • Added demo examples showcasing integration of external icon libraries with Timeline

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Walkthrough

This pull request adds external icon support to the BitTimeline component. A new BitIconInfo property is introduced to BitTimelineItem, BitTimelineOption, and BitTimelineNameSelectors. The component now includes a GetIcon() helper method to retrieve and wrap icon data. Extensive demo examples showcase FontAwesome, Bootstrap Icons, and custom icon implementations.

Changes

Cohort / File(s) Summary
Core Component Implementation
src/BlazorUI/Bit.BlazorUI/Components/Lists/Timeline/BitTimeline.razor, src/BlazorUI/Bit.BlazorUI/Components/Lists/Timeline/BitTimeline.razor.cs
Added GetIcon() helper method to retrieve icons from items. Updated icon rendering logic to use BitIconInfo objects and their GetCssClasses() method instead of string-based icon names. Replaced icon-name existence checks with null checks on wrapped icon objects.
Timeline Item & Option Types
src/BlazorUI/Bit.BlazorUI/Components/Lists/Timeline/BitTimelineItem.cs, src/BlazorUI/Bit.BlazorUI/Components/Lists/Timeline/BitTimelineOption.cs, src/BlazorUI/Bit.BlazorUI/Components/Lists/Timeline/BitTimelineNameSelectors.cs
Added new Icon property of type BitIconInfo? to both BitTimelineItem and BitTimelineOption. Added corresponding Icon selector to BitTimelineNameSelectors with default targeting BitTimelineItem.Icon. Includes XML documentation for external icon library usage.
Demo Component Setup
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/BitTimelineDemo.razor, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/BitTimelineDemo.razor.cs, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/Event.cs
Added ExternalIcon property to Event demo model. Updated demo metadata to document new Icon parameter and include BitIconInfo type documentation with Name, BaseClass, and Prefix properties. Minor BOM/whitespace corrections.
Custom Timeline Demo Examples
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/_BitTimelineCustomDemo.razor*
Added external icon selector to name selectors. Created demo data lists (externalIconCustoms1-3, bootstrapIconCustoms1-3) showcasing FontAwesome and Bootstrap icon variants with BitIconInfo configurations. Added new "External Icons" demo section with corresponding RTL example renumbering from example11 to example12.
Item Timeline Demo Examples
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/_BitTimelineItemDemo.razor*
Added new external and bootstrap icon item collections (externalIconItems1-3, bootstrapIconItems1-3) demonstrating various BitIconInfo configurations. Introduced "External Icons" demo block with FontAwesome and Bootstrap Icons styling. Reorganized RTL example from example11 to example12 numbering.
Option Timeline Demo Examples
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/_BitTimelineOptionDemo.razor*
Added comprehensive external icon demonstrations for timeline options including FontAwesome, Bootstrap Icons, and BitIconInfo variants across different timeline styles (Outline, Text). Renumbered RTL example from example11 to example12. Added new code samples with multi-variant icon examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Hops through timelines bright and bold,
External icons now unfold,
FontAwesome, Bootstrap signs dance free,
BitIconInfo sets icons spree—
Timeline glows with vibrant flair!

🚥 Pre-merge checks | ✅ 5 | ❌ 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 (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding new Icon parameters to the BitTimeline component.
Linked Issues check ✅ Passed The PR successfully implements the new Icon parameters for BitTimeline to enable external icon support, fulfilling issue #12100 requirements.
Out of Scope Changes check ✅ Passed All changes are directly related to adding Icon support to BitTimeline; minor BOM fixes and demo updates are necessary supporting changes.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Timeline/BitTimelineDemo.razor.cs (1)

462-470: ⚠️ Potential issue | 🟡 Minor

Pre-existing duplicate IsEnabled entry in NameSelectors documentation.

IsEnabled appears twice in the NameSelectors parameters list (first at lines 417–425, then again at lines 462–470). While not introduced by this PR, it's worth cleaning up since you're already editing this metadata block.

Proposed fix: remove the duplicate entry
                 new()
                 {
                     Name = "Reversed",
                     Type = "BitNameSelectorPair<TItem, string?>",
                     DefaultValue = "new(nameof(BitTimelineItem.Reversed))",
                     Description = "Reversed field name and selector of the custom input class.",
                     Href = "#name-selector-pair",
                     LinkType = LinkType.Link,
                 },
-                new()
-                {
-                    Name = "IsEnabled",
-                    Type = "BitNameSelectorPair<TItem, bool>",
-                    DefaultValue = "new(nameof(BitTimelineItem.IsEnabled))",
-                    Description = "IsEnabled field name and selector of the custom input class.",
-                    Href = "#name-selector-pair",
-                    LinkType = LinkType.Link,
-                },
                 new()
                 {
                     Name = "SecondaryContent",

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.

The new Icon implementation is missing in the BitTimeline component

2 participants