Successfully created and wrote to new file: /home/Messier82/.gemini/tmp/service-book/6a1c8d1e-8a60-4460-a64e-c185658d819d/plans/pr-86-review-fixes.md. Here is the updated code: # Plan: Address PR Review Comments for Issue 81 ## Objective Address the feedback provided in the code review for PR #86, which improves the Sentry integration and fixes the email validation UI. ## Key Files & Context - `app/src/main/java/com/servicebook/ServiceBookApplication.kt` - `app/src/main/java/com/servicebook/ui/reportbug/ReportBugViewModel.kt` - `app/src/main/java/com/servicebook/ui/settings/SettingsScreen.kt` - `app/src/test/java/com/servicebook/ServiceBookApplicationTest.kt` - `app/src/test/java/com/servicebook/ui/reportbug/ReportBugViewModelTest.kt` ## Implementation Steps ### 1. Duplicated environment/release computation (Issue #1) - **Target:** `app/src/main/java/com/servicebook/ServiceBookApplication.kt` - **Action:** Change the visibility of `sentryEnvironment` and `sentryRelease` from `protected open` to `internal open` so they can be accessed by the ViewModel. - **Target:** `app/src/main/java/com/servicebook/ui/reportbug/ReportBugViewModel.kt` - **Action:** Update the call to `sentryWrapper.lazyInitAndSendFeedback`. Instead of recalculating the environment and release strings using `BuildConfig`, pass `app.sentryEnvironment` and `app.sentryRelease`. The `app` instance is already available via the injected `dependencies.app`. ### 2. `internal` visibility purely for tests (Issue #2) - **Target:** `app/src/main/java/com/servicebook/ServiceBookApplication.kt` - **Action:** Change the visibility of `configureSentryOptions` from `internal` to `private`. - **Target:** `app/src/test/java/com/servicebook/ServiceBookApplicationTest.kt` - **Action:** Update the test `` `configureSentryOptions sets dsn, environment and release with privacy defaults` `` to mock `SentryAndroid.init` to capture the `SentryAndroidOptions` parameter when `app.doSentryInit` is called, allowing the assertions to pass without requiring internal access to `configureSentryOptions`. Alternatively, use the `SentryEnabledApp` to expose the options inside its overridden `doSentryInit`. ### 3. "Force test crash" has no confirmation (Issue #3) - **Target:** `app/src/main/java/com/servicebook/ui/settings/SettingsScreen.kt` - **Action:** Change the `TextButton` for the "Force test crash" action to an `OutlinedButton` to make it visually distinct from the other debug actions. ### 4. Test naming nit (Issue #5) - **Target:** `app/src/test/java/com/servicebook/ui/reportbug/ReportBugViewModelTest.kt` - **Action:** Rename the test method from `` `canSubmit should be false when email is invalid` `` to `` `canSubmit reflects email validity` `` to better represent its assertions. ## Verification & Testing - Run all unit tests to ensure that the refactored `ServiceBookApplicationTest` still passes and correctly verifies the Sentry options. - Verify that `ReportBugViewModelTest` passes with the renamed method and the new reliance on the application's environment and release getters. - (Manual/Preview) Verify that the Settings screen's debug crash button is visually distinct as an `OutlinedButton`.