Skip to content

Conversation

@sztomek
Copy link
Contributor

@sztomek sztomek commented Jan 13, 2026

Description

This PR hides the plan switching option when the user is subscribed to the installments plan in sync with the link P2 discussion.

P2: pdeCcb-aGD-p2#comment-8759

Fixes PCDROID-392

Testing Instructions

Check previews

Screenshots or Screencast

SCR-20260113-skyq

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@sztomek sztomek added this to the 8.4 milestone Jan 13, 2026
@sztomek sztomek requested a review from a team as a code owner January 13, 2026 20:16
@sztomek sztomek requested review from MiSikora and Copilot and removed request for a team January 13, 2026 20:16
@sztomek sztomek added [Type] Feature Adding a new feature. [Area] Subscriptions Plus or Patron issue labels Jan 13, 2026
@sztomek sztomek force-pushed the feat/installments-disable-switch branch from 5be80b8 to a63edde Compare January 13, 2026 20:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hides the plan switching option in the winback flow when users are subscribed to an installment plan, addressing PCDROID-392.

Changes:

  • Added isInstallment field to WinbackViewModel's UiState to track installment subscription status
  • Modified CancelOfferPage to conditionally hide the "Available Plans" section based on installment status
  • Updated subscription flow to propagate installment status from cached subscription

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
WinbackViewModel.kt Added isInstallment field to UiState and updated subscription flow collection to populate it from cached subscription
WinbackFragment.kt Passed isInstallment parameter from state to CancelOfferPage composable
CancelOfferPage.kt Added conditional rendering to hide AvailablePlans section when isInstallment is true, updated preview parameter

Comment on lines +48 to +51
_uiState.value = _uiState.value.copy(
currentSubscriptionExpirationDate = subscription?.expiryDate,
isInstallment = subscription?.isInstallment ?: false,
)
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

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

The new isInstallment field in UiState lacks test coverage. Since this file has comprehensive unit tests for other ViewModel functionality, tests should be added to verify that the isInstallment value is correctly propagated from the subscription flow to the UI state. Consider adding a test that verifies when a subscription with isInstallment = true is emitted, the UiState correctly reflects this value.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Subscriptions Plus or Patron issue [Type] Feature Adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants