Repository navigation
feat(frontend): show visual percentage bar of streamed vs refunded tokens in CancelConfirmModal - #1683
Closed
aazminu wants to merge 1 commit into
Closed
feat(frontend): show visual percentage bar of streamed vs refunded tokens in CancelConfirmModal#1683aazminu wants to merge 1 commit into
aazminu wants to merge 1 commit into
Conversation
…kens in CancelConfirmModal Add a two-segment horizontal progress bar in `CancelConfirmModal` displaying the percentage of vested/streamed tokens (recipient) vs refundable tokens (sender) formatted to 1 decimal place (e.g. `64.5% Streamed / 35.5% Refunded`), clamping edge cases (0%, 100%, zero deposit, overflow) without NaN. Fixes LabsCrypt#1639
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.
Description
Adds a two-segment horizontal progress bar in
CancelConfirmModal(frontend/src/components/stream-creation/CancelConfirmModal.tsx) showing the percentage of vested/streamed tokens (recipient) vs refundable tokens (sender) formatted to 1 decimal place (64.5% Streamed / 35.5% Refunded).Type of Change
Related Issues
Closes #1639
Fixes #1639
/claim #1639
Changes Made
calculateCancelSplitPercentages(deposited, withdrawn)infrontend/src/components/stream-creation/CancelConfirmModal.tsxto compute clamped 1-decimal percentage splits (streamedFormatted,refundedFormatted,summaryLabel) withoutNaNor overflow on0%,100%, or zero-deposit edge cases.role="progressbar",data-testid="cancel-split-bar") with emerald (streamed) and accent (refunded) segments and a formatted summary label ({streamedFormatted}% Streamed / {refundedFormatted}% Refunded).frontend/src/components/stream-creation/__tests__/CancelConfirmModal.test.tsxverifying the dual-segment bar widths, 1-decimal formatting (64.5% Streamed / 35.5% Refunded), and0%/100%/ overflow /NaNedge cases.Testing
Test Coverage
Test Steps
npx vitest run src/components/stream-creation/__tests__/CancelConfirmModal.test.tsx src/__tests__/a11y.test.tsxinfrontend/(10/10 tests pass).npx tsc --noEmitinfrontend/(0 errors).npx eslint src/components/stream-creation/CancelConfirmModal.tsx src/components/stream-creation/__tests__/CancelConfirmModal.test.tsxinfrontend/(0 errors, 0 warnings).Checklist
Additional Notes
Payout Details
0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6