Add new Icon parameters to BitCarousel (#12098)#12099
Add new Icon parameters to BitCarousel (#12098)#12099msynk merged 3 commits intobitfoundation:developfrom
Conversation
WalkthroughRefactors BitCarousel to support external icons via BitIconInfo (with parallel built‑in name properties), updates Razor rendering to use icon CSS classes, removes an RTL flip helper in SCSS, and adds demo examples showing external icon usage. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 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
🤖 Fix all issues with AI agents
In `@src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor`:
- Line 38: Remove the orphaned "bit-csl-rbi" CSS class from the class attribute
in BitCarousel.razor; update the class string that currently reads
class="bit-csl-rbi `@goRightIcon`?.GetCssClasses() `@Classes`?.GoRightButtonIcon" to
omit "bit-csl-rbi" so only `@goRightIcon`?.GetCssClasses() and
`@Classes`?.GoRightButtonIcon remain (preserve existing spacing/concatenation
logic and do not add new classes).
🧹 Nitpick comments (2)
src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.scss (1)
1-1: Remove the.scssextension from the@importpath.Stylelint flags
scss/load-partial-extension: the@importshould omit the file extension for SCSS partials.Proposed fix
-@import "../../../Styles/functions.scss"; +@import "../../../Styles/functions";src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor (1)
25-26: Consider adding brief comments explaining the non-obvious default icon assignments.The naming is counterintuitive:
GoLeftIcondefaults to"ChevronRight"andGoRightIcondefaults to"ChevronRight bit-ico-r180". This is correct because "GoLeft" means "navigate to left items" (the button sits on the right side), but it will confuse future maintainers without a quick note.
src/BlazorUI/Bit.BlazorUI/Components/Lists/Carousel/BitCarousel.razor
Outdated
Show resolved
Hide resolved
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
There was a problem hiding this comment.
Actionable comments posted: 2
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/Carousel/BitCarouselDemo.razor.cs (1)
137-137:⚠️ Potential issue | 🟡 MinorCopy-paste error: Title says "BitTimelineClassStyles" instead of "BitCarouselClassStyles".
- Title = "BitTimelineClassStyles", + Title = "BitCarouselClassStyles",
🤖 Fix all issues with AI agents
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Carousel/BitCarouselDemo.razor`:
- Around line 209-210: The GoLeftIcon and GoRightIcon values are reversed in the
BitCarousel examples; update the two carousel usages in BitCarouselDemo.razor so
GoLeftIcon uses a left-pointing icon and GoRightIcon uses a right-pointing icon
(swap the arguments passed to BitIconInfo.Fa and any BitIconInfo.Bi calls used
in those same examples). Locate the carousel components in BitCarouselDemo.razor
that set the GoLeftIcon and GoRightIcon properties and swap their assigned icon
identifiers so GoLeftIcon references the left-arrow icon and GoRightIcon
references the right-arrow icon in both carousel examples.
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Carousel/BitCarouselDemo.razor.cs`:
- Around line 596-650: The example7RazorCode string has the left/right icons
swapped: GoLeftIcon is set to right-arrow icons and GoRightIcon to left-arrow
icons; update the two occurrences inside example7RazorCode so GoLeftIcon uses
the left-arrow icon names and GoRightIcon uses the right-arrow icon names (match
the corrected mapping used in the .razor file) to keep BitIconInfo.Fa(...) and
BitIconInfo.Bi(...) assignments consistent.
🧹 Nitpick comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/Components/Lists/Carousel/BitCarouselDemo.razor (1)
204-204: Inline<link>stylesheet tags in component body.Loading external stylesheets via
<link>tags in the component body (rather than in the<head>) works in browsers but may cause a flash of unstyled content and is not standard practice. Consider noting this in the demo or moving the links to the<head>section or using Blazor'sHeadContentcomponent.Also applies to: 235-235


closes #12098
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores