Skip to content

feat(web): share and copy-phone on the detail page - #4

Merged
malinfossum merged 1 commit into
mainfrom
feat/share-copy
Sep 7, 2026
Merged

malinfossum merged 1 commit into
mainfrom
feat/share-copy

Conversation

@malinfossum

Copy link
Copy Markdown
Owner

What

Two actions on the resource detail page:

  • Del — hands the service's name, phone and this page's URL to the share sheet. Browsers without one get Kopier lenke, which copies the URL instead.
  • Kopier nummer — beside the phone link, copies the number as displayed.

Outcomes are announced in the existing live region (link copied / number copied / could not copy). A cancelled share sheet stays silent; a failing one degrades to copying the link. Neither button renders when the browser lacks the capability.

Why

The base spec treats shared links as expected traffic and says a number that has to be retyped does not get called. Share + copy close that gap on the page people actually send each other. Follows the browser-APIs fit check after PR #3.

How

web/src/services/contactActions.ts holds the logic over an injected navigator-like object, so the component stays render-only and the helper tests without React. Six new detail.* keys in nb and en.

Verification

  • vitest: 73 passed (10 new, written first)
  • Biome and tsc clean, vite build OK
  • Not browser-verified — needs the local API. Worth a tap on your phone after deploy.

Share sends the service's name, phone and this page's URL to the share
sheet; where the browser has none the same button copies the link. A
copy button beside the phone number copies it as shown. Both announce
their outcome in the live region; a cancelled sheet stays silent, and a
failing sheet degrades to copying the link. The buttons only render when
the browser can actually do the thing.
@malinfossum
malinfossum merged commit af2dd4a into main Sep 7, 2026
6 checks passed
@malinfossum
malinfossum deleted the feat/share-copy branch September 7, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant