fix(mobile): make Android subscription usage widgets scrollable#13474

merged4
main
GitHub fork: t3code/fix-subscription-usage-wording
openedSep 24, 2026byTtris203
View on GitHubTwo-way sync enabledPR last imported 21d ago

What Changed

Android subscription widgets now scroll inside their container, show the entry count in the header using the app's existing Title (N) convention, and label the timestamp “Last checked”. Tapping a row still opens Usage → Limits.

Why

With Codex and OpenCode configured, the widget invented a Claude placeholder and appended a misleading “+N more” to the date. Its height estimate also left usable space empty and hid real limits. Snapshots now include only configured usage-capable providers or connected usage-source accounts, and Android receives the complete list. iOS keeps its existing bounded timeline and handles the newly possible empty snapshot.

UI Changes

Android 16 emulator, identical compact widget size and synthetic usage data. “One provider” means one usage-capable provider: Codex plus OpenCode configured. The header count is usage entries, not providers.

ConfigurationBeforeAfter
One usage provider: Codex (2 limits), plus OpenCode
Multiple usage providers: Codex + Claude (6 limits)

https://github.com/user-attachments/assets/80cd75f0-ba5f-447f-b974-8f83240cb7e7

Validation

  • 16 focused subscription snapshot tests pass, including Codex/Claude with OpenCode, expired and empty snapshots, and all 20 Android limits versus the existing iOS bound.
  • Mobile typecheck and scoped lint pass; Android development client builds and installs.
  • Emulator: both provider configurations, scrolling through all six entries with fixed header/footer, and row tap opening Usage → Limits.
  • Web/desktop and wire contracts are unaffected. iOS rendering was typechecked; native iOS verification was not run on this Linux host.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented with GPT-6 via Codex.

Summary by CodeRabbit

  • New Features

    • Android subscription usage widgets support scrolling through the full list of available limits and show a count of entries.
    • Configured providers can appear even when usage data is unavailable, with a “No limits available” message.
    • Empty subscription states display updated availability messaging.
  • Bug Fixes

    • Unsupported or unavailable providers no longer appear as subscription entries.
    • Android subscription widgets are enabled on Android 12L and later.
  • Documentation

    • Clarified the Android widget’s minimum supported version.

Checks

1 pending · 16 successful · 8 skipped · 1 neutral
Checks in progress

In progress1

46cc39a

Added 2 commits

  • fix(mobile): make Android subscription usage widgets scrollableed7660f
  • style(mobile): satisfy widget Kotlin lint rules1c68e01
Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — The PR replaces Android's static widget rows with a native scrollable collection and changes shared provider filtering, empty states, and Android version availability. These changes alter existing user-facing defaults across production widget paths, despite focused tests and no schema or infrastructure impact.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 94484e94-3c3a-4a14-b847-b9d854ce061a

📥 Commits

Reviewing files that changed from the base of the PR and between 1c68e01a27b118304dc11c340bfbf4f64856a5bb and c4fe91edbe87e0182a354509ae227f8226794310.

📒 Files selected for processing (8)
  • apps/mobile/modules/t3-subscription-widget/android/src/main/AndroidManifest.xml
  • apps/mobile/modules/t3-subscription-widget/android/src/main/java/expo/modules/t3subscriptionwidget/SubscriptionUsageWidget.kt
  • apps/mobile/modules/t3-subscription-widget/android/src/main/res/values-v32/bools.xml
  • apps/mobile/modules/t3-subscription-widget/android/src/main/res/values/bools.xml
  • apps/mobile/src/widgets/SubscriptionUsage.tsx
  • apps/mobile/src/widgets/subscriptionUsageSnapshot.test.ts
  • apps/mobile/src/widgets/subscriptionUsageSnapshot.ts
  • docs/user/usage.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/mobile/src/widgets/SubscriptionUsage.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The snapshot builder now selects eligible providers and supports platform-specific window limits. The Android widget now displays rows through a collection view and uses version-based receiver availability.

Changes

Subscription Usage Widgets

Layer / File(s)Summary
Provider selection and window limits
apps/mobile/src/widgets/subscriptionUsageSnapshot.ts, apps/mobile/src/widgets/SubscriptionUsageCoordinator.tsx, apps/mobile/src/widgets/SubscriptionUsage.tsx, apps/mobile/src/widgets/subscriptionUsageSnapshot.test.ts
The snapshot builder filters provider entries and accepts a configurable window limit. The coordinator supplies an unlimited limit on Android and six on iOS. The UI renders an empty-state message when there are no providers, and tests cover provider selection and window limits.
Android collection rendering and availability
apps/mobile/modules/t3-subscription-widget/android/src/main/AndroidManifest.xml, apps/mobile/modules/t3-subscription-widget/android/src/main/java/.../SubscriptionUsageWidget.kt, apps/mobile/modules/t3-subscription-widget/android/src/main/res/layout/t3_subscription_widget.xml, apps/mobile/modules/t3-subscription-widget/android/src/main/res/values*/..., docs/user/usage.md
The widget sends all rows through a RemoteViews collection and updates its title and footer based on rows with quota windows and check time. Collection intents use mutable flags and distinct request codes. Receiver availability is false by default and true from Android API 32; the documentation states that Android 12L or later is required.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

mermaid
1sequenceDiagram
2 participant SubscriptionUsageWidget
3 participant RemoteViews
4 participant AndroidWidgetHost
5 SubscriptionUsageWidget->>RemoteViews: Set RemoteCollectionItems and collection adapter
6 RemoteViews->>AndroidWidgetHost: Provide collection rows for display

Merge Risk: ⚪ Minimal · up to c4fe9

The Android widget changes and provider filtering have no identified issue requiring a fix before merge. Normal checks can proceed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (4 skipped: 4…Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly and concisely describes the primary change: making Android subscription-usage widgets scrollable.
Description check✅ PassedThe description includes all required sections, explains the change and rationale, documents UI changes with before/after screenshots and a video, and completes the checklist. It also records validati…
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

Added 2 commits

  • fix(mobile): hide unusable providers and limit Android widget to 12L+c4fe91e
  • style(mobile): keep widget update under detekt complexity limit46cc39a