feat: add share app menu item#26
Merged
Merged
Conversation
Adds a share menu entry that invokes the native share dialog when supported by the platform and a share link is configured. Bumps @smartcompanion/data, services, and ui to 0.8.0 for getShareService() support. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
✅ Deploy Preview for smartcompanion-audioguide-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Closed
workbox-build was updated to 7.4.1 via the lockfile, but src/sw.js still referenced workbox-v7.4.0/workbox-sw.js. The directory no longer exists in the build output, so the service worker failed to activate and offline tests broke. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a conditional “Share App” entry to the main side menu that triggers the native share sheet via Capacitor, and updates SmartCompanion package versions to pick up the new share service API.
Changes:
- Add a “Share App” menu item in
app-rootthat callsShare.share()when supported and when a share link is configured. - Gate rendering of the share menu item on
Share.canShare()andgetShareService().hasShare(). - Bump
@smartcompanion/data,@smartcompanion/services, and@smartcompanion/uito^0.8.0and add@capacitor/share.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/app-root/app-root.tsx | Adds share translation/state, support detection via Share.canShare(), and a conditional share menu item. |
| package.json | Adds @capacitor/share and bumps SmartCompanion packages to ^0.8.0. |
| package-lock.json | Locks updated dependency graph for the new package versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Stubs navigator.share via puppeteer's evaluateOnNewDocument so the Capacitor Share web fallback reports availability under headless Chrome. Verifies the share menu item renders with the localized label and that clicking it closes the side menu before invoking navigator.share with the configured URL/title (regression guard for the menuService.close() call in shareApp()). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Capturing the labels collection once before the waitUntil loop made the helper brittle for items that render asynchronously (e.g. the share menu item appears only after Share.canShare() resolves). On Linux CI the share spec lost the race and threw on labels[3] being undefined. Re-querying inside the loop lets the wait pick up late-rendering items. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
@capacitor/shareShare.canShare()is supported andserviceFacade.getShareService().hasShare()returns true@smartcompanion/data,@smartcompanion/services, and@smartcompanion/uito^0.8.0to pick upgetShareService()Test plan
npm run buildsucceeds🤖 Generated with Claude Code