Skip to content

feat: add compatible constructor for events#183

Merged
paodb merged 5 commits into
masterfrom
fix-182
Jun 24, 2026
Merged

feat: add compatible constructor for events#183
paodb merged 5 commits into
masterfrom
fix-182

Conversation

@javier-godoy

@javier-godoy javier-godoy commented Jun 23, 2026

Copy link
Copy Markdown
Member

Close #182

Summary by CodeRabbit

  • Version Update

    • Released version 2.6.0
  • Enhancements

    • Improved map click event handling with better latitude/longitude coordinate support
    • Enhanced marker interaction events (drag, click, right-click) with improved coordinate access

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

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: 5fe3ea4e-829d-44f5-8126-77f05a25098f

📥 Commits

Reviewing files that changed from the base of the PR and between 918e7e6 and f9bb15c.

📒 Files selected for processing (3)
  • pom.xml
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMap.java
  • src/main/java/com/flowingcode/vaadin/addons/googlemaps/GoogleMapMarker.java

Walkthrough

Event constructors in GoogleMapClickEvent (in GoogleMap.java) and in the three nested event classes of GoogleMapMarker.java (DragEndEvent, GoogleMapMarkerClickEvent, GoogleMapMarkerRightClickEvent) are updated to accept double lat and double lon parameters via @EventData instead of a JsonValue latLng parameter. The JsonValue-based constructors are deprecated. The addClickListener and addRightClickListener handlers are updated to extract the two primitives manually. The project version is bumped to 2.6.0-SNAPSHOT.

Changes

Primitive lat/lon event constructor migration

Layer / File(s) Summary
GoogleMapClickEvent constructors and listener wiring
src/main/java/.../GoogleMap.java, pom.xml
New GoogleMapClickEvent(source, fromClient, double lat, double lon) constructor added with @EventData on lat/lon. The deprecated JsonValue latLng constructor loses its @EventData mapping. addClickListener and addRightClickListener now extract lat/lon as doubles from the JSON object and call the new constructor. Version bumped to 2.6.0-SNAPSHOT.
GoogleMapMarker drag/click/right-click constructors
src/main/java/.../GoogleMapMarker.java
DragEndEvent, GoogleMapMarkerClickEvent, and GoogleMapMarkerRightClickEvent each gain a new public constructor taking double lat and double lon via @EventData("event.detail.latLng.lat()") / lng(). Prior JsonValue latLng constructors are marked @Deprecated since 2.6.0 with Javadoc updated to point to the new overloads.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • FlowingCode/GoogleMapsAddon#171: Modifies GoogleMap.java's click/right-click handling around event.detail.latLng, directly overlapping with this PR's changes to the same code region.
  • FlowingCode/GoogleMapsAddon#172: Changes how event.detail.latLng data is extracted from Vaadin events in GoogleMap's click handlers, the same area updated in this PR.
  • FlowingCode/GoogleMapsAddon#181: Applies the identical pattern of adding primitive lat/lon @EventData constructors and deprecating JsonValue latLng overloads, doing so for GoogleMapPolyClickEvent.

Suggested reviewers

  • scardanzan
  • paodb
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 'feat: add compatible constructor for events' accurately summarizes the main change—adding new constructors to event classes for Vaadin 25.1 compatibility.
Linked Issues check ✅ Passed The PR implements all primary objectives from issue #182: adds compatible constructors for marker click/drag events and map click events to resolve Vaadin 25.1 JSON deserialization failures.
Out of Scope Changes check ✅ Passed All changes (version bump, new event constructors for GoogleMap and GoogleMapMarker, deprecation of old constructors) are scoped to fixing the Vaadin 25.1 deserialization issue.

✏️ 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 fix-182

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.

@javier-godoy javier-godoy marked this pull request as ready for review June 23, 2026 18:21
@javier-godoy javier-godoy requested review from paodb and scardanzan June 23, 2026 18:21
@paodb paodb merged commit ac7658b into master Jun 24, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from To Do to Pending release in Flowing Code Addons Jun 24, 2026
@paodb paodb deleted the fix-182 branch June 24, 2026 13:33
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending release

Development

Successfully merging this pull request may close these issues.

Vaadin 25.1 Marker Click and Marker Drag event exception

2 participants