-
Notifications
You must be signed in to change notification settings - Fork 65
feat: add Substack deep link handler #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Substack deep link handler #72
Conversation
Closes mdsaban#63 - Add substack.ts handler supporting publication URLs - Support for *.substack.com, posts (/p/slug), about, archive pages - iOS deep link: substack://<publication><path> - Android intent with scheme substack and package com.substack.app
📝 WalkthroughWalkthroughAdds a Substack deep-link handler, registers it with existing platform handlers, and updates the Platform type to include 'substack'. The handler matches Substack URLs and returns HTTPS-based deep-link payloads for iOS and Android (Universal/App Links). Changes
Sequence Diagram(s)(Skipped — changes add a single handler and do not introduce multi-component control flow requiring a sequence diagram.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom Pre-merge Checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/core/src/index.tspackages/core/src/platforms/index.tspackages/core/src/platforms/substack.tspackages/core/src/types.ts
🧰 Additional context used
🧬 Code graph analysis (2)
packages/core/src/platforms/substack.ts (2)
packages/core/src/platforms/index.ts (1)
substackHandler(23-23)packages/core/src/types.ts (1)
DeepLinkHandler(28-45)
packages/core/src/index.ts (2)
packages/core/src/platforms/index.ts (1)
substackHandler(23-23)packages/core/src/platforms/substack.ts (1)
substackHandler(20-41)
🔇 Additional comments (6)
packages/core/src/types.ts (1)
13-13: LGTM! Platform type correctly extended.The 'substack' literal is properly added to the Platform union type and maintains alphabetical ordering.
packages/core/src/platforms/index.ts (1)
8-8: LGTM! Handler correctly imported and exported.The substackHandler is properly imported and exported, maintaining alphabetical ordering consistent with other platform handlers.
Also applies to: 23-23
packages/core/src/index.ts (1)
8-8: LGTM! Handler properly integrated into dispatch flow.The substackHandler is correctly imported and added to the handlers array, enabling Substack URL detection in the generateDeepLink function.
Also applies to: 26-26
packages/core/src/platforms/substack.ts (3)
37-37: Android package name and intent format are correct.The package name
com.substack.appis the official Substack Android app package from Google Play, and the intent URI format follows the standard Android deep linking syntax.
21-24: The current regex implementation is correct and matches the documented requirements for issue #63. The commit message explicitly states support for "*.substack.com, posts (/p/slug), about, archive pages" — the@usernamepattern was not part of the stated requirements. The documentation in lines 6-10 confirms only subdomain-based URLs are supported as intended.If support for the
substack.com/@usernamepattern is desired, that should be addressed as a separate feature request rather than a missing requirement from this PR.Likely an incorrect or invalid review comment.
23-23: The subdomain pattern[a-z0-9-]+is correct and aligns with Substack's actual subdomain naming requirements, which follow standard DNS rules (RFC 1035). Substack subdomains may only contain lowercase letters, digits, and hyphens—underscores are not permitted in DNS subdomains.Likely an incorrect or invalid review comment.
Substack does not have a custom URL scheme. The app uses Universal Links (iOS) and App Links (Android) to intercept HTTPS URLs directly. Updated per CodeRabbit review feedback.
|
Have you tested this on mobile device, is it working? |
|
Please resolve conflicts too |
|
Hi @mdsaban! I've resolved the merge conflicts. Regarding mobile testing: Yes, I tested Substack URLs on both iOS and Android. Since Substack uses Universal Links (not a custom URL scheme), the app intercepts HTTPS URLs directly when installed. The implementation returns the HTTPS URL for both platforms, which the OS handles automatically. Thanks! I've resolved all the merge conflicts. Ready for re-review! Let me know if you need anything else! |
|
Thanks for this @abhijithwinddaa |
Closes #63
Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.