Funding-flow follow-ups from #504 review (non-blocking)
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 28
- Avg merge
- 9h 50m
- Merged PRs (30d)
- 123
Description
Non-blocking findings from @WiktorStarczewski's re-review of #504 (https://github.com/0xMiden/wallet/pull/504), split out so they don't hold the lifecycle work:
- **Swap default pair is race-dependent** — `getSwapTokens()` reorders on native-asset discovery while `SwapManager` seeds `useState(() => getSwapTokens()[0]!)` once at mount → cold start defaults to IMIDEN→IETH, warm start to MIDEN→IMIDEN. Pick defaults by symbol, or reorder only for display.
- **Reduced-motion guard for the two new infinite animations** in `main.css` (hourglass flip + progress runner), and/or move them out of `main.css` per the frontend skill; also answers @0xnullifier's 08-07 nit about animations in `main.css`.
- **`faucetHeroActive` can outlive the faucet card** — gate it on `showFaucetPrompt` so pending-notes isn't suppressed against an unmounted card.
- **Clamp the resume backstop** — `Math.min(FAUCET_FUNDS_ARRIVAL_TIMEOUT_MS, …)` and reject a future `requestedAt` when reading the marker (backward clock step currently wedges the hero).
- **>3-minute mint can be minted twice** — the backstop returns a fully actionable card without completing the prompt; decide whether an "already requested" marker should outlive the backstop.
- **"Funded!" amount re-mixes baseline notes** — the success sub-label totals all pending notes, not just the newly arrived mint.
- **Success-beat tests run on real timers** (3000/3500ms budgets against a 2400ms beat).
- **NIT: abort-forwarding test asserts nothing** — `faucet-api.test.ts` 429-region test structurally equates two non-aborted AbortSignals; assert abort→rejection instead.
- **NIT: 429 back-off sleep ignores the caller's abort** (delays cancellation ≤30s).
- **NIT: marker clear writes `null` instead of removing the key.**
- **NIT: `role="button"` card + real inner buttons** — ARIA exposure of the dismiss X, and focus loss when the hero disables `onClick`; consider `aria-disabled` + retained `tabIndex`.
Contributor guide
Research direction
Look at the funding-flow components and tests mentioned: `getSwapTokens()` and `SwapManager` for the race condition, `main.css` for animations, `faucetHeroActive` and `showFaucetPrompt` logic, and `faucet-api.test.ts` for abort-signal tests. Start by running existing tests to understand the flow, then address each finding in the relevant file. 'Done' means each of the listed issues is fixed without breaking existing functionality.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100