Skip to content

Miscellaneous fixes#116

Open
javier-godoy wants to merge 5 commits intomasterfrom
20260319
Open

Miscellaneous fixes#116
javier-godoy wants to merge 5 commits intomasterfrom
20260319

Conversation

@javier-godoy
Copy link
Member

@javier-godoy javier-godoy commented Mar 19, 2026

Fix minor issues identified during code review

Summary by CodeRabbit

  • Bug Fixes

    • Fixed calendar navigation behavior to ensure consistent results across different layouts.
    • Corrected value boundary logic to properly constrain date inputs when both limits are set.
  • Improvements

    • Refined internal initialization and object construction patterns.
    • Eliminated redundant code statements.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a486f50a-e724-4e14-ad12-d9e611303293

📥 Commits

Reviewing files that changed from the base of the PR and between 9a88f78 and 07415bf.

📒 Files selected for processing (4)
  • src/main/java/com/flowingcode/addons/ycalendar/MonthCalendar.java
  • src/main/java/com/flowingcode/addons/ycalendar/YearMonthField.java
  • src/main/resources/META-INF/frontend/fc-year-calendar/fc-year-calendar.js
  • src/main/resources/META-INF/frontend/fc-year-month-field/fc-year-month-field.js
💤 Files with no reviewable changes (1)
  • src/main/java/com/flowingcode/addons/ycalendar/MonthCalendar.java

Walkthrough

This pull request addresses code quality and bug fixes across Java backend and JavaScript frontend components. Changes include removing a duplicate assignment in MonthCalendar, refactoring JSON object construction in YearMonthField while removing an unused generic type parameter, fixing an undeclared variable reference in the year calendar navigation logic, and correcting control flow in date boundary handling to prevent double-clamping.

Changes

Cohort / File(s) Summary
Backend Java Logic
src/main/java/com/flowingcode/addons/ycalendar/MonthCalendar.java
Removed duplicate assignment statement in setYearMonth() method; Objects.requireNonNull() now directly assigns to this.yearMonth.
Backend Constructor & JSON Handling
src/main/java/com/flowingcode/addons/ycalendar/YearMonthField.java
Removed generic type parameter from constructor signature. Refactored setMin() and setMax() methods to build JSON objects explicitly via Json.createObject() and put() instead of string parsing. Added JsonObject import.
Frontend Year Calendar Navigation
src/main/resources/META-INF/frontend/fc-year-calendar/fc-year-calendar.js
Fixed undeclared variable reference in _onKeyDown() by using children.length instead of grid.length for computing months per row.
Frontend Date Normalization
src/main/resources/META-INF/frontend/fc-year-month-field/fc-year-month-field.js
Changed max-range handling in __normalizeValue() from standalone if to else if chain to prevent applying both min and max clamping in same call.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Fix javadoc #86: Modifies YearMonthField.java with Javadoc fix for setMax method, sharing common Java backend context with this PR's constructor and JSON handling changes.
  • feat: add compatibility with Vaadin 25 #104: Updates YearMonthField.java imports and JsonSerializer usage, directly overlapping with this PR's JSON construction refactoring work.

Suggested reviewers

  • mlopezFC
  • paodb
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "Miscellaneous fixes" is vague and generic, using non-descriptive language that fails to convey meaningful information about the specific changes in the changeset. Consider using a more descriptive title that reflects the main fixes, such as "Fix code review issues across YearMonthField and MonthCalendar" or reference the primary theme of the changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 20260319
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@sonarqubecloud
Copy link

@javier-godoy javier-godoy requested review from mlopezFC and paodb March 19, 2026 19:52
@javier-godoy javier-godoy marked this pull request as ready for review March 19, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

1 participant