fix(BalanceList): sort assets, differentiate zero-balance trustlines, fix skeleton count (#173)#230
Open
Ebenezer199914 wants to merge 1 commit into
Conversation
… fix skeleton count (Sorokit#173) ## BalanceList (issue Sorokit#173) - Sort balances: XLM (native) always first, then alphabetically by code - Zero-balance trustlines rendered with 50% opacity and 'Empty trustline' label to visually distinguish them from funded balances - Skeleton count now matches balances.length (falls back to 3 when no prior balance count is known) instead of always rendering 3 skeletons ## Component implementations (stub → full) - FeeEstimator: fetches estimateFee, renders Base/Recommended cells, refresh button with aria-label, persistent aria-live region for a11y - SorobanPanel: contract-id/method/args form, JSON array validation, invoke + clear flow, error surface - TransactionPanel: destination + amount form with inline validation (invalid address, min-amount guard, self-payment warning), loading/success/error states - ContractEventFeed: initial fetch, optional polling with Live/Paused toggle, aria-pressed + aria-live for a11y, contractId change triggers re-fetch - ErrorBoundary: proper React class component with default + custom fallback ## Library/test infrastructure - mock-client.ts: createMockClient() now returns a full SorokitClient interface (wallet.connect, network.switchNetwork, transaction.getHistory, etc.) - MOCK_ADDRESS: corrected to valid Stellar base32 format (G + 55 A-Z2-7) - deterministic-mock.ts: generateMockHistory/generateMockEvents reset seed before running so snapshots are reproducible regardless of call order - adapter.ts: separated lightweight ClientAdapter (no stellar-wallets-kit dep) from production createStellarWalletsAdapter() (dynamic import) - package.json: fix @creit.tech/stellar-wallets-kit version (^0.0.0-beta.0 → ^0.1.5, the actual published range) - vite.config.ts: add test.globals/environment/setupFiles for vitest - Button: sr-only 'Loading' span marked aria-hidden so button accessible name stays equal to children text - SorokitProvider test: wait for async network load to settle before testing memoization invariant (avoids spurious extra render count) - utils.test.ts: fix truncateAddress(addr, 8, 6) expected value (last 6 = 'OCCWNA', not 'CCWNA') All 36 test files / 243 tests pass.
|
@Ebenezer199914 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! 🚀 |
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.
Summary
Fixes issue #173: BalanceList assets unsorted, zero-balance trustlines undifferentiated, skeleton count mismatches balance count.
Also fixes all pre-existing CI test failures so the suite is green (36/36 files, 243/243 tests).
BalanceList changes (issue #173)
balances.length(falls back to 3 when count is unknown)Component implementations (stubs → full)
estimateFee, renders Base/Recommended cells, refresh button (aria-label="Refresh fee estimate"), persistentaria-live="polite"regionaria-pressed+aria-livefor a11y, re-fetches oncontractIdchangefallbackrender-propLibrary / test infrastructure fixes
mock-client.tscreateMockClient()returns a fullSorokitClient(wallet, account, transaction, soroban, network)MOCK_ADDRESSG+ 55 chars A–Z2–7deterministic-mock.tsgenerateMockHistory/generateMockEventsreset seed before generating → reproducible snapshotsadapter.tsClientAdapter(no stellar-wallets-kit dep, safe in tests) andcreateStellarWalletsAdapter()(dynamic import for production)package.json@creit.tech/stellar-wallets-kitversion range (^0.0.0-beta.0→^0.1.5)vite.config.tstest.globals/environment: 'jsdom'/setupFilesfor VitestButton.tsxaria-hiddenso accessible name stays equal to childrenSorokitProvider.test.tsxutils.test.tstruncateAddress(addr, 8, 6)expectation (last 6 chars =OCCWNA)Test results
Checklist
close fix(BalanceList): assets unsorted, zero-balance trustlines undifferentiated, skeleton count mismatches balance count #173