Skip to content

Reader: WPFolio experiment (gallery feeds, native post detail, comments sheet) - #23580

Draft
nbradbury wants to merge 27 commits into
trunkfrom
nbradbury/reader-app-integration
Draft

nbradbury wants to merge 27 commits into
trunkfrom
nbradbury/reader-app-integration

Conversation

@nbradbury

@nbradbury nbradbury commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Experiment — not for merging.

TL;DR

Ports the standalone WPFolio reader's look into the WP/JP Reader: a gallery layout for feeds, a natively rendered post detail, and WPFolio-style comments in a bottom sheet.

Description
  • Gallery layout (default): staggered image grid with a hero tile and accent-coloured quote cards; grid/list toggle in the Reader top bar on Subscriptions, Discover, Saved and Liked. Blog previews get WPFolio's edge-to-edge cover under the status bar.
  • Image accents and shapes: featured images are sampled once (Palette) for an accent colour and aspect ratio, kept in a small reader_image_meta.db; cards show images at their own shape.
  • Native post detail (default): WPFolio's HTML→Compose block renderer and article screen — hero under a rounded sheet, Atkinson Hyperlegible Next / Instrument Sans, galleries as grids, scrolling code and tables, footnote sheets, tap-to-play video, accent progress bar, hide-on-scroll action pill. More → "Show with the web view" switches back.
  • Comments: WPFolio's look, shown in a tall bottom sheet over the post; reply sheet (mentions, drafts) kept.
  • Smaller: readable width on tablets, dimmed seen posts, Next card, suggested sites, swipe-to-unsubscribe and recent-first sites in Manage subscriptions, "Share quote" in the WebView.
  • Fix (pre-existing): ReaderPostListActivity's top bar added the status bar inset twice.

Not ported: on-device RSS, WPFolio's Room/Retrofit data layer, OAuth, background sync. Native rendering gaps: other embeds become link cards, no table colspan, private Atomic images may not load.

Testing instructions

Gallery:

  1. Open Reader → Subscriptions, then Discover, Saved and Liked
  • Posts show as a gallery; the grid icon switches to the list and back
  1. Tap a post's site name to open its preview
  • Cover is edge to edge under the status bar, with back and share over it, and doesn't jump as it loads

Post detail:

  1. Open posts with galleries, code, tables, footnotes and video
  • Rendered natively; swiping between posts and the Next card work
  1. More → "Show with the web view", then More → "Show natively"
  • Switches between the WebView and native rendering

Comments:

  1. Tap comments in the post's pill
  • Comments open in a tall sheet over the post; reply, like and back work

Ported from WPFolio: rows are centred and capped at 680dp, per item so the whole width still scrolls. Applies to the post list, comments, Manage subscriptions and site search.
The card's title uses medium emphasis once the post is seen, where seen state is supported. Toggling seen from the more menu re-renders the card.
Ported from WPFolio. The end of a post offers the next post in the pager, which pages to it as a swipe would; it's hidden for single posts, related posts, the last page and notification opens. A thin bar under the status bar fills as the post is read.
…in Manage subscriptions

Ported from WPFolio:
- Sites WordPress.com recommends (read/recommendations/sites) show above the subscribed sites, and can be previewed or followed from there.
- Swiping a site away unsubscribes it once the Undo snackbar goes; the unfollow runs in the app scope so leaving the screen doesn't lose it. There's a TalkBack action for it too.
- Sites are sorted by their latest post saved on the device, then by name.
Ported from WPFolio's AccentSampler. Each featured image is sampled once, in the background, for a dark accent color (Palette) and its aspect ratio, kept in a small reader_image_meta.db of its own so the Reader database needs no migration. Failures are retried after six hours.

