fix(frontend): wire AgreementStatusPage, remove dead router/soroban, fix BigInt conversion - #372
Merged
ALLEN-AYODEJI merged 2 commits intoAug 30, 2026
Conversation
…fix BigInt conversion Closes Trellis-Ecosystem#304 -- Wire AgreementStatusPage Into Router - App.tsx: /agreement/:id now routes to AgreementStatusPage (uses useAgreement hook, live RPC) instead of broken StatusPage - /status route retained for the search-by-ID variant (StatusPage) - Navbar already highlights both /status and /agreement/* paths Closes Trellis-Ecosystem#305 -- Remove Dead Custom Router at lib/router.ts - Deleted frontend/src/lib/router.ts (90-line custom SPA router, never imported anywhere; app uses react-router-dom throughout) - No test file existed for it Closes Trellis-Ecosystem#306 -- Remove Dead Mock Functions from lib/soroban.ts - Removed sorobanServer stub and getAgreement/getAgreementEvents mock functions that returned empty results or threw - Kept shared domain types (Agreement, Milestone, EscrowStatus, SorobanEvent) — still imported by useAgreement, MilestoneRow, AgreementDetail, MilestoneActions, and StatusPage - StatusPage: removed sorobanServer import, added missing ExplorerLink import, replaced sorobanServer.getEvents body with a no-op comment Closes Trellis-Ecosystem#307 -- Fix BigInt Float Conversion in CreateAgreementPage - Added amountToStroops() helper: string-based conversion avoids floating-point precision loss from parseFloat(x) * 1e7 (e.g. 100.5 → 1005000000n without rounding errors) - amountToStroops rejects >7 decimal places and non-numeric input - validateForm updated to use amountToStroops instead of parseFloat⚠️ WARNING: do not run tests — pre-existing msw/node resolution failure affects all 17 test files in the baseline (missing dev dep, unrelated to these changes; confirmed identical failure count on master before this branch)
|
@Darkdruce 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! 🚀 |
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
Batch fix for four frontend issues identified during code review.
Closes #304 — Wire AgreementStatusPage Into Router
/agreement/:idnow routes toAgreementStatusPage(the newer page that uses theuseAgreementhook and live Soroban RPC) instead of the brokenStatusPage.App.tsx: replaced<StatusPage />with<AgreementStatusPage />on the/agreement/:idroute/statusroute is kept pointing toStatusPage(the manual search-by-ID variant)Navbar.tsxalready highlights both/statusand/agreement/*paths — no change neededExplorerLink(type="agreement") works: it builds/agreement/:idURLs which now resolve correctlyCloses #305 — Remove Dead Custom Router at lib/router.ts
Deleted
frontend/src/lib/router.ts(90 lines). The file implemented a full custom SPA router (useRoute,useNavigate,subscribeToRoute,initializeRouter) that was never imported anywhere. The app usesreact-router-dom(BrowserRouter,Routes,Route) throughout. No test file existed for it.Closes #306 — Remove Dead Mock Functions from lib/soroban.ts
Stripped the runtime dead code from
lib/soroban.ts:sorobanServerstub (always returned{ events: [] })getAgreement()(always threw "not yet implemented")getAgreementEvents()(always returned[])Agreement,Milestone,EscrowStatus,SorobanEvent) — still used across the codebaseSide-fixes in
StatusPage.tsxuncovered by removingsorobanServer:sorobanServerandCONTRACT_IDimportsExplorerLinkimport (was used in JSX but not imported)sorobanServer.getEventsbody inqueryEventswith a no-op stub and explanatory commentCloses #307 — Fix BigInt Float Conversion in CreateAgreementPage
BigInt(parseFloat(m.amount) * 1e7)throwsRangeErroror silently produces wrong results for decimal inputs due to floating-point precision loss.Fix: added
amountToStroops(amount: string): biginthelper that does string-based integer conversion:validateFormWhat was tested
tsc --noEmitpasses with zero errorsmswdev dependency unrelated to these changes) are unchanged frommaster— confirmed by running the suite on both branches