fix(issues): surface adaptBounty teamSplitsValid result in IssueDetailPage (#85) - #95
Open
ghzhost wants to merge 1 commit into
Open
fix(issues): surface adaptBounty teamSplitsValid result in IssueDetailPage (#85)#95ghzhost wants to merge 1 commit into
ghzhost wants to merge 1 commit into
Conversation
…lPage (MergeFi#85) - Add teamSplitsValid to Bounty domain interface in types/index.ts - Render visible alert banner with computed message in IssueDetailPage when team splits sum != 100% - Cleanly simplify adaptBounty return signature and utils.ts validateTeamSplits - Add full test coverage in IssueDetailPage.test.tsx
|
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.
Overview
Closes #85.
Previously,
adaptBountyevaluatedteamSplitsValidfor every bounty containing team payout splits, but the resulting object was never consumed in UI pages or typed as part of the coreBountydomain model. When team splits sum to an invalid amount (e.g. 85% or 110%), the breakdown was silently rendered without any indication to contributors or maintainers.Key Changes
Domain Model & Type Alignment (
src/types/index.ts):TeamSplitsValidationinterface ({ valid: boolean; sum: number; message?: string }).teamSplitsValid?: TeamSplitsValidationto theBountyinterface so it flows cleanly throughfetchBounty,fetchBounties, and React components.Clean Adapter Return Type (
src/lib/adapters.ts):adaptBounty(raw: RawBounty): Bountynow thatteamSplitsValidis natively part ofBounty.Surface Invalid Splits Warning in
IssueDetailPage(src/app/issues/[id]/page.tsx):role="alert"andAlertTriangleicon) displaying the pre-computedteamSplitsValid.messagewheneverbounty.teamSplitsValid?.valid === false.Utils & Test Suite Support (
src/lib/utils.ts,package.json):validateTeamSplitsdefinition.src/app/issues/[id]/IssueDetailPage.test.tsxverifying valid split rendering, invalid split warning banner presentation, and absent/empty split handling.Verification
npx tsc --noEmitpassed with 0 errors.npm testpassed (14/14 tests across all suites).npm run buildcompiled successfully (Turbopack).npm run lintand verification scripts passed.