Skip to content

feat(escrow,shared,ui): implement multi-sig escrow payout tests, OS-a…#341

Merged
johdanike merged 1 commit into
SwiftChainn:mainfrom
devchant:fix/issue-327-333-328-multisig-theme-commandpalette
Jul 26, 2026
Merged

feat(escrow,shared,ui): implement multi-sig escrow payout tests, OS-a…#341
johdanike merged 1 commit into
SwiftChainn:mainfrom
devchant:fix/issue-327-333-328-multisig-theme-commandpalette

Conversation

@devchant

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR addresses issues #327, #333, and #328 by implementing multi-signature threshold logic tests for the Escrow Payout UI, creating an OS-aware theme provider to eliminate Flash of Unstyled Content (FOUC), and adding interaction tests for the global Command Palette navigation.

The Problem Being Solved

  1. Escrow Payout Multi-Sig: Needed verification that the Escrow Release UI prevents fund release when multi-signature thresholds are incomplete (e.g. 1 of 2 signatures).
  2. OS-Aware Theme Persistence: Needed pre-hydration evaluation of prefers-color-scheme and local storage overrides to eliminate FOUC on page reloads.
  3. Global Command Palette: Needed tests verifying Cmd+K keyboard shortcut toggles and real-time search filtering against backend API delivery records.

Implemented Solution

  • components/escrow/PayoutUI.test.tsx & __tests__/components/escrow/PayoutUI.test.tsx: Added assertions confirming the submit button has the explicit disabled attribute when thresholds are incomplete (1/2, 0/2, 2/3), and enables only when thresholds are met (2/2, 3/3).
  • components/shared/ThemeProvider.tsx: Created ThemeProvider wrapping next-themes and injecting themeService.getThemeScript() prior to React hydration for instant theme application without FOUC.
  • __tests__/components/shared/CommandPalette.test.tsx: Implemented keystroke event simulation (Ctrl+K/Cmd+K, Escape) and query filtering tests against commandPaletteService backend API responses.

Files Changed

  • __tests__/components/escrow/PayoutUI.test.tsx [NEW]
  • components/escrow/__tests__/PayoutUI.test.tsx [MODIFY]
  • components/shared/ThemeProvider.tsx [NEW]
  • components/shared/index.ts [MODIFY]
  • app/providers.tsx [MODIFY]
  • __tests__/components/shared/ThemeProvider.test.tsx [NEW]
  • __tests__/components/shared/CommandPalette.test.tsx [MODIFY]
  • components/ui/__tests__/CommandPalette.test.tsx [MODIFY]

Technical Decisions & Layered Architecture

  • Strictly followed Component ➔ Hook ➔ Service pattern across all features.
  • Data structures are retrieved via service contracts (escrowService, themeService, commandPaletteService).
  • Anti-FOUC implementation runs synchronously prior to DOM paint via head script injection.

Testing Evidence

  • All 6 target test suites (40 tests total) passing:
    • ThemeProvider.test.tsx: 4 passed
    • useTheme.test.ts: 4 passed
    • PayoutUI.test.tsx: 13 passed
    • CommandPalette.test.tsx: 19 passed

Closes #327
Closes #333
Closes #328

…ware theme provider, and command palette navigation tests
@drips-wave

drips-wave Bot commented Jul 26, 2026

Copy link
Copy Markdown

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

@johdanike
johdanike merged commit 2cda11e into SwiftChainn:main Jul 26, 2026
0 of 2 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.

Upgrade: OS-Aware Dark/Light Theme Persistence Test: Global Command Palette Navigation Test: Escrow Payout Multi-Signature Logic

2 participants