Skip to content

Add Instagram sharing support#163

Open
ayush-343 wants to merge 1 commit into
AOSSIE-Org:mainfrom
ayush-343:feature/instagram-share-platform
Open

Add Instagram sharing support#163
ayush-343 wants to merge 1 commit into
AOSSIE-Org:mainfrom
ayush-343:feature/instagram-share-platform

Conversation

@ayush-343

@ayush-343 ayush-343 commented Jul 5, 2026

Copy link
Copy Markdown

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

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

I used AI tools to assist with this change, but I verified the implementation and ran validation before pushing.

Summary by CodeRabbit

  • New Features
    • Added Instagram as a supported sharing platform across the app and widgets.
    • Updated the default sharing options to include Instagram, with a dedicated share button and URL handling.
    • Instagram shares now follow the same link-copying and new-tab flow used for similar platforms.
  • Documentation
    • Updated the README to list Instagram in the supported platforms and sharing options.

@github-actions github-actions Bot added enhancement New feature or request planned Planned feature - not final, may be dropped based on repo direction documentation Changes to documentation files frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/S Small PR (11-50 lines changed) first-time-contributor First PR of an external contributor needs-review labels Jul 5, 2026
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds 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.

Changes

Instagram Platform Support

Layer / File(s) Summary
Core widget Instagram support
src/social-share-button.js
Adds instagram to default platforms, defines its icon/color/label in getPlatformsHTML, adds its URL in getShareURL, and routes its share() flow through the copy-link-then-open-URL branch shared with Discord.
Framework wrapper default platforms
src/social-share-button-preact.jsx, src/social-share-button-react.jsx, src/social-share-button-qwik.tsx
Updates default platforms arrays to include instagram (and pinterest for Preact/Qwik).
README Instagram documentation
README.md
Adds Instagram to the Features list, Available Platforms list, and share message customization section.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • AOSSIE-Org/SocialShareButton#1: Builds directly on the initial SocialShareButton implementation that this PR's social-share-button.js changes extend.
  • AOSSIE-Org/SocialShareButton#97: Modifies the same core code paths (default platforms, getPlatformsHTML, getShareURL) for a different platform (pinterest vs instagram).
  • AOSSIE-Org/SocialShareButton#149: Extends the same infrastructure to add Discord's special-case share() handling, mirroring this PR's Instagram handling.

Suggested labels: Typescript Lang, Documentation

Suggested reviewers: kpj2006

Poem

A rabbit hops with camera in paw,
Instagram joins the sharing draw!
Copy the link, open the door,
One more platform than before.
🐇📸 Hop, share, and explore!

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The Preact and Qwik wrappers also add Pinterest to their default platform lists, which is unrelated to the Instagram-only scope. Remove the Pinterest additions unless they are part of a separate, intended change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: adding Instagram sharing support.
Linked Issues check ✅ Passed The core library, wrappers, and README all add Instagram support, icon/styling, and the clipboard-plus-open fallback required by #159.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

Update 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 instagram. Since this file's path instructions require inline comments for modified logic to aid understanding of non-obvious branching, the comment should mention both platforms.

📝 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

📥 Commits

Reviewing files that changed from the base of the PR and between b9f9d01 and 1b8cd1f.

📒 Files selected for processing (5)
  • README.md
  • src/social-share-button-preact.jsx
  • src/social-share-button-qwik.tsx
  • src/social-share-button-react.jsx
  • src/social-share-button.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Changes to documentation files enhancement New feature or request first-time-contributor First PR of an external contributor frontend Changes to frontend code javascript JavaScript/TypeScript code changes needs-review planned Planned feature - not final, may be dropped based on repo direction size/S Small PR (11-50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Instagram as a supported platform in the SocialShareButton library.

1 participant