Skip to content

feat(frontend): add commitment detail page showing on-chain record, attestations and dispute status - #2119

Merged
1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
ravimahatonp:feat/commitment-detail-page-2089
Oct 24, 2026
Merged

1nonlypiece merged 2 commits into
Commitlabs-Org:masterfrom
ravimahatonp:feat/commitment-detail-page-2089

Conversation

@ravimahatonp

Copy link
Copy Markdown
Contributor

Summary

Resolves #2089 by adding a dedicated, shareable commitment detail page at /commitments/[id] that directly reads the on-chain record, historical compliance attestations, and active dispute state from the Soroban escrow contract.

Closes #2089

Key Changes

  • Route & Page (src/app/commitments/[id]/page.tsx):
    • Implements a fully responsive (desktop 1440px and mobile 390px) client component.
    • Validates id as an unsigned 64-bit integer (u64) without triggering RPC network calls on malformed or out-of-range IDs (abc, -1, > 2^64-1).
    • Gracefully handles Loading (skeleton state with aria-busy), Not-Found (contract NotFound error code UI/UX Design: Design and implement the My Commitments page with commitment list, filters, and status indicators #3), and Error fallback with interactive retry.
    • Displays Terms (owner, asset, locked principal, accrued yield, risk profile, early-exit penalty %, creation and maturity timestamps).
    • Displays Lifecycle Timeline (Created → Funded → Matured/Released/Refunded/Disputed/Violated/Cancelled).
    • Displays Attestations table sorted newest first with relative time, UTC timestamp, and compliance scores; includes clean empty state when none exist.
    • Displays Active Dispute section conditionally (only rendered when get_dispute returns Some).
    • Safely renders metadata and dispute reason strings strictly as plain text (zero HTML injection) with defensive word-break boundaries.
    • Links contract and Stellar account addresses directly to Stellar.Expert explorer.
  • Soroban Read Helpers (src/lib/soroban/read.ts):
    • Added getCommitment(id), getAttestations(id), getDispute(id).
    • Added validateCommitmentId(id) and isNotFoundError(err).
    • Added timestamp formatting (formatRelativeTime, formatAbsoluteTime) and address abbreviation utilities.
  • Dashboard Integration (src/app/dashboard/page.tsx):
    • Linked on-chain commitment items and recent activity event commitment IDs directly to /commitments/[id].
  • Styling (src/app/globals.css):
    • Added status badge variants for created, funded, released, refunded, disputed, violated, and cancelled.

Testing & Verification

  • npm test: 27 passing tests across src/lib/soroban/__tests__/read.test.ts and src/app/commitments/[id]/__tests__/page.test.tsx (100% green).
  • npm run typecheck: TypeScript compilation passed with zero errors (tsc --noEmit).
  • npm run circular: Madge circular dependency check passed with zero circularities.
  • npm run build: Production Next.js build created /commitments/[id] route cleanly.
  • npm run size: Passed all route performance and bundle size budget checks (check-bundle-budget.mjs).

…estations and disputes

- Add /commitments/[id] route displaying terms, timeline, yield, and compliance
- Validate commitment ID as u64 decimal string without invoking RPC on malformed input
- Implement Soroban read helpers getCommitment, getAttestations, and getDispute
- Render historical attestations sorted newest first with relative and absolute times
- Render active dispute section only when contract returns Some
- Link on-chain items and activity events from dashboard to /commitments/[id]
- Add comprehensive unit and component tests with mocked simulation results

Closes Commitlabs-Org#2089
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

@ravimahatonp is attempting to deploy a commit to the 1nonly's projects Team on Vercel.

A member of the Team first needs to authorize it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1nonlypiece
1nonlypiece merged commit 8303b80 into Commitlabs-Org:master Oct 24, 2026
4 of 6 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.

[frontend] Add a commitment detail page showing on-chain record, attestations and dispute status

2 participants