Skip to content

Conversation

@javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented Jun 5, 2025

Close #196

Summary by CodeRabbit

  • New Features

    • Added validation support to TwinColGrid, including error message display and invalid state handling.
  • Style

    • Enhanced styling for error messages in TwinColGrid, ensuring clear visibility and improved appearance when validation fails.
  • Documentation

    • Updated copyright years in source and style files.
  • Bug Fixes

    • Improved user feedback by showing a custom error message when required selections are missing in demo usage.

@javier-godoy javier-godoy requested review from mlopezFC and paodb June 5, 2025 16:03
@coderabbitai
Copy link

coderabbitai bot commented Jun 5, 2025

Walkthrough

The changes introduce validation error message support for the TwinColGrid component by implementing the HasValidation interface and updating the UI to display error messages when validation fails. Associated CSS and demo code are updated to reflect and style the new validation error message functionality.

Changes

Files/Paths Change Summary
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java
TwinColGridListAdapter.java
Implemented HasValidation interface and added methods for error message handling and validation state.
src/main/resources/META-INF/resources/frontend/styles/twincol-grid.css Added CSS rules to display and style validation error messages for the component.
src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BoundDemo.java Updated demo to use a custom required validation message for the TwinColGrid field.
pom.xml Updated project version from 3.0.1-SNAPSHOT to 3.1.0-SNAPSHOT.

Assessment against linked issues

Objective Addressed Explanation
Show validation error message when TwinColGrid is bound and required validation fails (#196)
Support for custom validator error messages to be displayed in TwinColGrid (#196)

Suggested reviewers

  • mlopezFC
  • paodb
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 5, 2025

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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b07121c and d9a4d18.

📒 Files selected for processing (5)
  • pom.xml (1 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (7 hunks)
  • src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGridListAdapter.java (3 hunks)
  • src/main/resources/META-INF/resources/frontend/styles/twincol-grid.css (2 hunks)
  • src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BoundDemo.java (2 hunks)
🔇 Additional comments (13)
pom.xml (1)

6-6: LGTM! Appropriate version bump for new feature.

The minor version increment from 3.0.1 to 3.1.0 correctly reflects the addition of HasValidation support, following semantic versioning principles.

src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BoundDemo.java (2)

5-5: LGTM! Copyright year updated appropriately.


61-63: Excellent demonstration of the new validation feature.

The addition of a custom validation message properly showcases the new HasValidation implementation. This provides clear usage guidance for developers.

src/main/resources/META-INF/resources/frontend/styles/twincol-grid.css (2)

5-5: LGTM! Copyright year updated appropriately.


47-58: Excellent validation styling implementation.

The CSS rules properly implement error message visibility and styling:

  • Hidden by default, visible when invalid
  • Uses appropriate Vaadin/Lumo design system variables
  • Consistent with standard Vaadin component validation patterns
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGridListAdapter.java (4)

5-5: LGTM! Copyright year updated appropriately.


22-22: LGTM! Proper import for HasValidation interface.


44-44: Excellent implementation of HasValidation interface.

The adapter class now properly implements HasValidation, ensuring consistency with the underlying TwinColGrid component's validation capabilities.


46-46: Good delegation pattern for validation interface.

Extending IDelegate to include HasValidation ensures that all validation methods are properly delegated to the underlying TwinColGrid through the @DeleGate annotation.

src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (4)

5-5: Copyright year update is appropriate.

The copyright year has been correctly updated to reflect the current year.


29-29: HasValidation interface integration looks good.

The import and interface implementation are correctly added to provide validation support for the TwinColGrid component.

Also applies to: 83-83


146-147: Error message span initialization is appropriate.

The error message span is properly declared and initialized for displaying validation messages.


190-193: Error message span integration is well-positioned.

The error message span is correctly configured with CSS class and strategically placed in the selection layout at index 1, positioning it between the column label and the grid for optimal user experience.

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 660b83a into master Jun 9, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from To Do to Pending release in Flowing Code Addons Jun 9, 2025
@paodb paodb deleted the feat-196 branch June 9, 2025 18:27
@paodb paodb moved this from Pending release to Done in Flowing Code Addons Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

missing validation error message

3 participants