Skip to content

Conversation

@javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented Nov 4, 2025

Close #198

Summary by CodeRabbit

  • Chores
    • Project version updated to 3.2.0-SNAPSHOT
    • Build configuration refined to properly manage frontend artifacts and generated files in version control
    • Internal dependencies cleaned up to improve code quality

@javier-godoy javier-godoy requested a review from paodb November 4, 2025 17:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 4, 2025

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

This pull request addresses a Vaadin 25 compatibility issue where the standard Label component was removed. The solution involves creating a custom package-private Label component within the twincolgrid package, updating TwinColGrid to use it, and bumping the project version to 3.2.0-SNAPSHOT.

Changes

Cohort / File(s) Summary
Version and Build Configuration
pom.xml, .gitignore
Version bumped from 3.1.1-SNAPSHOT to 3.2.0-SNAPSHOT. Added three frontend artifact ignore patterns: /src/main/bundles, /src/main/frontend/generated, /src/main/frontend/index.html.
Custom Label Component
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/Label.java
New package-private Label component class created. Extends Component, implements HasText and HasStyle. Provides constructors for text initialization and setFor() methods (Component and String variants) with validation and id reference handling.
TwinColGrid Import Cleanup
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java
Removed unused import of com.vaadin.flow.component.html.Label to resolve compilation failure in Vaadin 25.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Label.java: Verify that the custom Label implementation correctly mimics expected Vaadin Label behavior, particularly the setFor() method's validation logic and id reference handling.
  • TwinColGrid.java: Confirm that all references to Label now use the newly created custom component rather than the removed Vaadin standard component.
  • Version alignment: Ensure the version bump to 3.2.0-SNAPSHOT is intentional and consistent with project versioning strategy.

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a new Label compatibility component to resolve Vaadin 25 compilation issues.
Linked Issues check ✅ Passed The PR successfully resolves issue #198 by creating a custom Label component to replace the removed Vaadin HTML Label, fixing all three compilation errors.
Out of Scope Changes check ✅ Passed All changes are directly related to resolving the compilation failure: new Label class, import removal, version bump, and .gitignore updates for build artifacts.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch vaadin25

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: 0

🧹 Nitpick comments (1)
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/Label.java (1)

45-47: LGTM! Consider optional null validation.

The implementation correctly sets the HTML for attribute. Since the method is package-private and primarily called from the validated setFor(Component) method, the absence of null checking on forId is acceptable.

If you want to add defensive programming for future maintenance, consider adding null validation:

 public void setFor(String forId) {
+  if (forId == null) {
+    throw new IllegalArgumentException("The 'for' id cannot be null");
+  }
   getElement().setAttribute("for", forId);
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 187bb61 and 8d44028.

📒 Files selected for processing (4)
  • .gitignore (1 hunks)
  • pom.xml (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/Label.java (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (0 hunks)
💤 Files with no reviewable changes (1)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java
🔇 Additional comments (5)
pom.xml (1)

6-6: LGTM! Version bump is appropriate.

The minor version increment from 3.1.1-SNAPSHOT to 3.2.0-SNAPSHOT correctly reflects the addition of Vaadin 25 compatibility while maintaining backward compatibility.

.gitignore (1)

20-22: LGTM! Standard frontend artifact patterns.

The added ignore patterns for build-generated frontend artifacts under /src/main/ are appropriate and consistent with existing patterns in the file.

src/main/java/com/flowingcode/vaadin/addons/twincolgrid/Label.java (3)

28-29: LGTM! Clean component declaration.

The package-private visibility is appropriate for an internal compatibility component, and the implementation of HasText and HasStyle provides the essential label functionality.


31-35: LGTM! Standard Vaadin component initialization pattern.

Both constructors follow Vaadin conventions. The text constructor correctly appends a Text node to the element, which integrates properly with the HasText interface.


37-43: LGTM! Robust validation and error handling.

The null check and ID requirement are appropriate for HTML label association. The clear error messages guide proper usage, and the delegation to setFor(String) avoids code duplication.

Copy link
Member

@paodb paodb left a comment

Choose a reason for hiding this comment

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

LGTM

@paodb paodb merged commit ed06d68 into master Nov 4, 2025
6 checks passed
@paodb paodb deleted the vaadin25 branch November 4, 2025 18:37
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.

Vaadin 25: Compilation failure (cannot find symbol Label)

3 participants