frontend-ux

Enforces UX rules for Ethereum dApp frontends covering buttons, approvals, addresses, and theming.

Updated Sep 9, 2026
One-click install
npx skills add https://github.com/m-faran/genie-markets --skill frontend-ux-m-faran
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frontend-ux
Source: https://github.com/m-faran/genie-markets/tree/main/.agent/skills/ethskills/frontend-ux
Command: npx skills add https://github.com/m-faran/genie-markets --skill frontend-ux-m-faran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI-generated Ethereum dApp frontends repeatedly ship the same UX bugs: buttons that allow double-submission, approval flows that re-enable before onchain confirmation, raw base-unit amounts, missing USD context, and unhandled contract revert errors. This Skill provides mandatory patterns that prevent these failures. ## Core Features & Use Cases - Onchain Button States: Per-action pending states with immediate disable, spinner text, and finally-block release so rejected transactions never lock the UI. - Four-State Action Flow: Enforces the Connect Wallet → Switch Network → Approve → Execute sequence, with approval status read from fresh onchain state. - Approval Gap Handling: Combines a submission flag and a post-confirmation cooldown to close the wallet-to-confirmation and confirmation-to-cache windows where double-submits occur. - Address, Amount, and Error Standards: ENS resolution, explorer links, copy support, USD context for token values, viem formatUnits/parseUnits conversions, and human-readable contract error translation. - Use Case: When building a staking or prediction-market frontend (like a USDC wagering dApp), apply these rules so users never see raw wei values, stuck buttons, or cryptic revert selectors. ## Quick Start Apply the frontend-ux rules to review my Ethereum dApp's transaction buttons, approval flow, and amount displays for common UX bugs.

Frequently Asked Questions about frontend-ux

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent double-submission on onchain transaction buttons?▼

Disable the button immediately on click, show a spinner with action text, and keep it disabled until chain state confirms completion. Use a separate loading state per action and always release it in a finally block so rejected transactions do not lock the button permanently.

Why is wagmi isPending not enough for token approval flows?▼

isPending drops to false when the wallet returns the transaction hash, before onchain confirmation, leaving a window where the button re-enables while the allowance has not updated. Combine a submission flag cleared in finally with a post-confirmation cooldown plus refetch to close both gaps.

What is the correct order for connect, network, approve, and execute states?▼

Show one primary action at a time: Connect Wallet, then Switch Network, then Approve, then Execute. The wrong-network check must run before approval checks, and Approve and Execute must never appear simultaneously.

How do I display token amounts correctly in a dApp frontend?▼

Convert contract base units with viem's formatUnits or formatEther before display, and use parseUnits or parseEther for inputs. Always pair token amounts with USD context, such as 0.5 ETH (~$1,250.00), and never show raw values like 1500000000000000000.

How should a dApp handle smart contract revert errors in the UI?▼

Extract errors from the ABI or custom error definitions, map them to human-readable messages, handle wallet-level rejections and gas issues, and render a persistent inline error near the triggering action. Users should never see raw revert selectors or silent failures.

What RPC and polling setup does a production dApp frontend need?▼

Use a dedicated RPC provider rather than relying on public fallbacks, keep polling around 2-5 seconds for interactive apps, and make fallback transports intentional and rate-limit aware. Sustained high request volume usually signals render loops or duplicate watchers in frontend hooks.