Cards show the image at its own shape between 4:5 and 16:9, from an uncropped Photon URL, with the accent behind it while it loads. A card only uses a shape known when it first showed, so it never changes height on screen. Adds androidx.palette.
Ported from WPFolio's magazine feed. A grid/list toggle in the Reader's top bar, shown on Subscriptions and saved in preferences, switches the feed to a staggered grid: the first post with an image as a large hero, the rest as tiles at their images' own shapes, and posts without an image as cards in their accent color. Site previews get a cover of their three latest images. A long press opens a post's more menu. It shows the same rows from the same view model state as the list.
Ported from WPFolio. Selecting text in a post adds "Share quote" to the WebView's selection menu, which shares the selection in quotes followed by the post's link.
The grid/list toggle now shows on Discover, Saved and Liked as well as Subscriptions. Discover's feeds and Liked already use the post list that supports the gallery; the synced Saved list now switches to it too, showing its cards as the same tiles. P2s, Automattic and lists stay as lists.
The gallery shows unless the reader has chosen the list with the top bar's toggle.
- ReaderFragment alone decides which feeds offer the gallery, and passes it to the post list.
- The gallery reuses the list's scroll and empty-state helpers, Saved's own empty state and keys, a shared seen-title color and a staggered-grid loading item; post-list-only actions default to no-ops.
- Image meta: a stable flow, one timestamp, one drain job with an in-flight set, 96px samples kept out of Coil's caches, sample URLs built only when needed, half-width tile URLs, and a fixed crop background so a late accent doesn't redecode.
- Next card: the shared featured image URL and a no-argument showNextPost().
- Manage subscriptions: typed latest-post dates read once per screen, an unfollow that doesn't hold a cleared view model, and one site click action.
ReaderArticleBlocks splits a post's HTML into blocks Compose can lay out natively (paragraphs, headings, images, galleries, quotes, tables, lists, code, buttons, details, videos and embeds), with footnotes carried on their markers. Ported from WPFolio, except that audio becomes a link rather than being dropped.

Bundles Atkinson Hyperlegible Next and Instrument Sans, with their OFL licences.
Composables for each block, ported from WPFolio: text in Atkinson Hyperlegible Next with Instrument Sans for headings and captions, images sized through Photon with space reserved up front, galleries as grids, pullquotes and quotes with accent rules, tables and code that scroll sideways, collapsible details, footnote sheets, videos that play on tap (YouTube, Vimeo, VideoPress, files) and embed cards. Colors follow WPFolio's palettes for the system reading theme and the reader's own theme otherwise, and the reading font and size apply to the body.
The post detail shows the featured image as a hero under a rounded sheet, the site and byline with read time, a large title, the body as native blocks, an Open original button and the usual footer, with WPFolio's accent progress bar, round back and More buttons, and a pill of save, like, comments and share that hides on scroll.

It's the default, behind a local preference: the More menu switches between it and the WebView. Links, images, More menu items and pull to refresh go through the fragment's existing handling; the WebView is still inflated but never loads the post.
Reader comments take WPFolio's palette and type: Instrument Sans for the interface, comment text in Atkinson Hyperlegible Next under a 32dp avatar and a one-line "Name · time", no dividers, Reply as a text link and likes as a small heart, and a rounded composer field with a send icon that still opens the reply sheet (mentions and drafts). CommentHtmlBody gains an optional text style; site comments are unchanged.
- ReaderPostListActivity's top bar no longer adds the status bar inset that BaseAppCompatActivity has already applied, which left a status-bar-sized gap above it (pre-existing).
- The gallery keeps its top in view when the site header arrives after the posts, as the list already did, so a preview no longer opens with its header scrolled mostly off screen.
…does

The cover is WPFolio's mosaic (the newest image large, the next two stacked beside it), full width and starting at the top of the screen under the status bar, with round back and share buttons over it instead of a top bar. The status bar shows the cover behind a scrim with light icons, then the screen's background once the cover scrolls away.

ReaderPostListActivity now enables edge-to-edge itself and is excluded from BaseAppCompatActivity's inset padding; its Scaffold (tag previews, list mode) insets itself.
A blog preview's posts usually load before its site header, which then landed above them and pushed them down. Until the header arrives, the gallery holds its place with a cover made from the posts and a spinner, keyed as the header so the real one replaces it in place, and the posts wait.
ReaderCommentListActivity is now translucent (WordPress.SheetActivity, no window animation) and draws its screen in a ModalBottomSheet at 92% of the height, over the post. Dragging it down, tapping above it or back hides the sheet and finishes; back steps out of a single comment first. In the sheet the header has no back arrow at the list level and no status bar inset. Everything else, and every entry point, is unchanged.

ReaderArticleMaterialTheme no longer draws a full-screen background, which hid the post behind the sheet.
@nbradbury nbradbury added Reader Do Not Merge PR shouldn't be merged, failing the build labels Nov 25, 2026
@dangermattic

dangermattic commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator
8 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class ReaderImageAccentSampler is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class ReaderImageMetaStore is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class ReaderArticleRenderingPreference is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class ReaderLayoutPreference is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class ShareQuoteCallback is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class ReaderArticleImages is missing tests, but unit-tests-exemption label was set to ignore this.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Contributor

Project dependencies changes

list
! Upgraded Dependencies
androidx.palette:palette:1.1.0, (changed from 1.0.0)
androidx.palette:palette-ktx:1.1.0, (changed from 1.0.0)
tree
 \--- project :libs:fluxc
      \--- com.github.chuckerteam.chucker:library:4.2.0
-          \--- androidx.palette:palette-ktx:1.0.0
-               +--- org.jetbrains.kotlin:kotlin-stdlib:1.2.50 -> 2.4.21 (*)
-               \--- androidx.palette:palette:1.0.0
-                    +--- androidx.core:core:1.0.0 -> 1.16.0 (*)
-                    \--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
+          \--- androidx.palette:palette-ktx:1.0.0 -> 1.1.0
+               +--- androidx.palette:palette:1.1.0
+               |    +--- androidx.collection:collection:1.4.2 -> 1.6.0 (*)
+               |    +--- androidx.core:core:1.1.0 -> 1.16.0 (*)
+               |    +--- org.jetbrains.kotlin:kotlin-stdlib:2.2.20 -> 2.4.21 (*)
+               |    +--- org.jspecify:jspecify:1.0.0
+               |    \--- androidx.palette:palette-ktx:1.1.0 (c)
+               +--- org.jetbrains.kotlin:kotlin-stdlib:2.2.20 -> 2.4.21 (*)
+               \--- androidx.palette:palette:1.1.0 (c)
+\--- androidx.palette:palette-ktx:1.1.0 (*)

@wpmobilebot

wpmobilebot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Project manifest changes for WordPress

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

--- ./build/reports/diff_manifest/WordPress/wordpressRelease/base_manifest.txt	2026-11-27 14:19:36.626074849 +0000
+++ ./build/reports/diff_manifest/WordPress/wordpressRelease/head_manifest.txt	2026-11-27 14:19:54.016254152 +0000
@@ -829,7 +829,7 @@
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderCommentListActivity"
             android:label="@string/reader_title_comments"
-            android:theme="@style/WordPress.NoActionBar"
+            android:theme="@style/WordPress.SheetActivity"
             android:windowSoftInputMode="adjustResize|stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.NoSiteToReblogActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/30427/canvas?sid=01a21d5d-a75a-4d65-ab6d-4419838631d7, click on the Artifacts tab and audit the files.

@wpmobilebot

wpmobilebot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Project manifest changes for WordPress

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

--- ./build/reports/diff_manifest/WordPress/jetpackRelease/base_manifest.txt	2026-11-27 14:19:36.315099102 +0000
+++ ./build/reports/diff_manifest/WordPress/jetpackRelease/head_manifest.txt	2026-11-27 14:19:54.345798571 +0000
@@ -870,7 +870,7 @@
         <activity
             android:name="org.wordpress.android.ui.reader.ReaderCommentListActivity"
             android:label="@string/reader_title_comments"
-            android:theme="@style/WordPress.NoActionBar"
+            android:theme="@style/WordPress.SheetActivity"
             android:windowSoftInputMode="adjustResize|stateHidden" />
         <activity
             android:name="org.wordpress.android.ui.reader.NoSiteToReblogActivity"

Go to https://buildkite.com/automattic/wordpress-android/builds/30427/canvas?sid=01a21d5d-a75a-46fd-b4c8-8b5354d6e6d2, click on the Artifacts tab and audit the files.

@wpmobilebot

