Skip to content

Conversation

theayushyadav11
Copy link
Collaborator

@theayushyadav11 theayushyadav11 commented Jul 27, 2025

Fixes part of #5345:
This pull request introduces functionality to reset locally overridden platform parameters and feature flags to their server or default values, along with UI updates to support these features.

New Functionality

Platform Parameters

  • Added resetPlatformParameter method to handle resetting parameters to server/default values
  • Integrated reset functionality in presenter with proper state management
  • Added UI components for reset button with conditional visibility

Feature Flags

  • Implemented parallel resetFeatureFlag method for boolean flags
  • Added consistent reset behavior matching platform parameters
  • Integrated with existing feature flag UI components

UI Updates

  • Added observable fields to manage reset button state (isResetAvailable, isResetButtonActive)
  • Updated layouts to include reset sections for both platform parameters and feature flags
  • Ensured consistent styling and behavior between both reset implementations
  • Added a Save button which in the future PR will have an Alert Dialog attached.

Testing

  • Added comprehensive test coverage for both platform parameters and feature flags
  • Verified reset behavior persists across activity recreation
  • Confirmed proper state management during reset operations

Screen Recording

dashboard.mp4

Screenshots

Screenshot_20250827-123931 Oppia Screenshot_20250827-123946 Oppia

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

@theayushyadav11 theayushyadav11 requested review from a team as code owners July 27, 2025 19:26
@theayushyadav11 theayushyadav11 requested review from BenHenning and removed request for a team July 27, 2025 19:26
@theayushyadav11 theayushyadav11 marked this pull request as draft July 27, 2025 19:27
Copy link

Coverage Report

Results

Number of files assessed: 3
Overall Coverage: 0.00%
Coverage Analysis: PASS

Exempted coverage

Files exempted from coverage
File Exemption Reason
PlatformParameterControllerDebugImpl.ktdomain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterControllerDebugImpl.kt
This file is incompatible with code coverage tooling; skipping coverage check.
PlatformParameterItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParameterItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
PlatformParametersFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParametersFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

@BenHenning
Copy link
Member

Huh. I don't think my review is actually needed here. I don't see any files specific to owners that @adhiamboperes can't approve, so perhaps it is a holdover from an earlier version of the PR. Updating the reviewer list accordingly.

Please assign back if my approval is needed after @adhiamboperes's (I will quickly approve whatever remaining files need approval at that point since it's usually something small).

@BenHenning BenHenning removed the request for review from a team September 5, 2025 06:20
@BenHenning BenHenning removed their assignment Sep 5, 2025
@theayushyadav11
Copy link
Collaborator Author

Hi @adhiamboperes , PTAL.

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @Rd4dev for the extensive review!

@theayushyadav11, the PR looks solid. I may not have been as thorough as I would like due to time and size, but the PR is in a good shape.

Copy link

oppiabot bot commented Sep 5, 2025

Unassigning @adhiamboperes since the review is done.

Copy link

oppiabot bot commented Sep 5, 2025

Hi @theayushyadav11, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

@theayushyadav11
Copy link
Collaborator Author

PTAL @adhiamboperes

@oppiabot oppiabot bot assigned adhiamboperes and unassigned theayushyadav11 Sep 5, 2025
Copy link

oppiabot bot commented Sep 5, 2025

Unassigning @theayushyadav11 since a re-review was requested. @theayushyadav11, please make sure you have addressed all review comments. Thanks!

@theayushyadav11
Copy link
Collaborator Author

Hi @adhiamboperes , I have addressed all the comments PTAL.

@theayushyadav11
Copy link
Collaborator Author

Hi @BenHenning PTAL at this comment.

Copy link

github-actions bot commented Sep 5, 2025

Coverage Report

Results

Number of files assessed: 9
Overall Coverage: 0.00%
Coverage Analysis: PASS

Exempted coverage

Files exempted from coverage
File Exemption Reason
PlatformParameterItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParameterItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
PlatformParametersFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParametersFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
PlatformParametersFragment.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParametersFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
PlatformParametersViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/platformparameters/PlatformParametersViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsFragment.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
PlatformParameterControllerDebugImpl.ktdomain/src/main/java/org/oppia/android/domain/platformparameter/PlatformParameterControllerDebugImpl.kt
This file is incompatible with code coverage tooling; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @theayushyadav11!.

Please see my comment about filing and issue to clarify test naming and outcomes.

@adhiamboperes adhiamboperes merged commit 5ed2f00 into develop Sep 5, 2025
37 checks passed
@adhiamboperes adhiamboperes deleted the reset-platform-parameters branch September 5, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants