Skip to content

Conversation

@adalpari
Copy link
Contributor

Description

This PR adds support for the "reader" deeplinks

Testing instructions

  • Open the following deeplinks and verify they are opened in the app

https://wordpress.com/read/feeds/138734090/posts/5879194632

https://wordpress.com/reader/feeds/138734090/posts/5879194632

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 26, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: wordpressVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/base_manifest.txt	2025-11-26 14:32:11.601652526 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressVanillaRelease/head_manifest.txt	2025-11-26 14:32:13.641648442 +0000
@@ -682,6 +682,16 @@
                     android:pathPattern="/19../../../.*"
                     android:scheme="http" >
                 </data>
+                <data
+                    android:host="wordpress.com"
+                    android:pathPattern="/reader/feeds/.*/posts/.*"
+                    android:scheme="https" >
+                </data>
+                <data
+                    android:host="wordpress.com"
+                    android:pathPattern="/reader/feeds/.*/posts/.*"
+                    android:scheme="http" >
+                </data>
 
                 <action android:name="org.wordpress.android.action.VIEW_POST" />
                 <action android:name="android.intent.action.VIEW" />

Go to https://buildkite.com/automattic/wordpress-android/builds/23994/canvas?sid=019ac090-2ae0-484a-9261-4b747d249d9f, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 26, 2025

Project manifest changes for WordPress

The following changes in the WordPress's merged AndroidManifest.xml file were detected (build variant: jetpackVanillaRelease):

--- ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/base_manifest.txt	2025-11-26 14:33:25.181295999 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackVanillaRelease/head_manifest.txt	2025-11-26 14:33:28.661306592 +0000
@@ -709,6 +709,16 @@
                     android:pathPattern="/19../../../.*"
                     android:scheme="http" >
                 </data>
+                <data
+                    android:host="wordpress.com"
+                    android:pathPattern="/reader/feeds/.*/posts/.*"
+                    android:scheme="https" >
+                </data>
+                <data
+                    android:host="wordpress.com"
+                    android:pathPattern="/reader/feeds/.*/posts/.*"
+                    android:scheme="http" >
+                </data>
 
                 <action android:name="org.wordpress.android.action.VIEW_POST" />
                 <action android:name="android.intent.action.VIEW" />

Go to https://buildkite.com/automattic/wordpress-android/builds/23994/canvas?sid=019ac090-2ae1-4a55-aa9f-bb3d6b68054a, click on the Artifacts tab and audit the files.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 26, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
FlavorJalapeno
Build TypeDebug
Versionpr22369-0d96c5b
Commit0d96c5b
Direct Downloadwordpress-prototype-build-pr22369-0d96c5b.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Nov 26, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
FlavorJalapeno
Build TypeDebug
Versionpr22369-0d96c5b
Commit0d96c5b
Direct Downloadjetpack-prototype-build-pr22369-0d96c5b.apk
Note: Google Login is not supported on these builds.

@sonarqubecloud
Copy link

Comment on lines +4921 to +4942
<issue
id="IntentFilterUniqueDataAttributes"
message="Consider splitting data tag into multiple tags with individual attributes to avoid confusion"
errorLine1=" &lt;data"
errorLine2=" ^">
<location
file="src/main/AndroidManifest.xml"
line="660"
column="17"/>
</issue>

<issue
id="IntentFilterUniqueDataAttributes"
message="Consider splitting data tag into multiple tags with individual attributes to avoid confusion"
errorLine1=" &lt;data"
errorLine2=" ^">
<location
file="src/main/AndroidManifest.xml"
line="666"
column="17"/>
</issue>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new deeplink addition is adding a couple of lint issues. I explored some solutions, but ended up realising that they could potentially add non-expected cases.
I followed the already in-place deeplink matching, and it's actually adding the lint check suppression. So, the most realistic solution was simply following on what we are already doing.

In fact, according to Claude:

Option 1: Update the baseline (quickest fix, consistent with existing code)
./gradlew updateLintBaseline

Option 2: Split the data tags (proper fix following Android lint recommendations)

The data tags should be split like this:
<data android:scheme="https" />
<data android:host="wordpress.com" />
<data android:pathPattern="/reader/feeds/./posts/." />

However, this changes behavior because intent filter matching combines ALL data tags in an OR fashion for each attribute type. This could cause unintended matches.

Given that the existing codebase has 700+ similar issues already baselined, the most consistent approach is to update the baseline

So, I went with solution 1

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Thank you for the explanation.

@adalpari adalpari requested a review from dcalhoun November 26, 2025 14:50
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.03%. Comparing base (c6a2293) to head (0d96c5b).
⚠️ Report is 1 commits behind head on trunk.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22369   +/-   ##
=======================================
  Coverage   39.02%   39.03%           
=======================================
  Files        2203     2203           
  Lines      106327   106328    +1     
  Branches    15059    15059           
=======================================
+ Hits        41499    41500    +1     
  Misses      61338    61338           
  Partials     3490     3490           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@dcalhoun dcalhoun left a comment

Choose a reason for hiding this comment

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

This looks good. The test plan succeeded for me.

I will note, I tested a slight variation where I arrived at the Calypso app promotion banner. I noted that tapping the Open in the Jetpack app loads Reader, but not the individual post detail view. This a bit unexpected from my perspective. It'd be ideal if we could open the current post viewed in the browser.

The relevant web code is found in wp-calypso. If I'm not mistaken, we do not appear to pass along any details regarding the post. If we did, could the Android app consume these details and open the post? What details would be needed? What properties should be set?

Screen_Recording_20251126_101239_Chrome.mp4

Comment on lines +4921 to +4942
<issue
id="IntentFilterUniqueDataAttributes"
message="Consider splitting data tag into multiple tags with individual attributes to avoid confusion"
errorLine1=" &lt;data"
errorLine2=" ^">
<location
file="src/main/AndroidManifest.xml"
line="660"
column="17"/>
</issue>

<issue
id="IntentFilterUniqueDataAttributes"
message="Consider splitting data tag into multiple tags with individual attributes to avoid confusion"
errorLine1=" &lt;data"
errorLine2=" ^">
<location
file="src/main/AndroidManifest.xml"
line="666"
column="17"/>
</issue>

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense. Thank you for the explanation.

@adalpari
Copy link
Contributor Author

I will note, I tested a slight variation where I arrived at the Calypso app promotion banner. I noted that tapping the Open in the Jetpack app loads Reader, but not the individual post detail view. This a bit unexpected from my perspective. It'd be ideal if we could open the current post viewed in the browser.

Good catch! Let me check it.

@adalpari adalpari merged commit 889668d into trunk Nov 26, 2025
23 checks passed
@adalpari adalpari deleted the fix/CMM-999-Support-new-reader-deeplinks branch November 26, 2025 15:36
@adalpari
Copy link
Contributor Author

The relevant web code is found in wp-calypso. If I'm not mistaken, we do not appear to pass along any details regarding the post. If we did, could the Android app consume these details and open the post? What details would be needed? What properties should be set?

After some investigation, you are right, we are not passing any post details.
Example URL:

intent://details?id=com.jetpack.android&url=jetpack://read&referrer=utm_source%3Dcalypso%26utm_campaign%3Dcalypso-mobile-banner#Intent;scheme=market;action=android.intent.action.VIEW;package=com.android.vending;end

Notice the

url=jetpack://read

Basically, we would need to add post info like in the original URL, assuming it0s the blog and post ids

https://wordpress.com/read/feeds/138734090/posts/5879194632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants