Skip to content

Open rs post and page "View" in a Custom Tab - #23366

Merged
nbradbury merged 2 commits into
trunkfrom
feature/rs-custom-tabs
Sep 25, 2026
Merged

nbradbury merged 2 commits into
trunkfrom
feature/rs-custom-tabs

Conversation

@nbradbury

@nbradbury nbradbury commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Currently the View action on the post and pages lists open the external browser. This PR changes this so they open in Chrome Custom Tabs.

Description

Description

  • PostRsListActivity and PagesRsListActivity swap ActivityLauncher.openUrlExternal for the existing ActivityNavigator.openInCustomTab, which New Stats already uses. It falls back to the external browser if no Custom Tabs provider is available.
  • This covers both the View footer button and the overflow-menu entry, which emit the same event.
  • The legacy lists are unchanged because they already open posts and pages inside the app.

Testing instructions

Posts list:

  1. Open Posts with the RS lists enabled
  2. Tap View on a published post's footer button
  • The post opens in a Custom Tab, and Back returns to the list
  1. Repeat from the overflow menu → View
  • Same result

Pages list:

  1. Open Pages and repeat the steps above on a published page
  • The page opens in a Custom Tab, and Back returns to the list

Keeps the user in the app instead of handing off to the external browser, matching how New Stats opens URLs.
@dangermattic

dangermattic commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr23366-6c1266f
Build Number1498
Application IDorg.wordpress.android.prealpha
Commit6c1266f
Installation URL0jlid924c17g0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr23366-6c1266f
Build Number1498
Application IDcom.jetpack.android.prealpha
Commit6c1266f
Installation URL4vjki1suiu5lg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@nbradbury
nbradbury marked this pull request as ready for review September 25, 2026 12:12
@nbradbury
nbradbury requested a review from adalpari September 25, 2026 12:50
@adalpari

adalpari commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Changes look straightforward, but I don't think Post view action is opening a Custom Tab like Page view action is.
I asked Claude, and it looks like we could be intercepting the intent and opening the Reader view instead of a Custom Tab. Is that expected?

Without a package, the Custom Tab intent resolves to our own WPComPostReaderActivity alias for WP.com date-based post URLs, so "View" opened the Reader instead of the tab.
@nbradbury

Copy link
Copy Markdown
Contributor Author

it looks like we could be intercepting the intent and opening the Reader view instead of a Custom Tab. Is that expected?

That is not expected, and I can't reproduce it. I applied a potential fix in 6c1266f - can you pull that and see if it fixes the problem?

@codecov

codecov Bot commented Sep 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 38.22%. Comparing base (2987bf0) to head (6c1266f).

Files with missing lines Patch % Lines
...java/org/wordpress/android/ui/ActivityNavigator.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #23366      +/-   ##
==========================================
- Coverage   38.22%   38.22%   -0.01%     
==========================================
  Files        2302     2302              
  Lines      127844   127845       +1     
  Branches    18048    18049       +1     
==========================================
  Hits        48873    48873              
- Misses      74922    74923       +1     
  Partials     4049     4049              

☔ View full report in Codecov by Harness.
📢 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.

@adalpari adalpari left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems like your changes did the trick!
:shipit:

@adalpari

Copy link
Copy Markdown
Contributor

it looks like we could be intercepting the intent and opening the Reader view instead of a Custom Tab. Is that expected?

That is not expected, and I can't reproduce it. I applied a potential fix in 6c1266f - can you pull that and see if it fixes the problem?

Btw, I asked Claude again, and it seems it was only reproducible with ***.worpdress.com sites.

@nbradbury
nbradbury merged commit 9ad2e38 into trunk Sep 25, 2026
23 checks passed
@nbradbury
nbradbury deleted the feature/rs-custom-tabs branch September 25, 2026 15:49
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.

4 participants