Skip to content

feat: add share app menu item#26

Merged
stefanhuber merged 5 commits into
mainfrom
feat/share-app
May 8, 2026
Merged

feat: add share app menu item#26
stefanhuber merged 5 commits into
mainfrom
feat/share-app

Conversation

@stefanhuber
Copy link
Copy Markdown
Member

Summary

  • Adds a "Share App" menu entry that opens the native share dialog via @capacitor/share
  • Menu item is only rendered when Share.canShare() is supported and serviceFacade.getShareService().hasShare() returns true
  • Bumps @smartcompanion/data, @smartcompanion/services, and @smartcompanion/ui to ^0.8.0 to pick up getShareService()

Test plan

  • On a platform supporting Capacitor Share (e.g. iOS/Android wrapper), confirm the "Share App" menu item appears and triggers the native share sheet with the configured URL/title
  • On a platform without share support (or no share configured), confirm the menu item is hidden
  • Verify other menu items (Overview, Selection, Language) still render and navigate correctly
  • npm run build succeeds

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 8, 2026 17:34
@netlify
Copy link
Copy Markdown

netlify Bot commented May 8, 2026

Deploy Preview for smartcompanion-audioguide-app ready!

Name Link
🔨 Latest commit 3da1bb1
🔍 Latest deploy log https://app.netlify.com/projects/smartcompanion-audioguide-app/deploys/69fe24fc22aa3400086e40c0
😎 Deploy Preview https://deploy-preview-26--smartcompanion-audioguide-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-root that calls Share.share() when supported and when a share link is configured.
  • Gate rendering of the share menu item on Share.canShare() and getShareService().hasShare().
  • Bump @smartcompanion/data, @smartcompanion/services, and @smartcompanion/ui to ^0.8.0 and 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.

Comment thread src/components/app-root/app-root.tsx Outdated
Comment thread src/components/app-root/app-root.tsx
Comment thread src/components/app-root/app-root.tsx
Comment thread src/components/app-root/app-root.tsx
stefanhuber and others added 3 commits May 8, 2026 19:39
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>
@stefanhuber stefanhuber merged commit 44432c0 into main May 8, 2026
5 checks passed
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.

2 participants