Skip to content

Web NFT/audio follow-ups: mini-player (s2), reliable chain switch (s4), gas sponsorship (s5), popup-blocked (s6) #26

Description

@ehsan6sha

Summary

Web NFT/audio parity items that need focused work (and, for the wallet ones, a live wallet to verify). Tracked separately from the small fixes so they get proper treatment rather than a blind grab-bag. Findings from investigation below.

s2 — Web audio: keep playing when minimized (mini-player)

Today the web audio player is a Dialog.fullscreen that owns a per-dialog WebAudioController disposed on close → closing stops playback. There IS a proven pattern to fix it: the app already mounts WebUploadTray in lib/web/app_web.dart's MaterialApp.router builder Stack (persists across all routes), observing the singleton WebUploadManager. Plan: make WebAudioController a singleton, add a WebMiniAudioPlayer bar mounted in the same Stack, refactor the full-screen player to use the singleton (don't dispose on close), add stopPlayback(), and clear it on sign-out. Moderate, web-only, verifiable by build + live. (~5-6 files.)

s4 — Auto network/chain switching on create + claim NFT

The flow DOES attempt _ensureCorrectChainWalletService.switchChain (wallet_switchEthereumChain) before txs, but failures are swallowed (debugPrint), so a failed switch leaves the user on the wrong chain with no feedback (and possibly needing a wallet that requires wallet_addEthereumChain first). Needs reliable switching + UX feedback — and a live wallet to verify. (lib/web/services/web_nft_service.dart, lib/core/services/wallet_service.dart.)

s5 — Gas sponsorship parity on NFT share link

Native has a "Sponsor gas for receiver" toggle (Base only) → computes a ~300k×gasPrice deposit → passes gasDepositWei to createClaimOffer → relay refunds the claimer's gas (meta_tx_relay_service.dart). Web's createClaimOffer has no such param/UI/calculation. Adding it = UI toggle + gas-price RPC + extend WebNftService.createClaimOffer + relay coordination. Moderate-large; needs a live wallet + relay to verify.

s6 — "Popup blocked" on generate NFT

The wallet-connect modal opens after the mint-config dialog's async gap (gesture lost). NOTE: the config-before-wallet ordering is intentional (// Config BEFORE the wallet (native ordering) in web_nft_detail_screen.dart), so the obvious "connect first" reorder fights a deliberate design and is unverifiable without a wallet. Needs a careful, wallet-tested fix (e.g., open the wallet within the gesture without reordering UX, or a combined flow).

Why deferred

s4/s5/s6 touch wallet/meta-tx flows that can't be verified without a live wallet (high risk to change blind); s2 is a multi-file lifecycle refactor best done focused. Doing these in one rushed batch risked breaking NFT/wallet flows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions