Add place sharing via Web Share API and Marco link #117

Merged
raucao merged 2 commits from feature/share_button into master 2026-11-16 09:25:36 +00:00
Owner

Adds a Share button to the place details actions row.

On systems with the Web Share API (mobile), the button opens the native share sheet. Everywhere else it opens a small fallback menu offering "Copy link" and "Copy coordinates". Options are feature-detected, so nothing that cannot work is shown, and the button is hidden while editing or when there is nothing to share.

Sharing stays Marco/OSM-first, with no external map links:

  • OSM places share the public Marco place URL, plus the place name and coordinates as text.
  • Custom/private places share only the name and coordinates, because their internal id is private and a Marco URL for them would not resolve for anyone else.
  • "Copy coordinates" copies plain lat, lon. Copying falls back to document.execCommand, so the feature keeps working on non-secure origins such as a LAN dev server, where the async Clipboard API is unavailable.

Implementation: app/utils/share.js (pure helpers), app/components/place-share-menu.gjs (the fallback popover), and the Share button in app/components/place-details.gjs.

Tests: new unit tests for the share helpers and integration tests for the button and menu, including the insecure-origin copy fallback. pnpm lint passes and the full suite passes (440 tests) locally.

Adds a Share button to the place details actions row. On systems with the Web Share API (mobile), the button opens the native share sheet. Everywhere else it opens a small fallback menu offering "Copy link" and "Copy coordinates". Options are feature-detected, so nothing that cannot work is shown, and the button is hidden while editing or when there is nothing to share. Sharing stays Marco/OSM-first, with no external map links: - OSM places share the public Marco place URL, plus the place name and coordinates as text. - Custom/private places share only the name and coordinates, because their internal id is private and a Marco URL for them would not resolve for anyone else. - "Copy coordinates" copies plain `lat, lon`. Copying falls back to `document.execCommand`, so the feature keeps working on non-secure origins such as a LAN dev server, where the async Clipboard API is unavailable. Implementation: `app/utils/share.js` (pure helpers), `app/components/place-share-menu.gjs` (the fallback popover), and the Share button in `app/components/place-details.gjs`. Tests: new unit tests for the share helpers and integration tests for the button and menu, including the insecure-origin copy fallback. `pnpm lint` passes and the full suite passes (440 tests) locally.
raucao added 1 commit 2026-11-16 08:30:57 +00:00
Add place sharing via Web Share API and Marco link
CI / Lint (pull_request) Successful in 54s
CI / Test (pull_request) Failing after 1m11s
53b5c2d2a4
Add a Share button to the place details actions row. On systems with the
Web Share API it opens the native share sheet; everywhere else it opens a
small fallback menu offering "Copy link" and "Copy coordinates".

- OSM places share the public Marco place URL plus the name and
  coordinates; custom places share name and coordinates only, since their
  internal id is private and their Marco URL would not resolve for others
- No external map links; copy falls back to document.execCommand so the
  feature keeps working on non-secure origins
- The button is hidden while editing and when there is nothing to share
raucao added the feature label 2026-11-16 08:31:23 +00:00
raucao added 1 commit 2026-11-16 09:01:17 +00:00
Move edit action into the saved-places dropdown
CI / Lint (pull_request) Successful in 51s
CI / Test (pull_request) Successful in 1m9s
Release Drafter / Update release notes draft (pull_request) Successful in 41s
509fc08268
The edit form only changes the saved entry's title and description, not the
OSM data, so surface it under the Save dropdown as "Edit saved place"
instead of a standalone action button.

This also keeps the actions row to Save and Share with even padding, so the
earlier equal-width row layout is no longer needed.
raucao merged commit 32c2dbe206 into master 2026-11-16 09:25:36 +00:00
raucao deleted branch feature/share_button 2026-11-16 09:25:37 +00:00
Sign in to join this conversation.