feat: added share button - #150
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughAdds a ShareLocationButton to the marker popup that builds a share URL from place.metadata.uuid, tries navigator.share with clipboard fallback, shows toast notifications, updates LocationDetailsBox layout to include share + report actions, adds i18n keys (en/pl/ua), and adds tests for share behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User"
participant UI as "LocationDetailsBox\n(ShareLocationButton)"
participant WebAPI as "Navigator\n(Web Share API)"
participant Clipboard as "Navigator.clipboard"
participant Toast as "Toast"
rect rgba(200,230,255,0.5)
User->>UI: Click "Share"
UI->>WebAPI: attempt navigator.share({ url })
alt Web Share succeeds
WebAPI-->>UI: resolved
UI->>Toast: toast.success("shared")
else Web Share unavailable or fails
WebAPI--xUI: error / unsupported
UI->>Clipboard: navigator.clipboard.writeText(url)
alt Clipboard succeeds
Clipboard-->>UI: resolved
UI->>Toast: toast.success("link copied")
else Clipboard fails
Clipboard--xUI: error
UI->>Toast: toast.error("copy failed")
end
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/components/MarkerPopup/LocationDetails.jsx`:
- Around line 224-239: In handleShare, guard and handle failures from the
Clipboard API: before calling navigator.clipboard.writeText check
navigator.clipboard exists, wrap each writeText call in try/catch and on failure
call toast.error(t('linkCopyFailed')) (and optionally log the error), while
preserving the existing toast.success(t('linkCopied')) on success; update all
locale files (add 'linkCopyFailed' key to en, ua, pl) so translations exist.
Ensure references are to handleShare, navigator.share,
navigator.clipboard.writeText, place.metadata.uuid, toast, and t.
|
# [1.5.0](1.4.0...1.5.0) (2026-02-05) ### Features * added share button ([#150](#150)) ([dd111a7](dd111a7))
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



Summary by CodeRabbit
New Features
Internationalization
UI
Tests