feat(web): share and copy-phone on the detail page - #4
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two actions on the resource detail page:
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.tsholds the logic over an injected navigator-like object, so the component stays render-only and the helper tests without React. Six newdetail.*keys in nb and en.Verification
vite buildOK