feat(reporting): show a clear confirmation dialog after submitting a problem report #171

Merged
JMR-dev merged 5 commits from feat-161-report-confirmation into main 2026-07-02 23:36:36 +00:00
JMR-dev commented 2026-07-02 22:03:58 +00:00 (Migrated from github.com)

Summary

  • Replaces the small inline report_submitted text ("Report sent. Thank you!") on ReportReviewScreen with the fuller thank-you/no-guarantee copy requested in #161, delivered via a Material3 AlertDialog (ReportSubmittedDialog) instead of inline text.
  • Avoids the auto-navigate race the ticket flags: the screen's LaunchedEffect(state.loaded, state.exists, state.submit) that leaves the screen once the report row is gone now also checks state.submit — it no longer fires while a submit is in flight (SUBMITTING) or has just succeeded (SUCCEEDED). For those two states, onDone() is instead called from the new dialog's acknowledgement (confirm button or dismiss), which is what actually navigates away. This works regardless of whether the row deletion (by ReportUploadWorker, which can happen moments after SUCCEEDED) is observed before or after the SUCCEEDED status itself, since auto-navigate is suppressed for the entire SUBMITTING→SUCCEEDED window, not just at the exact instant of SUCCEEDED.
  • Plain discard and the other terminal states (FAILED, UNAVAILABLE) are untouched and still auto-navigate immediately, same as before.
  • report_submitted string updated in place with the new copy (avoids leaving an orphaned unused resource); added report_submitted_dismiss ("OK") for the dialog's button.

Test plan

  • assembleDebug, testDebugUnitTest, lintDebug, ktlintCheck, detekt, compileDebugAndroidTestKotlin all green locally (JDK 21).
  • ReportReviewViewModelTest (unchanged, still 5/5 passing) — no ViewModel changes were needed since the gating lives in the composable's existing state.submit/state.exists.
  • No existing androidTest covers ReportReviewScreen, so none needed updating.

Closes #161

🤖 Generated with Claude Code

## Summary - Replaces the small inline `report_submitted` text ("Report sent. Thank you!") on `ReportReviewScreen` with the fuller thank-you/no-guarantee copy requested in #161, delivered via a Material3 `AlertDialog` (`ReportSubmittedDialog`) instead of inline text. - **Avoids the auto-navigate race** the ticket flags: the screen's `LaunchedEffect(state.loaded, state.exists, state.submit)` that leaves the screen once the report row is gone now also checks `state.submit` — it no longer fires while a submit is in flight (`SUBMITTING`) or has just succeeded (`SUCCEEDED`). For those two states, `onDone()` is instead called from the new dialog's acknowledgement (confirm button or dismiss), which is what actually navigates away. This works regardless of whether the row deletion (by `ReportUploadWorker`, which can happen moments after `SUCCEEDED`) is observed before or after the `SUCCEEDED` status itself, since auto-navigate is suppressed for the entire `SUBMITTING`→`SUCCEEDED` window, not just at the exact instant of `SUCCEEDED`. - Plain discard and the other terminal states (`FAILED`, `UNAVAILABLE`) are untouched and still auto-navigate immediately, same as before. - `report_submitted` string updated in place with the new copy (avoids leaving an orphaned unused resource); added `report_submitted_dismiss` ("OK") for the dialog's button. ## Test plan - [x] `assembleDebug`, `testDebugUnitTest`, `lintDebug`, `ktlintCheck`, `detekt`, `compileDebugAndroidTestKotlin` all green locally (JDK 21). - [x] `ReportReviewViewModelTest` (unchanged, still 5/5 passing) — no ViewModel changes were needed since the gating lives in the composable's existing `state.submit`/`state.exists`. - No existing androidTest covers `ReportReviewScreen`, so none needed updating. Closes #161 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.