feat(client): add dispute open/resolve UI - #183
Merged
Dannyswiss1 merged 2 commits intoAug 29, 2026
Conversation
This was referenced Aug 24, 2026
|
@LamsOfJos leaving #188 / #189 for after this PR. I mistakenly opened overlapping PRs that re-added |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing UI for opening and resolving campaign disputes — previously the only path was calling
open_dispute/resolve_disputeon the contract directly, even though both hooks already existed inuseEscrowMutations.ts.Closes #145
What was implemented
OpenDisputeFormcomponent using the existinguseOpenDispute()hook, wired intoCampaignDetailPage. Visible only when the connected wallet is the campaign's farmer, a contributing investor (useContribution> 0), or the escrow admin (useEscrowAdmin) — mirroring the contract's own.require_auth()boundary as a UX convenience, not the authorization boundary itself.CampaignAdminPanel.tsxalready had aResolveDisputeFormwired touseResolveDispute(), covering all three resolution types (FullRefund / FullPayout / PartialSettlement), with the payout-amount field only required for PartialSettlement. Verified this satisfies the admin-side acceptance criterion as-is — no changes needed there.Notes / scope
CampaignDetailPagestill renders local mock campaign state (a separate, already-tracked gap — "once Issue 1 makes it real"). Added afarmerfield to its mockCampaignDataand keptOpenDisputeFormfully prop-driven so it drops in unchanged once the page is wired to real contract data.Testing
OpenDisputeForm.test.tsx(client/src/components/campaign/tests/), following the existingCampaignAdminPanel.test.tsxmocking pattern: wallet-not-connected, ineligible wallet (renders nothing), farmer/contributor/admin success paths, empty-reason validation, and contract-rejection error surfacing.tsc -b,eslint,prettier, andvite buildall pass for the changed/new files.ActivityFeed.test.tsx, confirmed pre-existing onmasterviagit stash— unrelated to this change.npm run lint/npm run format:checkcurrently fail repo-wide (~90 prettier errors inActivityFeed.tsx,ActivityFeedItem.tsx,activityLabels.ts,registry.test.ts,ActivityFeedPage.tsx) — none of these files are touched by this PR, and the failures reproduce on a cleanmastercheckout.Files changed
client/src/components/campaign/OpenDisputeForm.tsx(new)client/src/components/campaign/__tests__/OpenDisputeForm.test.tsx(new)client/src/pages/CampaignDetailPage.tsx