Skip to content

Feat/issues 185 195 84 206#222

Open
caxtonacollins wants to merge 8 commits into
Sorokit:mainfrom
caxtonacollins:feat/issues-185-195-84-206
Open

Feat/issues 185 195 84 206#222
caxtonacollins wants to merge 8 commits into
Sorokit:mainfrom
caxtonacollins:feat/issues-185-195-84-206

Conversation

@caxtonacollins

Copy link
Copy Markdown

Summary

This PR addresses four code quality and test coverage issues in the sorokit-ui component library:

#185: Test Coverage - Button requireConfirm, WalletScreen, and FeeEstimator

  • Button requireConfirm: Added two-click confirmation pattern with customizable labels and timeout
  • WalletScreen: Added tests for passphrase display, QR code generation, and copy functionality
  • FeeEstimator: Implemented full component with XLM conversion (stroops / 10_000_000) and high-fee badge (when recommended > 2× base fee)

#195: SorokitProvider - Loading States & Error Handling

  • Added global isLoading state aggregating isConnecting and isLoadingAccount
  • Fixed Promise.all error handling to keep first non-null error (was overwriting)
  • Ensured refreshAccount updates isLoadingAccount properly

#84: ClaimableBalanceCard - Silent Errors & Stale Fetches

  • Added stale-request guard using cancelled flag to prevent race conditions on address change
  • Improved error handling and state management in balance row component
  • Already had proper error feedback for claim failures

#206: Code Quality

  • Code already follows best practices:
    • Magic numbers properly extracted as named constants (PAGE_SIZE, truncateAddress defaults)
    • No TODO comments (none found in components)
    • All conditional classNames use cn() function correctly

Test Plan

  • Button requireConfirm tests verify: label change, second click fires, timeout resets
  • WalletScreen tests verify: QR code display, passphrase/RPC cells, copy functionality
  • FeeEstimator tests verify: XLM conversion, high-fee badge logic
  • npm run lint passes
  • npm run type-check passes (tsc --noEmit)
  • npm test passes

Closes #185
Closes #195
Closes #84
Closes #206

caxtonacollins and others added 8 commits June 30, 2026 01:14
…labels and timeout

- Add requireConfirm, confirmLabel, and confirmTimeout props to Button component
- First click shows confirmLabel, second click fires onClick
- Timeout resets to original label after configurable delay (default 3s)
- Add comprehensive tests covering all confirmation scenarios
- Includes cleanup for timeout on component unmount

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Implement full FeeEstimator component with fee estimation from client
- Show base fee and recommended fee with XLM conversion (stroops / 10_000_000)
- Display 'High fee' badge when recommended > 2x base fee
- Add live region for accessibility and auto-refresh every 10 seconds
- Add comprehensive tests for XLM conversion and high-fee badge logic

Closes Sorokit#185

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…py functionality

- Add tests for network info cells with copyable passphrase and RPC URL
- Add tests for QR code display when connected and receive funds section
- Add tests for copy button functionality with navigator.clipboard
- Ensure proper UX for connected and disconnected states

Closes Sorokit#185

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add isLoading state that aggregates isConnecting and isLoadingAccount
- Fix Promise.all error handling to keep first non-null error instead of overwriting
- Ensure refreshAccount properly updates isLoadingAccount during refresh
- Add error state reset on new requests

Closes Sorokit#195

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…handling

- Add cancelled flag cleanup to prevent stale balance updates on address change
- Reset error state at the beginning of fetch to clear previous errors
- Ensure cleanup function runs before setting balances to prevent race conditions
- Already had proper error feedback in BalanceRow component

Closes Sorokit#84

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Update to a valid version of the stellar-wallets-kit package that exists in npm registry.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add @testing-library/react and @testing-library/user-event for component testing
- Add @radix-ui/react-slot, @hugeicons/react, clsx, and tailwind-merge for UI
- These dependencies are required by the components and tests

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Use clsx ^1.2.0 instead of ^2.0.0 to match what's available in the dependency tree.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@caxtonacollins 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment