feat: Android client for newsrss #1

Closed
marti wants to merge 0 commits from feature/android-client into develop
Owner

Summary

An Expo (SDK 58) Android client for any newsrss server, in Material You: React Native Paper with colours from the wallpaper, and a Material 3 native theme.

src/
├── app/            # screens (Expo Router)
│   ├── connect     # any server: sign in, register, first-run setup
│   ├── (tabs)/     # Articles · Brief · Feeds · Settings
│   ├── entry/[id]  # reader, AI summary, in-app YouTube player
│   └── add-feed, feed/[id], brief-settings, ai, password, accounts, admin
├── api/            # client, query hooks, mutations
├── session/        # accounts and tokens in the keystore
├── shared/         # newsrss's Zod contract, copied by scripts/sync-shared.sh
└── lib/            # pure helpers, tested in test/

The server only has cookie sessions, so the client keeps each account's token itself:

sequenceDiagram
    participant App
    participant Server as newsrss server
    App->>Server: POST /api/auth/login
    Server-->>App: Me + Set-Cookie: newsrss_session
    Note over App: token stored per account (keystore)
    App->>Server: any call, Cookie: newsrss_session, credentials omit
    Server-->>App: JSON, parsed with the shared Zod schema

Evidence

  • Before: no Android client.
    After: checked on a Pixel 9 emulator (API 36) against a local newsrss server: connecting over HTTP after the HTTPS attempt, sign-in, the list with authenticated feed icons, read on open, swipe right for read and left for star, the reader, a YouTube video playing in the app with a chapter seeking the running player, Feeds with categories and counts, Add feed with discovery's picker (xkcd.com: Atom and RSS), brief settings saved to the server with the Material 3 time picker, and a live switch between light and dark.
npm run lint       Checked 66 files. No fixes applied.
npm run typecheck  ok (app and tests)
npm test           pass 19, fail 0

Found and fixed during the device run: Hermes has no Intl.RelativeTimeFormat (the list crashed), the theme provider kept the first empty query cache, and the two swipe actions were swapped.

Merge Danger

Door: two-way

A new repo with no users yet. The app changes nothing on the server and uses only its existing API.

Blast Radius: none

Not tested yet: AI summaries and the daily brief against a real model, and a release-signed build.

🤖 Generated with Claude Code

## Summary An Expo (SDK 58) Android client for any newsrss server, in Material You: React Native Paper with colours from the wallpaper, and a Material 3 native theme. ```text src/ ├── app/ # screens (Expo Router) │ ├── connect # any server: sign in, register, first-run setup │ ├── (tabs)/ # Articles · Brief · Feeds · Settings │ ├── entry/[id] # reader, AI summary, in-app YouTube player │ └── add-feed, feed/[id], brief-settings, ai, password, accounts, admin ├── api/ # client, query hooks, mutations ├── session/ # accounts and tokens in the keystore ├── shared/ # newsrss's Zod contract, copied by scripts/sync-shared.sh └── lib/ # pure helpers, tested in test/ ``` The server only has cookie sessions, so the client keeps each account's token itself: ```mermaid sequenceDiagram participant App participant Server as newsrss server App->>Server: POST /api/auth/login Server-->>App: Me + Set-Cookie: newsrss_session Note over App: token stored per account (keystore) App->>Server: any call, Cookie: newsrss_session, credentials omit Server-->>App: JSON, parsed with the shared Zod schema ``` ## Evidence - **Before:** no Android client. **After:** checked on a Pixel 9 emulator (API 36) against a local newsrss server: connecting over HTTP after the HTTPS attempt, sign-in, the list with authenticated feed icons, read on open, swipe right for read and left for star, the reader, a YouTube video playing in the app with a chapter seeking the running player, Feeds with categories and counts, Add feed with discovery's picker (xkcd.com: Atom and RSS), brief settings saved to the server with the Material 3 time picker, and a live switch between light and dark. ```text npm run lint Checked 66 files. No fixes applied. npm run typecheck ok (app and tests) npm test pass 19, fail 0 ``` Found and fixed during the device run: Hermes has no `Intl.RelativeTimeFormat` (the list crashed), the theme provider kept the first empty query cache, and the two swipe actions were swapped. ## Merge Danger **Door:** two-way A new repo with no users yet. The app changes nothing on the server and uses only its existing API. **Blast Radius:** none Not tested yet: AI summaries and the daily brief against a real model, and a release-signed build. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Expo Router as the entry, React Native Paper for Material 3 with
expo-material3-theme for the wallpaper colours, TanStack Query and Zod
for the API, and the Expo modules the features need. Cleartext HTTP is
allowed because self-hosted servers often run on a LAN without TLS.
Biome and lefthook match the newsrss repo; tests run on node:test.
The server's Zod schemas (packages/shared) are the contract; the app
parses every response with them. They are copied rather than linked
because newsrss is a separate repo and an npm workspace package cannot
be installed from a git subdirectory. scripts/sync-shared.sh refreshes
the copy.
The server signs clients in with a session cookie and has no bearer
tokens, so the client reads the token from Set-Cookie and sends it back
in its own Cookie header with the platform cookie jar turned off. That
keeps several accounts on several servers apart.
The connect screen takes any address (scheme optional, HTTPS tried
first), then signs in, registers when the server allows it, or sets up
a new server's admin. Accounts and their tokens live in the keystore;
an expired session sends the user back to sign in again.
Colours come from the wallpaper on Android 12+ and from a seed before
that; light or dark follows the user's newsrss setting. Four top-level
destinations sit in a Material 3 navigation bar, with the unread count
on Articles. Each account gets its own query cache.
Unread, all or starred; search; pull to refresh; infinite scroll.
Swiping toggles read or starred, a long press opens the other actions,
and mark-all-read offers an undo. Changes show at once and roll back
if the server refuses them.
Articles render in a themed WebView sized to its content, with links
opening in a Custom Tab. Videos play through YouTube's IFrame player
from youtube-nocookie.com with the server as the embedding origin,
which YouTube now requires; chapters seek without reloading. The AI
summary, full-article fetch, read on open and auto-summary follow the
user's settings.
Hermes on Android has no Intl.RelativeTimeFormat or compact
NumberFormat, and the list crashed on its first row. Relative times are
now the short form Android lists use (5m, 3h, 2d).
Paper spaces the app bar's direct children; a fragment around them
dropped the title's leading margin. The tab bar items now read as their
names to accessibility services, and the starred view can be opened
directly.
The Feeds tab groups subscriptions by category with unread counts. Add
feed finds the feed behind any page or YouTube channel and lets the
user pick when a site offers several; it also opens from
newsrss://add-feed?url=. Edit feed renames, recategorises, toggles
full-content fetching, refreshes and unfollows. OPML goes in through
the file picker and out through the share sheet.
The latest edition reads as a front page: stories under the user's
interests, the lead with its picture, each with the outlets that
covered it. Past editions, Run now with polling while the AI works, and
a checklist before the first edition. Brief settings cover the
schedule (Material time picker), interests and the brief's own feeds,
which stay out of the reading lists.
Reading preferences are the server's per-user settings, so the web app
and the phone agree. The AI screen sets the user's own endpoint, key and
models and tests them. Accounts lists every account on the phone, on
any server, to switch, add or remove. Admins manage users and
registration.
The icon is the web app's mark as an adaptive icon, with a monochrome
layer for Android's themed icons. A config plugin makes the native
theme Material 3 with dynamic colours, which the Material time picker
requires and which styles system dialogs to match. Without dynamic
colours the palette now grows from the newsrss orange.
Also a flake with the Android SDK React Native 0.88 builds against and a
light CI shell, and a Forgejo workflow that lints, typechecks and tests.
A mounted useQuery keeps the QueryClient it started with. The theme
provider mounted before the saved account loaded, stayed on the empty
first cache and never saw the user's theme change; keying the provider
by account remounts the tree with each cache. Also moves the time
picker off the deprecated onChange and makes the brief's setup steps
visible on their card.
fix(entries): swipe right for read and left for star, as shown
All checks were successful
ci / check (push) Successful in 26s
f3c21082ce
onSwipeableOpen reports the direction of the swipe, not the side whose
action opened, so the two actions were swapped.
Author
Owner

Merged into develop in 6c9b8a2 (together with the release workflow) and released as v0.1.0 from main.

Merged into develop in 6c9b8a2 (together with the release workflow) and released as v0.1.0 from main.
marti closed this pull request 2026-11-24 11:31:27 +01:00
All checks were successful
ci / check (push) Successful in 26s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
reef/android!1
No description provided.