fix(location): confirm before sharing, with accuracy and an approximate option (#340) #353

Merged
jared merged 1 commits from fix/location-confirm into lotus 2026-10-11 23:23:06 -04:00
Owner

Fixes #340.

Once the browser permission had been granted, the composer's location button sent your exact position (6 decimals) from a single click. It also discarded the fix's accuracy, so a ±3.5 km Wi-Fi/IP fix was shown as exact.

Change

  • Confirm dialog ("Share your location?"):
    • shows the coordinates with ±accuracy and a Check on OpenStreetMap link;
    • buttons Cancel / Send approximate (~1 km) / Send; focus starts on Cancel and Esc cancels.
  • utils/geoShare.ts (4 unit tests): RFC 5870 geo URI with ;u= accuracy. Approximate shares round to 2 decimals and never claim better than 1 km.
  • Location cards show the ± when the event carries u=.
  • The toolbar icon is now a pin instead of the globe.

Verified (headless, fix 40.748817, −73.985428 ±3500 m):

action sent
click the button nothing (dialog opens)
Cancel / Esc nothing
Send approximate geo:40.75,-73.99;u=3500
Send geo:40.748817,-73.985428;u=3500

The card then reads "40.74882, -73.98543 (±3.5 km)".

Share location dialog

tsc clean · unit tests pass · ESLint/Prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #340. Once the browser permission had been granted, the composer's location button sent your exact position (6 decimals) from a single click. It also discarded the fix's accuracy, so a ±3.5 km Wi-Fi/IP fix was shown as exact. **Change** - **Confirm dialog** ("Share your location?"): - shows the coordinates with **±accuracy** and a *Check on OpenStreetMap* link; - buttons **Cancel / Send approximate (~1 km) / Send**; focus starts on Cancel and Esc cancels. - `utils/geoShare.ts` (4 unit tests): RFC 5870 geo URI with `;u=` accuracy. Approximate shares round to 2 decimals and never claim better than 1 km. - Location cards show the **±** when the event carries `u=`. - The toolbar icon is now a **pin** instead of the globe. **Verified** (headless, fix 40.748817, −73.985428 ±3500 m): | action | sent | |---|---| | click the button | nothing (dialog opens) | | Cancel / Esc | nothing | | Send approximate | `geo:40.75,-73.99;u=3500` | | Send | `geo:40.748817,-73.985428;u=3500` | The card then reads "40.74882, -73.98543 (±3.5 km)". ![Share location dialog](https://code.lotusguild.org/attachments/7058e2de-1750-421e-b2c8-ba0eedfb0513) `tsc` clean · unit tests pass · ESLint/Prettier clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-11 22:16:09 -04:00
fix(location): confirm before sharing, with accuracy and an approximate option (#340)
CI / Build & Quality Checks (pull_request) Successful in 3m19s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 11s
CI / Playwright smoke (e2e) (pull_request) Successful in 14m32s
cf22fd8501
The composer's location button sent the exact position (6 decimals) from a
single click once the browser permission had been granted, discarding the
fix's accuracy, so a ±3.5 km Wi-Fi/IP fix was shown as exact.

- ShareLocationDialog: "Share your location?" with the coordinates and
  ±accuracy, a "Check on OpenStreetMap" link, and Cancel / Send
  approximate (~1 km) / Send. Focus starts on Cancel; Esc cancels.
- utils/geoShare.ts (unit-tested): RFC 5870 geo URI with `;u=` accuracy;
  approximate shares round to 2 decimals and never claim better than 1 km.
- Location cards show the ± when the event carries `u=`.
- The toolbar icon is a pin instead of the globe.

Verified headless (fix 40.748817,-73.985428 ±3500 m): the click opens the
dialog and sends nothing; Cancel/Esc send nothing; Send approximate →
geo:40.75,-73.99;u=3500; Send → geo:40.748817,-73.985428;u=3500; the card
reads "40.74882, -73.98543 (±3.5 km)".

Fixes #340

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit 1618d71e53 into lotus 2026-10-11 23:23:06 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#353