Add Instagram sharing support#163
Conversation
WalkthroughAdds Instagram as a supported sharing platform to the core SocialShareButton widget (default platforms list, icon/label/color in getPlatformsHTML, URL in getShareURL, share() flow reusing the Discord-style copy-and-open pattern), updates Preact/React/Qwik wrapper default platforms, and documents Instagram in the README. ChangesInstagram Platform Support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/social-share-button.js (1)
420-438: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate stale comment to reflect Instagram branch.
The comment above the conditional (lines 426-429) only explains the Discord rationale, but the condition now also covers
📝 Proposed comment update
// Platform-specific sharing trigger logic: - // Discord does not provide a native web-share intent; therefore, the most reliable - // fallback is to copy the share URL to the clipboard and then navigate the user - // towards Discord's direct messaging area. + // Discord and Instagram do not provide a native web-share intent; therefore, the + // most reliable fallback is to copy the share URL to the clipboard and then + // navigate the user to the platform (Discord DMs / Instagram home). if (platform === "discord" || platform === "instagram") {As per path instructions, "Add comments for edge cases and non-obvious logic" for newly modified logic in
src/**/*.{js,jsx}.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/social-share-button.js` around lines 420 - 438, The inline comment in share() is stale because the conditional now handles both discord and instagram, so update the comment near the platform-specific branch to describe both cases. Keep the note concise but explicit about why copyLink() plus window.open(...) is used for the discord/instagram fallback, so the logic in social-share-button.js stays aligned with the branching in share().Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/social-share-button.js`:
- Around line 420-438: The inline comment in share() is stale because the
conditional now handles both discord and instagram, so update the comment near
the platform-specific branch to describe both cases. Keep the note concise but
explicit about why copyLink() plus window.open(...) is used for the
discord/instagram fallback, so the logic in social-share-button.js stays aligned
with the branching in share().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: e3e8210a-64fc-4d18-8992-96377f1899bf
📒 Files selected for processing (5)
README.mdsrc/social-share-button-preact.jsxsrc/social-share-button-qwik.tsxsrc/social-share-button-react.jsxsrc/social-share-button.js
Addressed Issues:
Fixes #159
Screenshots/Recordings:
Not applicable. This change only adds Instagram to the supported platform list and updates the library wrappers/documentation.
Additional Notes:
Instagram has been added as a supported platform in the core SocialShareButton library and the React, Preact, and Qwik wrappers. The README was updated to keep the documented platform list in sync with the implementation.
Instagram is handled using the same copy-and-open fallback pattern as Discord, since there is no reliable native web-share intent for it.
Checklist
I used AI tools to assist with this change, but I verified the implementation and ran validation before pushing.
Summary by CodeRabbit