Skip to content

feat: add Geolocation API#23527

Open
Artur- wants to merge 4 commits intomainfrom
feature/geo
Open

feat: add Geolocation API#23527
Artur- wants to merge 4 commits intomainfrom
feature/geo

Conversation

@Artur-
Copy link
Member

@Artur- Artur- commented Feb 15, 2026

Wraps the browser's Geolocation API with two entry points:

  • Geolocation.get() for one-shot position
  • Geolocation.track() for continuous tracking via Signals, automatically tied to the owner component's lifecycle

@github-actions
Copy link

github-actions bot commented Feb 15, 2026

Test Results

1 263 files   -   119  1 263 suites   - 119   1h 23m 38s ⏱️ -2s
8 589 tests  - 1 283  8 532 ✅  - 1 269  52 💤  - 19  0 ❌ ±0  5 🔥 +5 
9 062 runs   - 1 283  8 996 ✅  - 1 269  61 💤  - 19  0 ❌ ±0  5 🔥 +5 

For more details on these errors, see this check.

Results for commit 2f6f831. ± Comparison against base commit 2a81ded.

This pull request removes 1294 and adds 11 tests. Note that renamed tests count towards both.
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplateWithComments_commentsProperlyIgnored
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeInRenderBeforeHtml_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlAfterRender_templateProperlyParsed
com.vaadin.flow.component.littemplate.BundleLitParserTest ‑ parseTemplate_codeWithHtmlBeforeRender_templateProperlyParsed
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_disabled_exceptionIsThrown
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setAttributeBinding_attributeIsIgnored
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setClass_classIsSetAsAttribute
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setDynamicValue_attributeIsIgnored
com.vaadin.flow.component.littemplate.InjectableLitElementInitializerTest ‑ initializeElement_setHref_hrefIsSetAsAttribute
…
com.vaadin.flow.component.geolocation.GeolocationTest ‑ geolocationCoordinates_jacksonRoundTrip
com.vaadin.flow.component.geolocation.GeolocationTest ‑ geolocationError_jacksonRoundTrip
com.vaadin.flow.component.geolocation.GeolocationTest ‑ geolocationPosition_jacksonRoundTrip
com.vaadin.flow.component.geolocation.GeolocationTest ‑ get_executesPromiseJs
com.vaadin.flow.component.geolocation.GeolocationTest ‑ track_autoStopsOnDetach
com.vaadin.flow.component.geolocation.GeolocationTest ‑ track_registersListenersAndExecutesWatchJs
com.vaadin.flow.component.geolocation.GeolocationTest ‑ track_signalUpdatesOnErrorEvent
com.vaadin.flow.component.geolocation.GeolocationTest ‑ track_signalUpdatesOnPositionEvent
com.vaadin.flow.component.geolocation.GeolocationTest ‑ track_stateTransitionsFromErrorToPosition
com.vaadin.flow.uitest.ui.GeolocationIT ‑ get_returnsPosition[any_Chrome_]
…

♻️ This comment has been updated with latest results.

@Artur- Artur- marked this pull request as ready for review February 21, 2026 11:09
@sonarqubecloud
Copy link

Provides access to the browser's Geolocation API with two usage modes:

- get(): one-shot position request with success/error callbacks
- track(): continuous tracking via a reactive Signal tied to a
  component's lifecycle, using a GeolocationState sealed type
  (Pending | GeolocationPosition | GeolocationError) that enables
  exhaustive pattern matching

Includes records for coordinates, position, error, and options,
a JS module that bridges navigator.geolocation to Vaadin's event
system, and unit + integration tests.
@mshabarov mshabarov requested a review from platosha March 2, 2026 12:41
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to convert this to TypeScript and move to flow-client?

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition, please make sure that TypeScript would have clear JSON event data definitions. This would help matching any changes with Java in future.

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

Labels

Projects

Status: 🔎Iteration reviews

Development

Successfully merging this pull request may close these issues.

5 participants