[visual][arena] BUY CHARM disabled state on wrong-chain renders enabled (cascade vs visual mismatch) #194
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:open_issues
agents
agent:security_audit
agent:verify
area
timecurve
arena
arena-v2
audit
block:feature_review
block:security
bug
contracts
design
devops
docs
documentation
enhancement
epic
feature
frontend
indexer
low priority
megaeth
operations
ops
performance
QA
qa checklist
referrals
removal
security
smart-contracts
tech-debt
testing
time-arena
timecurve
visual-qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
code/yieldomega#194
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
During local-stack visual QA (#164 §5 item 4), the BUY CHARM button on Arena renders visually as enabled even when the connected wallet is on the wrong chain. Clicking surfaces the friendly
Wallet or network changed during purchase — please retry from the beginningrevert at submit time — so the contract-level protection works (no rogue tx), but the disabled state is reactive rather than preventative in the UI.Other Arena post-end CTAs (End sale / Redeem charms / Distribute prizes at
TimeCurveArenaView.tsx:1168/1177/1186) properly disable visually onchainMismatch. The BUY CHARM button atTimeCurveArenaView.tsx:861already includeschainMismatchin its disabled-prop cascade (line 866) per source — the gap is purely visual / disabled-state styling.P3 polish — preventative UX consistency, not a security issue.
What is wrong
On
/timecurve/arena, with wallet connected to a chain other than 31337:The mismatch between cascade behaviour (functionally disabled) and visual treatment (looks enabled) breaks the user's mental model.
Expected
BUY CHARM should match the visual disabled treatment used by the other post-end CTAs when
chainMismatch === true:Relevant docs / skills / files
frontend/src/pages/timeCurveArena/TimeCurveArenaView.tsxline 861 (BUY CHARM disabled cascade) — reference visual treatment at lines 1168/1177/1186 (other CTAs)docs/testing/invariants-and-business-logic.md(Arena chain-mismatch surfaces)Recommended fix
Apply the same visual disabled treatment (muted styling + helper title) that End sale uses, gated on the existing
chainMismatchboolean already passed to the BUY CHARM button. No new state needed — the cascade already includeschainMismatch; only the styling layer needs alignment.Acceptance criteria
chainMismatch === trueVerification checklist
mentioned in issue #164
mentioned in commit 299756ca0f0ddb6ca11f8d902bab66accc49cf68
Implemented (merged to
main, commit 299756c)Summary: Arena Buy CHARM now matches preventative wrong-network UX from #95: the arcade CTA is visually muted when
useWalletTargetChainMismatch()is true, exposes the same copy aschainMismatchWriteMessagevia nativetitle, skips Framer hover/tap lift so it does not read as interactable, and the buy-panelChainMismatchWriteBarrieroverlay uses a higher z-index so it stacks above z-indexed panel chrome.disabledcascade andhandleBuypreflights are unchanged (defence in depth).Code / docs:
TimeCurveArenaView.tsx(data-testid="timecurve-arena-buy-charm-cta"),index.css,INV-FRONTEND-194-ARENA-BUY-CHAINindocs/testing/invariants-and-business-logic.md,docs/frontend/timecurve-views.md§194,docs/testing/manual-qa-checklists.md§194,skills/README.md,.cursor/skills/yieldomega-guardrails/SKILL.md(item 29).Tests run:
frontend/npm run typecheck+npm test(Vitest) — all green.Verification checklist (for QA)
VITE_CHAIN_ID(default local 31337):/timecurve/arenaBuy CHARM is dimmed (not the same gold “live lever” as on the correct chain), disabled, and hovering shows wrong-network copy in the native tooltip (title).data-testid="timecurve-arena-buy-charm-cta"is present on that control.main.timecurve-arena-buy-chain-write-gateoverlay still appears and remains clickable above the dimmed panel.@brouie Could you confirm on your stack (per #164 visual QA) that the mental model now matches the post-end CTAs? Leaving this issue open until you sign off.
verified at HEAD 5ad24ba — full pass on all 5 checklist items.
source spot-checks:
.timecurve-simple__cta--arcade.timecurve-simple__cta--wrong-network:disabledat index.css applies the visible disabled treatment (opacity 0.38, grayscale 0.82, reduced box-shadow, text-shadow none) plus z-index 40 on.chain-write-gate__overlayso the #95 barrier stacks above panel chrometimecurve-simple__cta--wrong-networkclass onchainMismatch, nativetitle={chainMismatchWriteMessage(walletChainId)}exposing the same copy as End sale family, framer-motion props skipped ({...(chainMismatch ? {} : primaryButtonMotion)}) so the button does not lift/bounce on hover when mismatched,data-testid="timecurve-arena-buy-charm-cta"addeddisabledcascade andhandleBuypreflights unchanged (defence in depth preserved)tests:
live walk on fresh stack at HEAD (saleActive, swarm running):
Wrong Networkchip, disabled cascade fires, hover surfaces wrong-network copy via native tooltipdata-testid="timecurve-arena-buy-charm-cta"confirmed present in DOMtimecurve-arena-buy-chain-write-gateoverlay confirmed visible and clickable above the dimmed panel on wrong chainready for close on your side @PlasticDigits
mentioned in commit
bd744504d2mentioned in merge request !417