Skip to content

feat(disputes): add moderator resolution and role-aware read-only UI (#255) - #266

Merged
SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
Hustler490:feat/w2-issue-255-dispute-detail-ui
Oct 22, 2026
Merged

SudiptaPaul-31 merged 1 commit into
Lumina-eX:mainfrom
Hustler490:feat/w2-issue-255-dispute-detail-ui

Conversation

@Hustler490

@Hustler490 Hustler490 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #255

Summary

Completes the existing dispute details/resolution UI for issue #255 by closing the remaining resolution gaps: moderators can now record a final decision, the decision persists on the dispute, resolved disputes become read-only, and the UI knows whether the caller is an admin.

Problem

The dispute detail page already rendered the reason, evidence, timeline and resolution status, but:

  • POST /api/disputes/:id/resolve only bumped updated_at; it never stored the resolution, status or resolved_at on the dispute.
  • The page had no moderator action, so an arbitrator could not resolve a dispute from the UI.
  • A resolved dispute still rendered the evidence submission form.
  • /api/auth/me returned no role, so the client could not distinguish an admin from a participant.
  • The dispute routes were not linked from the desktop or mobile menus.

Solution

  • Persist the resolution on the dispute (status = 'resolved', resolution, resolved_at, updated_at), update the related job escrow state, and record a dispute_resolved activity event.
  • Return role from /api/auth/me (additive field, null if the user row cannot be read).
  • Add a moderator resolution form to the existing detail page, shown only when /api/auth/me reports role === "admin" and the dispute is still open.
  • Hide the evidence form and moderator action after resolution, and show the recorded decision as read-only.
  • Add Disputes links to the desktop profile menu and mobile menu.
  • Extend the existing page test to cover the moderator controls and the resolved read-only state.

Validation

  • npx vitest run "app/dashboard/disputes/[id]/page.test.tsx" ΓÇö 3 passed.
  • npx eslint app/api/disputes/[id]/resolve/route.ts app/api/auth/me/route.ts app/dashboard/disputes/[id]/page.tsx app/dashboard/disputes/[id]/page.test.tsx components/navbar.tsx ΓÇö 0 errors.
  • npm run build ΓÇö success (39 routes generated).
  • The full npm test suite still has pre-existing failures in deliverables/reviews/recommendations tests unrelated to this change; main CI (build + contracts) is green.

Parallel-work check

No PR referencing #255 existed when work began or immediately before pushing. The other assigned issues already had open PRs (#202, #183, #412), and Savitools #431 was skipped because it was already fixed. This branch is based on current main (73e5e9e).

@drips-wave

drips-wave Bot commented Oct 19, 2026

Copy link
Copy Markdown

@Hustler490 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Hustler490

Copy link
Copy Markdown
Contributor Author

CI is waiting for maintainer approval (action_required) because this PR comes from a fork.

Local checks:

  • npx vitest run "app/dashboard/disputes/[id]/page.test.tsx" — 3 passed
  • npx eslint on all touched files — 0 errors
  • npm run build — success

The full npm test suite still has pre-existing failures in deliverables/reviews/recommendations tests unrelated to this change. main CI (build + contracts) is green.

@Hustler490 Hustler490 changed the title feat(disputes): add moderator resolution and role-aware read-only UI feat(disputes): add moderator resolution and role-aware read-only UI (#255) Oct 20, 2026
@Hustler490
Hustler490 force-pushed the feat/w2-issue-255-dispute-detail-ui branch from 72692da to 5a7d905 Compare October 22, 2026 02:13
@SudiptaPaul-31

Copy link
Copy Markdown
Collaborator

@Hustler490 good work LGTM

@SudiptaPaul-31
SudiptaPaul-31 merged commit 572fc32 into Lumina-eX:main Oct 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Dispute Case Details & Resolution UI

2 participants