Summary
Mutations on the swap interface wait for the server before the UI reflects them, which feels sluggish and hides intent. Apply changes optimistically and roll back cleanly on failure.
Why this matters
Optimistic updates make the app feel instant while preserving correctness. Done right (with rollback + reconciliation), they improve UX without lying to the user.
Requirements
- Apply swap interface mutations to local state immediately, before the server responds.
- On success, reconcile with the server's canonical result.
- On error, roll back to the pre-mutation state and surface a clear, accessible message.
- Guard against a stale response overwriting a newer local change.
Technical guidance
- Key the optimistic entry so the server echo can replace it deterministically.
- Announce failures via a polite live region.
Edge cases — each must have a test
Acceptance criteria
Out of scope
- Server-side conflict merging
- Offline queueing
Rewards
Part of the GrantFox OSS / Official Campaign (FWC26) — this task may be rewarded. PR quality is assessed by AI: depth, correctness under edge cases, meaningful tests, and clean design are what earn the reward. Shallow changes (typos, formatting, trivial docs) do not qualify.
Summary
Mutations on the swap interface wait for the server before the UI reflects them, which feels sluggish and hides intent. Apply changes optimistically and roll back cleanly on failure.
Why this matters
Optimistic updates make the app feel instant while preserving correctness. Done right (with rollback + reconciliation), they improve UX without lying to the user.
Requirements
Technical guidance
Edge cases — each must have a test
Acceptance criteria
npm run lint,npm test, andnpm run buildall pass locallyCloses #<issue>Out of scope
Rewards
Part of the GrantFox OSS / Official Campaign (FWC26) — this task may be rewarded. PR quality is assessed by AI: depth, correctness under edge cases, meaningful tests, and clean design are what earn the reward. Shallow changes (typos, formatting, trivial docs) do not qualify.