fix: remove hardcoded promotional text from share messages#114
fix: remove hardcoded promotional text from share messages#114AnshuPriya-1 wants to merge 6 commits intoAOSSIE-Org:mainfrom
Conversation
WalkthroughThis change simplifies the share message generation in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can enable review details to help with troubleshooting, context usage and more.Enable the |
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)
192-227: 🧹 Nitpick | 🔵 TrivialAdd regression tests for
getShareURLmessage composition.Please add targeted tests for WhatsApp, Telegram, and Email URL generation (with/without
descriptionandhashtags) so this behavior doesn’t regress.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/social-share-button.js` around lines 192 - 227, Add regression tests for the getShareURL method to verify message composition for WhatsApp, Telegram, and Email when options include/omit description and hashtags: instantiate the component (or call getShareURL) with explicit options (url, title, description, hashtags, via) and assert the generated URLs (urls.whatsapp, urls.telegram, urls.email) contain the correctly URL-encoded message parts and ordering — e.g., WhatsApp should include encoded title + optional description + optional hashtags followed by the encoded url in the text param, Telegram should include the encoded text param with title/description/hashtags, and Email should include subject=encodedTitle and body containing encoded title/description then encoded url; include separate test cases for (1) no description/no hashtags, (2) description only, (3) hashtags only, and (4) description + hashtags to prevent regressions in getShareURL message composition.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/social-share-button.js`:
- Around line 192-227: Add regression tests for the getShareURL method to verify
message composition for WhatsApp, Telegram, and Email when options include/omit
description and hashtags: instantiate the component (or call getShareURL) with
explicit options (url, title, description, hashtags, via) and assert the
generated URLs (urls.whatsapp, urls.telegram, urls.email) contain the correctly
URL-encoded message parts and ordering — e.g., WhatsApp should include encoded
title + optional description + optional hashtags followed by the encoded url in
the text param, Telegram should include the encoded text param with
title/description/hashtags, and Email should include subject=encodedTitle and
body containing encoded title/description then encoded url; include separate
test cases for (1) no description/no hashtags, (2) description only, (3)
hashtags only, and (4) description + hashtags to prevent regressions in
getShareURL message composition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 24043fcd-7b31-4992-ba94-2ebc50dc8d69
📒 Files selected for processing (1)
src/social-share-button.js
|
Hello 👋 This PR has had no activity for more than 2 weeks. If you are still working on it, please push an update or leave a comment. Ping a maintainer if you believe it is ready for review or merge! This PR will be automatically closed in 7 days if there is no further activity. |
Addressed Issues:
Fixes #100
Screenshots/Recordings:
Not applicable. This change updates share message generation logic in
getShareURL(platform)and does not introduce a UI change.Additional Notes:
This PR is focused only on issue #100.
It removes hardcoded promotional text that was being appended to generated share messages for some platforms. After this change, the generated share content is based only on the documented user-provided options such as
title,description,hashtags,via, andurl.Checklist
Summary by CodeRabbit