wpmobilebot commented Nov 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
Versionpr23580-7be120a
Build Number1498
Application IDcom.jetpack.android.prealpha
Commit7be120a
Installation URL46crr2vieirh0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Nov 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
Versionpr23580-7be120a
Build Number1498
Application IDorg.wordpress.android.prealpha
Commit7be120a
Installation URL5f48r3flpsjh0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

- Unit tests: stub the subs repository's suggested sites and latest post dates, whose NPE also leaked into the next test class.
- Detekt: fewer returns in onScrollToTop and getNextPostIds, suppressions for the ported parser and two borderline classes, and file names matching their declarations.
- Lint: no empty super.onCleared(), KTX edit/transaction/toUri, a modifier parameter named modifier, and the locale read from LocalConfiguration.
- Comments: the screen is sheet-only (no isSheet flag, unreachable hideSheet or onBack), WordPress.SheetActivity inherits NoDisplay, and CommentHtmlBody uses one Text.
- Native detail: actions wrap the detail's own, refresh and photo viewer are shared with the web view path, pill counts use the cards' locale-aware CompactDecimalFormat, the progress bar reads in the draw phase, converted HTML and VideoPress posters are cached, and dead parser code is gone.
- Shared: one ReaderOverlayButton, one fallbackAccent(blogId, postId), toComposeFontFamily, LoadingState and ContentListPullToRefreshBox.
The WPFolio-style comments show Reply as a text link, so nothing references ic_reply_material_white_24dp any more (UnusedResources).
@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 14.67181% with 221 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.71%. Comparing base (166605d) to head (7be120a).

Files with missing lines Patch % Lines
...droid/ui/reader/accent/ReaderImageAccentSampler.kt 6.55% 57 Missing ⚠️
...s/android/ui/reader/accent/ReaderImageMetaStore.kt 0.00% 45 Missing ⚠️
...ndroid/ui/reader/viewmodels/ReaderSubsViewModel.kt 28.33% 41 Missing and 2 partials ⚠️
...droid/ui/reader/repository/ReaderBlogRepository.kt 0.00% 29 Missing ⚠️
...droid/ui/reader/repository/ReaderSubsRepository.kt 6.25% 14 Missing and 1 partial ⚠️
...roid/ui/reader/accent/ReaderImageMetaEntryPoint.kt 0.00% 9 Missing ⚠️
.../android/ui/reader/utils/ReaderLayoutPreference.kt 0.00% 7 Missing ⚠️
...i/reader/utils/ReaderArticleRenderingPreference.kt 0.00% 4 Missing ⚠️
...ess/android/ui/rs/contentlist/ContentListPaging.kt 0.00% 3 Missing ⚠️
...oid/ui/reader/discover/ReaderPostUiStateBuilder.kt 85.71% 1 Missing and 1 partial ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #23580      +/-   ##
==========================================
- Coverage   39.76%   39.71%   -0.06%     
==========================================
  Files        2325     2330       +5     
  Lines      133227   133478     +251     
  Branches    19260    19311      +51     
==========================================
+ Hits        52976    53009      +33     
- Misses      75761    75976     +215     
- Partials     4490     4493       +3     

☔ 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.

…llery

The gallery held a blog preview's posts back until its site header arrived, deciding that from the BLOG_PREVIEW list type. The Subscriptions site filter uses that list type but never shows a header, so it only ever showed the cover. It now asks the view model, whose hasSiteHeader follows the same rule as loading the header.
- One small ⋯ button per tile (and long press) opens a menu with the card's save, like, comments and reblog, with their counts, above the usual more menu; screen readers get the same as custom actions.
- The site and date line opens the site, as the card's blog section does.
- Gallery posts show the first image of their thumbnail strip instead of becoming text cards.
- Text-only tiles show the title, then as much of the excerpt as fits.
Fixes the ConfigurationScreenWidthHeight lint error: LocalWindowInfo.containerSize is the window's width in pixels, which differs from the screen's in split screen and freeform windows.
The tile menu listed the card's four actions and the whole more menu. It now has just Save/Saved, Like/Liked with its count, and Share from the more menu.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge PR shouldn't be merged, failing the build Reader unit-tests-exemption

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants