Skip to content

Conversation

@paodb
Copy link
Member

@paodb paodb commented Jan 9, 2026

Summary by CodeRabbit

  • Styling
    • Added new styled-badges visuals (light green accents, green dashed border, adjusted radius) and removed an older redundant styling block to streamline appearance.
  • New Features
    • Demo can conditionally load an external CSS resource to preview alternate styles.
  • Documentation
    • Updated license header year to 2026.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

Walkthrough

Adds a class-level @CssImport to StyledBadgesDemo, inserts a conditional @DemoSource annotation for an external CSS file, creates styled-badges-demo.css with styled-badges rules, and updates badge-list-demo-styles.css (license year and removal of a styling block).

Changes

Cohort / File(s) Summary
Java Source Code
src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java
Added import com.vaadin.flow.component.dependency.CssImport; added @CssImport("./styles/styled-badges-demo.css"); added conditional @DemoSource block guarded by // #if vaadin eq 0 ... // #endif``; updated header year.
Existing CSS
src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css
Updated license year (2024 → 2026); removed the CSS rule block that targeted fc-badge-list[class="styled-badges-second-example"]::part(overflow-badge) and .custom-styled-badge.
New CSS
src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
Added new Apache-2.0 header and rules for fc-badge-list.styled-badges-second-example::part(overflow-badge) and .custom-styled-badge (background-color, color, border, border-radius).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: refactoring the StyledBadgesDemo by extracting CSS styling into a separate stylesheet file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ce6b72 and 81a034d.

📒 Files selected for processing (3)
  • src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java
  • src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css
  • src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
🔇 Additional comments (2)
src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css (1)

20-31: LGTM!

The removal of styled-badges-specific CSS from this shared stylesheet is appropriate. Moving these rules to styled-badges-demo.css improves separation of concerns and makes the demo styling self-contained.

src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java (1)

34-42: Clean refactoring to separate demo-specific styles.

The combination of @CssImport for runtime loading and conditional @DemoSource for source viewing in the demo is a good approach for modularity. The CSS file exists at the specified path with the expected style definitions for styled-badges-second-example and custom-styled-badge.


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.

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/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java (1)

22-42: Fix incorrect CSS file path in conditional @DemoSource annotation.

The actual CSS file is located at src/test/resources/META-INF/frontend/styles/styled-badges-demo.css, but the @DemoSource annotation (lines 36–37) references /src/test/resources/META-INF/resources/frontend/styles/styled-badges-demo.css with an extra resources/ directory level. This path mismatch will break the demo "view source" feature. Update the path to /src/test/resources/META-INF/frontend/styles/styled-badges-demo.css.

Fix
 @DemoSource(value = "/src/test/resources/META-INF/resources/frontend/styles/styled-badges-demo.css",
     caption = "styled-badges-demo.css")
+// should be:
+// @DemoSource(value = "/src/test/resources/META-INF/frontend/styles/styled-badges-demo.css",
+//     caption = "styled-badges-demo.css")
🤖 Fix all issues with AI agents
In @src/test/resources/META-INF/frontend/styles/styled-badges-demo.css:
- Around line 21-26: The selector uses a brittle attribute-equals match
(fc-badge-list[class="styled-badges-second-example"]) — replace it with a class
selector to be robust: target
fc-badge-list.styled-badges-second-example::part(overflow-badge) instead,
keeping the existing .custom-styled-badge rule and preserving the
background-color, color, border and border-radius declarations; update the
selector in the rule that currently contains
fc-badge-list[class="styled-badges-second-example"]::part(overflow-badge) so it
uses the class-based selector.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36826e5 and 8700f58.

📒 Files selected for processing (3)
  • src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java
  • src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css
  • src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
🔇 Additional comments (1)
src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css (1)

5-5: License header year update looks good.

@paodb paodb force-pushed the update-styled-demo-sources branch from 8700f58 to 3ce6b72 Compare January 9, 2026 15:13
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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java:
- Around line 35-38: Update the DemoSource annotation in StyledBadgesDemo (the
DemoSource on the class) to use the correct resource path by removing the extra
"/resources" segment; change the value from
"/src/test/resources/META-INF/resources/frontend/styles/styled-badges-demo.css"
to "src/test/resources/META-INF/frontend/styles/styled-badges-demo.css" so it
points to the actual file location (the CssImport can remain as-is).
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8700f58 and 3ce6b72.

📒 Files selected for processing (3)
  • src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java
  • src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css
  • src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/test/resources/META-INF/frontend/styles/styled-badges-demo.css
  • src/test/resources/META-INF/frontend/styles/badge-list-demo-styles.css
🔇 Additional comments (2)
src/test/java/com/flowingcode/vaadin/addons/badgelist/StyledBadgesDemo.java (2)

5-5: LGTM!

Copyright year update is appropriate for 2026.


24-24: LGTM!

The import for CssImport is correctly added to support the annotation on line 41.

@paodb paodb force-pushed the update-styled-demo-sources branch from 3ce6b72 to 81a034d Compare January 9, 2026 15:21
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

@paodb paodb requested a review from javier-godoy January 9, 2026 15:24
@javier-godoy javier-godoy merged commit 315736c into master Jan 9, 2026
4 checks passed
@javier-godoy javier-godoy deleted the update-styled-demo-sources branch January 9, 2026 16:17
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.

3 participants