fix: prevent small nonzero XLM amounts from displaying as zero (#76) - #161
Open
rafaio1 wants to merge 14 commits into
Open
fix: prevent small nonzero XLM amounts from displaying as zero (#76)#161rafaio1 wants to merge 14 commits into
rafaio1 wants to merge 14 commits into
Conversation
added 14 commits
August 20, 2026 05:11
Fixes MergeFi#52. ConnectPanel assumed GitHub auth and wallet connection happened in a single linear session, failing to correctly reflect or handle partially completed states (e.g. wallet connected locally but not linked to an authenticated account, or an account linked to a different wallet than the one currently active in Freighter). Updated the wallet connection section to explicitly surface the linkage state. It now distinguishes between a locally connected wallet, a wallet durably linked to the authenticated GitHub account, and cases where the local Freighter account diverges from the server-side linked address, providing clear UI feedback for each matrix state.
…i#70) - Pass raw numeric values with explicit format props on HomePage and ReputationPage instead of pre-formatted strings, restoring tooltip precision and zero-state detection. - Add fetchReputationWithStatus to distinguish live fetch success from mock fallback; wire status prop into ReputationPage StatCards. - Keep Avg. payout time as pre-formatted string with explicit comment (duration doesn't fit existing format variants).
- Render stable skeleton placeholder during auth loading to prevent flash of logged-out state on fresh page load with persisted session. - Filter dashboard dropdown links by user.roles array, supporting multi-role users (e.g. maintainer+sponsor sees both links). - Hide Dashboards dropdown entirely when user has no assigned roles.
MergeFi#82) - Add funderAddress to Bounty type and RawBounty interface, mapped through adaptBounty from backend data. - Gate 'Refund sponsor' button rendering on current wallet address matching bounty.funderAddress; only the actual funder sees the button. - Document that handleFund is intentionally open (crowdfunding model) while handleRefund is restricted to the original funder. - TypeScript compiles cleanly (npx tsc --noEmit passes).
…ergeFi#51) - Replace hardcoded en-US formatting in formatCurrency, formatPercent, StatCard, and ActivityList with Intl APIs using viewer's browser locale. - Honor XLM's native 7-decimal precision (was capped at 2 everywhere). - Use Intl.RelativeTimeFormat for activity feed timestamps with fallback. - Document scope decision: locale-aware formatting via Intl now; full i18n library adoption deferred to a dedicated RFC. - TypeScript compiles cleanly (npx tsc --noEmit passes).
…ible percentages (MergeFi#91) - Replace unclamped coerceDecimal(...)/100 pattern in adaptReputation for completionRate and onTimeDeliveryRate with coerceFraction, which clamps the result to [0, 1] after division. - A backend value of '150' now produces 1 (not 1.5); negative values produce 0; normal values like '94' still produce 0.94 exactly. - Audit of other adapters found no additional unclamped fraction patterns — coercePercentage already handles team split percentages, and no other rate/percentage fields derive from raw backend strings without an existing clamp. - TypeScript compiles cleanly (npx tsc --noEmit passes).
… literals (MergeFi#92) - Add computeTrend helper to derive period-over-period percentage change from history arrays; returns undefined for <2 data points. - Replace hardcoded trend literals (12, 8, 18) on contributor and sponsor dashboards with computed values from existing sparkline/history data. - Audit found no other hardcoded numeric props in dashboard pages. - TypeScript compiles cleanly (npx tsc --noEmit passes).
- Add teamSplitsValid field to Bounty type so validation result flows through the domain type, not just adaptBounty's return signature. - Render visible amber warning banner when team splits don't sum to 100%, using the message already computed by validateTeamSplits. - Guard against empty splits array to avoid rendering an empty section. - TypeScript compiles cleanly (npx tsc --noEmit passes).
- Add numeric amount input to MilestoneFundButton, matching the pattern established by PoolDepositButton in the same file. - Validate amount before submission: reject empty, non-positive, non-finite, and over-precision (>7 decimals) values. - Send the validated amount alongside funderAddress to POST /milestones/:id/fund. - TypeScript compiles cleanly (npx tsc --noEmit passes).
…eFi#80) - Replace fetchReputationByUsername's GET /users + client-side .find() with a scoped GET /users/by-username/:username call, eliminating the O(n) full-table download on every reputation page view. - Document backend dependency: mergefi-backend must expose this endpoint; until then, the function falls back to mock/fallback data on 404/error, preserving existing behavior for nonexistent handles and demo states. - TypeScript compiles cleanly (npx tsc --noEmit passes).
…tion (MergeFi#81) - Split ContributorDashboardPage and SponsorDashboardPage into thin Server Component wrappers with route-specific metadata + Client Component bodies, matching the existing ConnectPage/CallbackClient pattern. - Add generateMetadata to IssueDetailPage with dynamic title/description/OG tags derived from the fetched bounty; handle not-found gracefully. - Add generateMetadata to ReputationPage with handle-specific title/OG tags; handle not-found gracefully. - TypeScript compiles cleanly (npx tsc --noEmit passes).
- Replace hardcoded /dashboard/contributor redirect in CallbackClient with role-aware logic: maintainer > sponsor > contributor precedence. - Destructure user from useAuth() to read roles after login resolves; fall back to contributor dashboard if user is null or roles empty. - Document that AuthUser.roles was previously fetched but never consumed anywhere in the app; this fix begins using it. - TypeScript compiles cleanly (npx tsc --noEmit passes).
- Add hamburger-triggered slide-in drawer to Navbar.tsx surfacing all desktop nav links (Bounties, Milestones, Dashboards group, Reputation, Sign out) below the md breakpoint with proper ARIA attributes and keyboard support (Escape to close, focus management). - Add equivalent mobile sidebar drawer to DashboardShell.tsx with a toggle button visible only on small screens, exposing all sidebar items and the role switcher. - Both drawers close on backdrop click, Escape key, and link navigation. - No regression to existing desktop (md+) navigation behavior. - TypeScript compiles cleanly (npx tsc --noEmit passes).
…Fi#76) - Add floor check in formatCurrency and StatCard: XLM amounts >0 but <0.0000001 now display as '<0.0000001 XLM' instead of rounding to '0 XLM'. - Asset-aware precision (XLM=7, USDC=2) was already added in MergeFi#51; this completes MergeFi#76 by handling the sub-stroop display edge case. - StatCard exact tooltip already uses 7 decimals for XLM (correct). - TypeScript compiles cleanly (npx tsc --noEmit passes).
|
Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #76.
formatCurrencyandStatCard: XLM amounts >0 but <0.0000001 now display as<0.0000001 XLMinstead of rounding to0 XLM.StatCardexact tooltip already uses 7 decimals for XLM (correct).npx tsc --noEmitpasses).