Successfully overwrote file: /home/Messier82/.gemini/tmp/service-book/6a1c8d1e-8a60-4460-a64e-c185658d819d/plans/pr-86-round-2.md. Here is the updated code: # PR #86 Round 3 Fixes Plan ## Overview This plan addresses the additional review comments for PR #86 from Round 3. It includes fixing a screenshot viewport issue, localizing debug strings, refactoring tests to use real ViewModels, and moving the SentryInitParams to its own file. ## Tasks ### 1. `SettingsScreenshotTest.kt` - Change `composeTestRule.onRoot().captureScreen("SettingsScreen_debug_crash_section_light")` to `captureFull("SettingsScreen_debug_crash_section_light")` so that off-screen debug content is correctly captured. - Add an explicit scroll to the debug section using `composeTestRule.onNodeWithText("Crash reporting (Dev only)", substring = true, ignoreCase = true).performScrollTo()` before calling `captureFull` to ensure it is visible in the viewport. ### 2. `SettingsScreen.kt` & `strings.xml` - Move the hardcoded English strings in the `AlertDialog` to `strings.xml`: - `R.string.settings_force_test_crash_dialog_title` - `R.string.settings_force_test_crash_dialog_message` - `R.string.settings_force_test_crash_dialog_confirm` - Update the dialog to use `stringResource` for these new strings and `android.R.string.cancel` for the dismiss button. - Hoist the `var showCrashConfirmation` state to the top of the composable. - In `strings.xml`, update `settings_crash_reporting_dev_title` from `"Crash reporting"` to `"Crash reporting (Dev only)"`. ### 3. `ReportBugScreenTest.kt` - Refactor the `submit button is disabled and error is shown when email is invalid` test: - Instead of passing a hand-crafted `ReportBugState` to a mocked ViewModel, construct a real `ReportBugViewModel` (you may need to mock its dependencies or use a test instance). - Call `viewModel.onEvent(ReportBugEvent.SummaryChanged("S"))` - Call `viewModel.onEvent(ReportBugEvent.DescriptionChanged("D"))` - Call `viewModel.onEvent(ReportBugEvent.ContactEmailChanged("invalid"))` - Assert that the submit button is disabled and the error message is shown. ### 4. `SentryInitParams.kt` & `SentryWrapper.kt` - Move the `SentryInitParams` data class out of `SentryWrapper.kt` into a new file `app/src/main/java/com/servicebook/util/SentryInitParams.kt`. ### 5. `ReportBugViewModel.kt` - Add a comment above `Patterns.EMAIL_ADDRESS.matcher` noting the intentional leniency of the pattern matching. - Add a comment above the `sentryWrapper.lazyInitAndSendFeedback` call: `// NOTE: bypasses crash-reporting opt-out; user-initiated.` ### 6. `ServiceBookApplication.kt` - Add a comment to `sentryEnvironment` and `sentryRelease` noting that they are internal-only because `ReportBugViewModel.performSubmission` needs them for the lazy-init path. ## Verification - Run `./gradlew testDebugUnitTest` to ensure all tests pass. - Run `./gradlew recordRoborazziDebug` and `./gradlew verifyRoborazziDebug` to verify the new screenshot baselines.