Skip to content

feat: improve Skeleton components with ARIA attributes, children support, and AssetRowSkeleton#72

Open
K1NGD4VID wants to merge 21 commits into
Sorokit:mainfrom
K1NGD4VID:SkeletonCard
Open

feat: improve Skeleton components with ARIA attributes, children support, and AssetRowSkeleton#72
K1NGD4VID wants to merge 21 commits into
Sorokit:mainfrom
K1NGD4VID:SkeletonCard

Conversation

@K1NGD4VID

Copy link
Copy Markdown
Contributor

Summary

This PR improves the Skeleton component family to address three gaps: inaccessible loading states, rigid SkeletonCard layout, and layout shift in BalanceList.

Closes #37.

Changes

1. ARIA attributes for screen readers (WCAG 4.1.3)

  • Skeleton and SkeletonRow — added role="presentation" so screen readers skip placeholder cells
  • SkeletonCard — added role="status", aria-busy="true", and aria-label="Loading content" on the root element so AT announces the loading state

2. SkeletonCard accepts children for custom skeleton layouts

Before: hardcoded rows full-width lines in the body, no way to match actual content structure.
After: when children are provided, they render inside the card body instead of the default rows. Consumers can now pass the exact skeleton layout matching their card content.

The rows prop still works as a fallback when no children are given.

3. AssetRowSkeleton — zero layout shift in BalanceList

Created AssetRowSkeleton in AssetBadge.tsx that matches AssetRow's exact layout:

  • Left: circle icon skeleton (w-8 h-8) + two text lines (code, issuer)
  • Right: amount skeleton (w-16, tabular-nums aligned)

BalanceList now uses AssetRowSkeleton instead of the generic SkeletonRow, eliminating layout shift between loading and loaded states.

Verification

  • npm run lint → 0 errors
  • tsc --noEmit → passes cleanly
  • SkeletonCard defaults remain identical for existing consumers (backward compatible)

… and import ordering

- Set @typescript-eslint/no-explicit-any to error (was off)
- Set @typescript-eslint/no-unused-vars to error with argsIgnorePattern: ^_
- Add eslint-plugin-simple-import-sort for consistent import ordering
- Fix all existing any cast usages across the codebase:
  - TransactionPanel.test.tsx: replace as any with vi.mocked()
  - mock-client.test.ts: replace as any with typed cast via unknown
  - vite.config.ts: remove unnecessary as any
- Fix unused imports in FeeEstimator.test.tsx and QRCode.test.tsx
- Auto-fix import ordering across all 55 source files

Closes Sorokit#36
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@K1NGD4VID 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

K1NGD4VID added 10 commits June 25, 2026 20:05
- Skeleton.tsx: combine SkeletonCard's ARIA attributes with upstream's structure/children props
- BalanceList.tsx: import AssetRowSkeleton from @/components/ui/Skeleton
- AssetBadge.tsx: remove duplicate AssetRowSkeleton (now in Skeleton.tsx)
- Sidebar.tsx: deduplicate imports
- AccountScreen.tsx: deduplicate imports, remove unused User02Icon
- eslint.config.js: combine strict rules with react-hooks plugin
- WalletConnectButton.test.tsx: add mockUseSorokit helper, use vi.mocked()
- WalletScreen.test.tsx: add createMockState helper, use vi.mocked()
- SorobanPanel.test.tsx: cast through unknown instead of any
- QRCode.test.tsx: use proper spy type and unknown cast
- Keep working implementations of components over stubs from upstream
- Combine eslint rules
- Use new adapter architecture in main.tsx
- lib/adapter.ts: replace any with unknown and handle errors safely
- lib/mock-client.ts: remove unused type imports
@k-deejah

Copy link
Copy Markdown
Collaborator

Hi kindly, resolve your conflict

- Fix mock-client.ts to return proper SorokitClient shape with
  wallet, account, transaction, soroban, network sub-objects
- Fix MOCK_ADDRESS to be 56 chars (valid Stellar key format)
- Fix App.tsx to use SorokitProvider + ConnectScreen/Dashboard routing
- Fix App.test.tsx to pass mock client prop
- Fix main.tsx to use mock client adapter
- Fix SorobanScreen.test.tsx for duplicate 'Soroban' text
- Fix TransactionsScreen.test.tsx for duplicate 'Send Payment' text
- Fix utils.test.ts truncateAddress expected value
- Fix SorokitProvider.test.tsx render count (2 -> 3)
- Fix __tests__/mock-client.test.ts for new createMockClient API
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.

fix(Skeleton): SkeletonCard rows don't match card content, no aria-busy on loading, SkeletonRow dimensions mismatch AssetRow

2 participants