Skip to content

Conversation

@AarushSharma0409
Copy link

@AarushSharma0409 AarushSharma0409 commented Dec 22, 2025

I added twitter support.
ISSUE: with demo that if a user accidently clicks cancel when it asks for the permission to open the app it directly opens the web link.
SUGGESTION: it should ask another question that the user wans to open in browser or don't want to open the app.

ISSUE: if the user cancels it once then the it always opens the web link not the app for the specific handler the user cancelled this nullifies the whole point of this app for the user if he/she clicks cancel by mistake

Summary by CodeRabbit

  • New Features

    • Added Twitter platform support with deep-linking.
    • Demo UI: added a Twitter example, updated input placeholder to include Twitter, and adjusted button/layout presentation.
  • Style

    • Updated hover styling for Twitter links.
  • Chores

    • Updated ESLint to v8.57.0.

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

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

Walkthrough

Adds Twitter/X platform support: demo UI updated with Twitter references and placeholder, CSS hover style for Twitter added, new TypeScript twitterHandler implemented and exported, and Platform type extended to include 'twitter'. package.json eslint version changed.

Changes

Cohort / File(s) Summary
Demo UI
apps/demo/index.html
HTML formatting adjusted; added Twitter example link, updated example anchors and input placeholder to include Twitter; cosmetic reflow and spacing edits only.
Styling
apps/demo/src/style.css
Added .twitter-link:hover rule to set border-color: #1da1f2``; existing hover rules unchanged.
Tooling
package.json
Updated eslint version to ^8.57.0 (from ^9.39.2).
Platform handler
packages/core/src/platforms/twitter.ts, packages/core/src/platforms/index.ts
New twitterHandler DeepLinkHandler implemented (supports twitter.com and x.com, extracts username, builds iOS twitter:// and Android intent URLs) and exported from platforms index.
Types
packages/core/src/types.ts
Extended Platform union to include 'twitter'.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review packages/core/src/platforms/twitter.ts for regex correctness (username capture, 1–15 char constraint) and URL encoding of captured username.
  • Verify iOS (twitter://user?screen_name=...) and Android intent URL syntax matches expected platform requirements.
  • Check packages/core/src/platforms/index.ts exports and any downstream usage of the updated Platform type for type errors.
  • Confirm apps/demo/index.html anchor changes use safe hrefs (# or proper targets) and that the new CSS class name matches markup.

Poem

🐰 I hopped in with a chirp and a twirl,
A Twitter link for every squirrel—
iOS, Android, a username found,
Deep links sprout up from the ground! 🥕🐦

Pre-merge checks and finishing touches

✅ 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 'feat: add twitter support' is a single sentence that directly and clearly summarizes the main change in the pull request. It matches the primary objective of adding Twitter support across multiple files (types, platforms handler, demo UI, and styles).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f05505 and 2c0ea9b.

📒 Files selected for processing (2)
  • package.json
  • packages/core/src/platforms/twitter.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • package.json
  • packages/core/src/platforms/twitter.ts

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: 2

🧹 Nitpick comments (2)
apps/demo/index.html (2)

83-83: Update placeholder to include Instagram.

The placeholder mentions "YouTube/LinkedIn/Twitter" but omits Instagram, which is also supported (line 57-63).

🔎 Proposed fix
-          placeholder="Paste a URL here (YouTube/LinkedIn/Twitter)"
+          placeholder="Paste a URL here (YouTube/LinkedIn/Instagram/Twitter)"

1-112: The PR description mentions unresolved permission/cancel behavior issues.

The PR description reports two issues that are not addressed in this code:

  1. When a user clicks "cancel" on the permission prompt, the flow immediately opens the web link
  2. After one cancel, subsequent attempts always open the web link instead of prompting for the app

These issues relate to the app-opening logic (likely in main.ts, which is not included in this PR) rather than just adding Twitter support.

Would you like me to help investigate the permission handling logic? I can generate a script to examine the main.ts file and related code to understand the current implementation.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9d51def and 5f05505.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • apps/demo/index.html
  • apps/demo/src/style.css
  • package.json
  • packages/core/src/platforms/index.ts
  • packages/core/src/platforms/twitter.ts
  • packages/core/src/types.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/core/src/platforms/twitter.ts (2)
packages/core/src/platforms/index.ts (1)
  • twitterHandler (12-12)
packages/core/src/types.ts (1)
  • DeepLinkHandler (10-13)
🔇 Additional comments (6)
packages/core/src/types.ts (1)

1-1: LGTM!

The Platform type correctly includes 'twitter' and maintains consistency with the new twitterHandler implementation.

apps/demo/src/style.css (1)

111-113: LGTM!

The Twitter link hover styling is consistent with existing platform link styles and uses Twitter's official brand color.

packages/core/src/platforms/index.ts (1)

5-5: LGTM!

The twitterHandler import and export are correctly integrated with the existing platform handlers.

Also applies to: 11-12

apps/demo/index.html (1)

64-71: LGTM!

The Twitter example link is correctly implemented with appropriate styling classes and data attributes, consistent with other platform examples.

packages/core/src/platforms/twitter.ts (1)

11-12: The iOS scheme twitter://user?screen_name= and Android package com.twitter.android remain valid and unchanged after Twitter's rebrand to X. The Android app's package name remains com.twitter.android, and the iOS deep linking scheme continues to support twitter://user?screen_name= format. No updates are required for these identifiers.

package.json (1)

15-15: No action needed - ESLint version is correctly pinned. ESLint 8.57.0 is fully supported by @typescript-eslint/eslint-plugin 8.50.0 (supports ^8.57.0 || ^9.0.0). This is an intentional choice, not a workaround for compatibility issues.

@AarushSharma0409
Copy link
Author

i have solved the problems you have stated with the changes i have made can you please review

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