Skip to content

feat: add Geolocation API#23527

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

feat: add Geolocation API#23527
Artur- wants to merge 10 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 388 files  + 2   1 388 suites  +2   1h 31m 2s ⏱️ -35s
 9 933 tests +11   9 862 ✅ +63  71 💤 ±0  0 ❌  - 9 
10 406 runs  +11  10 326 ✅ +65  80 💤 ±0  0 ❌  - 9 

Results for commit 39ab8f0. ± Comparison against base commit 30c14ad.

♻️ 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
Dustin4444

This comment was marked as spam.

Artur- added 6 commits March 15, 2026 12:19
Convert the plain JS geolocation module to TypeScript with typed
interfaces matching the Java records, and move it from flow-server
to flow-client where other core client infrastructure lives.

The module is loaded via flow-client's index.ts entry point instead
of a @jsmodule annotation, following the same pattern as Flow.ts.
Signal.get() requires a reactive context, which unit tests don't
have. Use peek() to read signal values without dependency tracking,
matching the pattern used by other signal tests in the codebase.
Import Geolocation from Flow.ts instead of index.ts, since Flow.ts
is what Vite actually bundles at runtime. Add empty export to make
TypeScript emit it as an ES module.

Fix track IT test race condition by listening for the DOM event
directly instead of polling the signal after a single JS round-trip.
Use peek() in view code since it runs outside a reactive context.

Add debug div to GeolocationView to report geolocation API status.
@sonarqubecloud
Copy link

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.

6 participants