Skip to content

Conversation

@abhijithwinddaa
Copy link
Contributor

@abhijithwinddaa abhijithwinddaa commented Jan 2, 2026

Closes #63

  • Add substack.ts handler supporting publication URLs
  • Support for *.substack.com, posts (/p/slug), about, archive pages
  • iOS deep link: substack://
  • Android intent with scheme substack and package com.substack.app

Summary by CodeRabbit

  • New Features

    • Added Substack support to deep-link generation: create deep links for Substack publications, posts, archives, and about pages.
    • Deep links work on both iOS and Android using HTTPS/app links for direct navigation to Substack content.
  • Style

    • Minor formatting cleanup in existing platform handlers.

✏️ Tip: You can customize this high-level summary in your review settings.

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
@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2026

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
Core registration
packages/core/src/index.ts, packages/core/src/platforms/index.ts
Import and register substackHandler so it is exported and included in the central handlers list.
Substack handler
packages/core/src/platforms/substack.ts
New substackHandler: DeepLinkHandler that matches *.substack.com URLs and builds a DeepLink with webUrl, ios, android, platform: 'substack' (returns HTTPS Universal/App Links).
Types
packages/core/src/types.ts
Extend the Platform union type to include 'substack'.
Minor formatting
packages/core/src/platforms/telegram.ts
Regex formatting condensed to a single line (no behavioral change).

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

  • mdsaban

Poem

🐰 I sniffed a Substack path today,
Hopped through links in sleek array,
HTTPS for every hop,
Universal maps to stop—
A tiny handler, boundless play ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Substack deep link handler' directly and concisely describes the primary change in the changeset, matching the main implementation of adding Substack support.
Linked Issues check ✅ Passed The PR implements pattern-based URL detection for *.substack.com domains, builds deep links with webUrl/ios/android payloads, and returns HTTPS URLs for fallback, meeting issue #63 requirements for Substack support without breaking existing handlers.
Out of Scope Changes check ✅ Passed Minor formatting changes to telegram.ts (regex condensing) and trailing comma in handlers list are incidental, but all code changes directly support the Substack deep link handler objective with no unrelated additions.

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

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d15e5e5 and bca0f1e.

📒 Files selected for processing (4)
  • packages/core/src/index.ts
  • packages/core/src/platforms/index.ts
  • packages/core/src/platforms/telegram.ts
  • packages/core/src/types.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/core/src/platforms/telegram.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/core/src/index.ts
  • packages/core/src/platforms/index.ts
  • packages/core/src/types.ts

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

@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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 976d02e and 45f0492.

📒 Files selected for processing (4)
  • packages/core/src/index.ts
  • packages/core/src/platforms/index.ts
  • packages/core/src/platforms/substack.ts
  • packages/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.app is 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 @username pattern 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/@username pattern 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.
@mdsaban
Copy link
Owner

mdsaban commented Jan 7, 2026

Have you tested this on mobile device, is it working?

@mdsaban
Copy link
Owner

mdsaban commented Jan 7, 2026

Please resolve conflicts too

@abhijithwinddaa
Copy link
Contributor Author

abhijithwinddaa commented Jan 7, 2026

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!

@mdsaban
Copy link
Owner

mdsaban commented Jan 7, 2026

Thanks for this @abhijithwinddaa

@mdsaban mdsaban merged commit 4fc5570 into mdsaban:main Jan 7, 2026
2 checks passed
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.

Proposal: Add support for Substack URLs via dedicated handler

2 participants