Skip to content

feat: Apply amount.ts formatting utilities throughout all components#396

Merged
ogazboiz merged 15 commits into
LabsCrypt:mainfrom
T-kesh:fix/amount-formatting-utilities
May 1, 2026
Merged

feat: Apply amount.ts formatting utilities throughout all components#396
ogazboiz merged 15 commits into
LabsCrypt:mainfrom
T-kesh:fix/amount-formatting-utilities

Conversation

@T-kesh
Copy link
Copy Markdown
Contributor

@T-kesh T-kesh commented Apr 28, 2026

  • Replace manual /1e7 and parseFloat operations with fromStroops(), toStroops(), and formatStreamRate()
  • Add hasValidPrecision() validation to all amount inputs
  • Fix NotificationDropdown.tsx manual formatting and syntax errors
  • Update stream detail page to use proper amount utilities
  • Add precision validation to AmountStep, TopUpModal, StreamCreationWizard
  • Ensure consistent rate display across all stream cards
  • Eliminate precision loss from manual calculations

closes #375

T-kesh added 12 commits April 28, 2026 16:57
- Replace manual /1e7 and parseFloat operations with fromStroops(), toStroops(), and formatStreamRate()
- Add hasValidPrecision() validation to all amount inputs
- Fix NotificationDropdown.tsx manual formatting and syntax errors
- Update stream detail page to use proper amount utilities
- Add precision validation to AmountStep, TopUpModal, StreamCreationWizard
- Ensure consistent rate display across all stream cards
- Eliminate precision loss from manual calculations

Fixes LabsCrypt#375
- Update all imports from @/utils/amount to @/lib/amount
- Fix function calls to use formatAmount instead of fromStroops where appropriate
- Remove duplicate utils/amount.ts file
- Fix duplicate import in dashboard-view.tsx
- Resolves TypeScript compilation errors related to amount formatting
- Fixed NotificationDropdown.tsx conflicts by keeping main branch improvements
- Fixed activity/page.tsx conflicts by keeping main branch pagination structure
- Fixed ActivityHistory.tsx conflicts and updated imports to use consolidated amount utilities
- All amount utility imports now use @/lib/amount consistently
@ogazboiz
Copy link
Copy Markdown
Contributor

hey, main was failing CI from broken auth imports + frontend parse errors. fixed and pushed to main now. please rebase to pick up the fixes:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

if there's a conflict, resolve it locally and we'll review once CI is green.

@T-kesh T-kesh force-pushed the fix/amount-formatting-utilities branch from e622bf6 to 07f187d Compare April 30, 2026 20:37
@ogazboiz
Copy link
Copy Markdown
Contributor

hey, since main now has #444 merged (the cancel stream endpoint), your branch is showing stale modifications to backend/src/controllers/stream/cancel.ts and backend/src/services/sorobanService.ts that overlap with main's current state.

please rebase again to drop those:

git fetch upstream
git rebase upstream/main
# during rebase, when conflicts appear in cancel.ts or sorobanService.ts:
git checkout upstream/main -- backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git add backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git rebase --continue
git push --force-with-lease

after that, your diff should only show the actual feature for this PR and we can merge.

@T-kesh
Copy link
Copy Markdown
Contributor Author

T-kesh commented Apr 30, 2026

hey, since main now has #444 merged (the cancel stream endpoint), your branch is showing stale modifications to backend/src/controllers/stream/cancel.ts and backend/src/services/sorobanService.ts that overlap with main's current state.

please rebase again to drop those:

git fetch upstream
git rebase upstream/main
# during rebase, when conflicts appear in cancel.ts or sorobanService.ts:
git checkout upstream/main -- backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git add backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git rebase --continue
git push --force-with-lease

after that, your diff should only show the actual feature for this PR and we can merge.

Alright then. I'll start working on that

@T-kesh T-kesh force-pushed the fix/amount-formatting-utilities branch from a0d59a0 to cb782a2 Compare April 30, 2026 21:36
@T-kesh
Copy link
Copy Markdown
Contributor Author

T-kesh commented Apr 30, 2026

hey, since main now has #444 merged (the cancel stream endpoint), your branch is showing stale modifications to backend/src/controllers/stream/cancel.ts and backend/src/services/sorobanService.ts that overlap with main's current state.

please rebase again to drop those:

git fetch upstream
git rebase upstream/main
# during rebase, when conflicts appear in cancel.ts or sorobanService.ts:
git checkout upstream/main -- backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git add backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git rebase --continue
git push --force-with-lease

after that, your diff should only show the actual feature for this PR and we can merge.

So I did that and the CI backend issue is back. Awaiting next review

@ogazboiz
Copy link
Copy Markdown
Contributor

ogazboiz commented May 1, 2026

hey, main CI is fully green now. there were several real TypeScript and test issues from #444's merge that have all been fixed. please rebase one more time:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

your PR's diff should be much cleaner after this rebase since main now has the canonical versions of cancel.ts, sorobanService.ts, and the withdraw test.

@T-kesh
Copy link
Copy Markdown
Contributor Author

T-kesh commented May 1, 2026

hey, main CI is fully green now. there were several real TypeScript and test issues from #444's merge that have all been fixed. please rebase one more time:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

your PR's diff should be much cleaner after this rebase since main now has the canonical versions of cancel.ts, sorobanService.ts, and the withdraw test.

Done and all checks are green now. Please kindly review again

Copy link
Copy Markdown
Contributor

@ogazboiz ogazboiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @T-kesh, clean refactor. consolidating to use lib/amount.ts everywhere instead of the duplicated utils/amount.ts, plus adding precision validation on top-up amounts and a cancel button on stream details. all CI green. merging!

if you want to keep contributing or follow up on open issues, join us on Telegram: https://t.me/+DOylgFv1jyJlNzM0

@ogazboiz ogazboiz merged commit 29bc680 into LabsCrypt:main May 1, 2026
9 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.

Apply amount.ts formatting utilities throughout all components

2 participants