feat(#280): confirm before opening a dispute - #296
Conversation
The "Open dispute" button called disputes_api.openDispute directly with no confirmation, so an accidental tap immediately escalated the trade to an admin — an action that can't be undone. The sibling destructive actions in the same row (Cancel, Release) already confirm first. Adds a dispute confirmation dialog following the release-confirmation pattern (dedicated widget + Yes/No + localized strings in the 5 .arb files), styled with the destructive-red accent to signal weight. _openDispute now shows it and aborts on cancel, mirroring _releaseOrder. Tests: three widget tests assert the dialog renders (title, body, Yes/No) and that Yes resolves true / No resolves false. flutter analyze clean.
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe trade detail screen now requests confirmation before opening a dispute. A reusable localized dialog displays the warning and returns the selected action. Cancellation aborts the operation. Widget tests cover content and button results. ChangesDispute confirmation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ridge-failure test The new confirmation dialog gates _openDispute, so the existing secondary-action test must tap Yes before the flow reaches disputes_api.openDispute. Mirrors the release and cancel confirmation steps in the sibling tests.
There was a problem hiding this comment.
Reviewed current head f0a46c8. The dispute action is now gated before the daemon call, cancel/dismiss paths correctly abort via MostroActionAborted, and the new strings are present across all five ARB locales with parity. CI is green for Flutter analyze/tests, Rust, and web smoke. No blockers found.
Closes #280.
Problem
The "Open dispute" button in the trade detail screen called
disputes_api.openDisputedirectly with no confirmation. An accidental tap immediately opened a dispute with the daemon an action that can't be undone and escalates the trade to an admin. The other two destructive actions in the same row already confirm: Cancel shows anAlertDialog, and Release has a dedicatedrelease_confirmation_dialog.dart.Fix
Add a dispute confirmation dialog following the release-confirmation pattern:
dispute_confirmation_dialog.dartshowDisputeConfirmationDialog(context)returningbool?, mirroringshowReleaseConfirmationDialog. Styled with thedestructiveRedaccent and a gavel icon to signal a serious, irreversible escalation._openDisputenow shows the dialog first and aborts on cancel (throw const MostroActionAborted()), exactly as_releaseOrderdoes so the confirmation gates the daemon call.openDisputeTitle+openDisputeConfirmationadded to all 5.arbfiles.Testing
Three widget tests (

dispute_confirmation_dialog_test.dart): renders the title/body/Yes/No, tapping Yes resolvestrue, tapping No resolvesfalse. Also confirmed visually on Linux desktop (gavel icon, destructive-red confirm, correct strings, both buttons dismiss).flutter analyzeclean.Summary by CodeRabbit
New Features
Bug Fixes