# Plan: Privacy Policy UX and Report Bug Animation Fixes ## Objective 1. Fix the expand/collapse animation glitch in the Report Bug screen. 2. Improve the UX for the "Learn more" privacy disclosure by showing it in a popup dialog on full screens (Setup and Settings), while keeping the inline expansion for existing dialogs (Consent Dialog). ## Key Files & Context - `app/src/main/java/com/servicebook/ui/reportbug/ReportBugScreen.kt` - `app/src/main/java/com/servicebook/ui/navigation/AppNavGraph.kt` - `app/src/main/java/com/servicebook/ui/settings/SettingsScreen.kt` - `app/src/main/java/com/servicebook/ui/vehicles/VehicleListScreen.kt` (No changes needed) - `app/src/main/java/com/servicebook/ui/components/PrivacyPolicyDialog.kt` (New) ## Implementation Steps ### 1. Fix Report Bug Animation In `ReportBugScreen.kt`: - Remove `Modifier.animateContentSize()` from the `Column` inside the `Card` that wraps the device info section to eliminate the double-animation glitch. - Update the `AnimatedVisibility(visible = state.showDeviceInfo)` block to use explicit `expandVertically(expandFrom = Alignment.Top)` and `shrinkVertically(shrinkTowards = Alignment.Top)` with synchronized tween durations, matching the smooth animation used elsewhere. ### 2. Create `PrivacyPolicyDialog` Create a new composable `PrivacyPolicyDialog.kt` in `app/src/main/java/com/servicebook/ui/components/`: - It will take `onDismissRequest: () -> Unit` as a parameter. - It will render an `AlertDialog` with a "Privacy Policy" title. - The text content will be `PrivacyPolicyContent()`. - It will have a "Close" or "Dismiss" confirmation button. ### 3. Update Setup & Settings Screens In `AppNavGraph.kt` (Setup screen) and `SettingsScreen.kt` (Privacy section): - Introduce a local `var showPrivacyDialog by rememberSaveable { mutableStateOf(false) }`. - Replace the `ExpandablePrivacyDisclosure` usage with a `TextButton` ("Learn more"). - When clicked, set `showPrivacyDialog = true`. - Conditionally render `PrivacyPolicyDialog` when `showPrivacyDialog` is true. ### 4. Keep Consent Dialog As Is Ensure `VehicleListScreen.kt` continues to use `ExpandablePrivacyDisclosure` so it expands inline and avoids popup-over-popup. ## Verification & Testing 1. Re-record the baseline for `SettingsScreenshotTest.settings_privacy_expanded` (it will now capture the dialog state). 2. Update `SetupScreenshotTest.setup_step2_sentry_privacy_expanded` to handle the dialog state and re-record. 3. Verify that `VehicleListConsentDialogTest` still passes. 4. Add or update screenshot tests for `ReportBugScreen` if necessary. 5. Run all unit tests, detekt, and ktlint (`./gradlew testDebugUnitTest ktlintCheck detekt`).