Skip to content

Add integration overview and usage instructions to README#63

Merged
kpj2006 merged 2 commits intoAOSSIE-Org:mainfrom
kpj2006:analytics
Mar 7, 2026
Merged

Add integration overview and usage instructions to README#63
kpj2006 merged 2 commits intoAOSSIE-Org:mainfrom
kpj2006:analytics

Conversation

@kpj2006
Copy link
Contributor

@kpj2006 kpj2006 commented Mar 7, 2026

Addressed Issues:

Fixes #(TODO:issue number)

Screenshots/Recordings:

Additional Notes:

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • 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 Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.

AI Usage Disclosure

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Summary by CodeRabbit

  • Documentation
    • Added a unified 3-step Integration Overview for all frameworks.
    • Expanded framework-specific setup guidance (React, Next.js App/Pages, Vue/Vite, Angular) with lifecycle and placement recommendations.
    • Clarified how to add a persistent, globally-available share button in app layouts.
    • Described dynamic URL/title synchronization so the share options update on navigation.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 99316391-f8a0-4b99-a526-7e06f977f623

📥 Commits

Reviewing files that changed from the base of the PR and between 06defd1 and 31c7b18.

📒 Files selected for processing (1)
  • README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

📝 Walkthrough

Walkthrough

Expanded README integration guidance with a unified 3-step flow (Load Library, Add Container, Initialize) and framework-specific setup and lifecycle examples for React, Next.js (App/Pages), Vue/Vite, and Angular, including dynamic URL/title sync and container mount/unmount patterns.

Changes

Cohort / File(s) Summary
Documentation
README.md
Added an Integration Overview with a uniform 3-step flow; replaced generic Step 2 with framework-aware instructions and concrete code snippets for React, Next.js (App Router & Pages Router), Vue/Vite, and Angular; added lifecycle notes, client-component directives, mounting/cleanup patterns, and dynamic URL/title synchronization examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

I’m a rabbit in the README glade,
Tucking buttons in each framework’s shade,
Three steps to load, attach, and start,
I plant a container, play my part 🐇✨
Now pages share with all their heart.

🚥 Pre-merge checks | ✅ 3
✅ 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 'Add integration overview and usage instructions to README' accurately summarizes the main change—documentation additions to the README with integration guidance and setup instructions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
README.md (1)

223-225: Pass containerRef.current in the Next.js examples.

These snippets already wait for containerRef.current, so using "#share-button" here is needlessly global. Passing the ref directly is safer and avoids selector collisions if multiple instances ever render.

Suggested doc tweak
       shareButtonRef.current = new window.SocialShareButton({
-        container: "#share-button",
+        container: containerRef.current,
       });

Also applies to: 318-320

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 223 - 225, The snippet instantiates new
window.SocialShareButton with a string selector ("#share-button") which is
brittle; change it to pass the actual DOM ref instead by using
containerRef.current when creating the instance (i.e., update the code that
assigns shareButtonRef.current = new window.SocialShareButton({ container: ...
}) to supply containerRef.current), and make the identical change for the other
Next.js example (the occurrence around the second snippet) so the component uses
the stable ref rather than a global selector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@README.md`:
- Around line 132-133: The persistent-layout example misses handling SPA route
updates: the SocialShareButton constructor in src/social-share-button.js
captures url/title from window.location.href and document.title at init, so when
placed in a shared Header.jsx / MainLayout.jsx / App.jsx the share target
remains the first page; update the example to call the
SocialShareButton.updateOptions(...) (or equivalent instance method) on
client-side route changes (e.g., Next.js router.events or your SPA router's
change callback), passing the current window.location.href and document.title so
the button reflects the latest route and title.
- Around line 104-108: The README's Angular guidance currently suggests
initializing SocialShareButton in ngOnInit which can run before the view is
rendered; change the guidance to instruct developers to initialize the
SocialShareButton (new SocialShareButton({ container: "#share-button" })) in
ngAfterViewInit so the DOM container (`#share-button`) is guaranteed to exist, and
update the note wherever ngOnInit is mentioned (including the other referenced
lines) to recommend ngAfterViewInit instead.

---

Nitpick comments:
In `@README.md`:
- Around line 223-225: The snippet instantiates new window.SocialShareButton
with a string selector ("#share-button") which is brittle; change it to pass the
actual DOM ref instead by using containerRef.current when creating the instance
(i.e., update the code that assigns shareButtonRef.current = new
window.SocialShareButton({ container: ... }) to supply containerRef.current),
and make the identical change for the other Next.js example (the occurrence
around the second snippet) so the component uses the stable ref rather than a
global selector.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e06d2a07-b7e2-4b8b-af34-4455a4f8838e

📥 Commits

Reviewing files that changed from the base of the PR and between 1aa4f7d and 06defd1.

📒 Files selected for processing (1)
  • README.md

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.

1 participant