Referrals: visible confirmation for copy/share (R6 silent clipboard UX) #86
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#86
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
Share-link clipboard writes on
/referralssucceed, but confirmation can feel silent to users (easy to double-click, thinking nothing happened).Current behavior (
ReferralRegisterSection.tsx): on successfulnavigator.clipboard.writeText, each Copy button swaps label Copy → Copied for 2s. E2E expects this (anvil-referrals.spec.ts).Remaining UX gaps:
copycallback); users get zero feedback.aria-liveor temporaryaria-label).Recommended solution
aria-live="polite"on the button or a sibling region so assistive tech + sighted users get a clearer signal; optionally append “!” (“Copied!”) for scan-ability.clipboard.writeTextis missing or rejects, showStatusMessage/ inline error (“Could not copy — select the link manually”) instead of silent no-op.Acceptance criteria
anvil-referrals.spec.tsupdated if selectors/assertions depend on Copy-only UI; keep register + clipboard happy-path green underbash scripts/e2e-anvil.sh.Docs / files to update
frontend/src/pages/referrals/ReferralRegisterSection.tsx— copy UX + optional error branch.frontend/e2e/anvil-referrals.spec.ts— assertions for new confirmation UI.skills/verify-yo-referrals-surface/SKILL.mdrow R6 — describe expected confirmation (screenshot/recording notes).docs/testing/invariants-and-business-logic.md— referrals / #64 manual row if behavior is now explicitly toast+button.Cross-link: GitLab #64 rows R6.
Sub-issue?
Optional separate sub-issue: “Clipboard fallback + telemetry-free error copy UX” (mobile Safari / non-secure context,
document.execCommand('copy')fallback policy). Flag for maintainer: file as child of this issue only if you want scoped review; otherwise keep in this issue as an acceptance bullet.mentioned in commit
3ace423b81mentioned in commit
4d9706e6fcImplemented on main (merge
4d9706e).Summary:
/referrals“Your share links” copy actions now show a green inline “Copied to clipboard!” banner (~2.6s,aria-live="polite"+role="status"), row buttons use Copy → Copied!, and clipboard missing /writeTextrejection surfacesStatusMessageerrors (manual-select guidance) instead of a silent no-op. Strings + TTL live infrontend/src/pages/referrals/referralShareCopyFeedback.ts. E2E asserts the banner + a second click while Copied! still refreshes confirmation.Docs / cross-links:
docs/testing/invariants-and-business-logic.md(R6 + summary row),docs/product/referrals.md,.cursor/skills/yieldomega-guardrails/SKILL.md,skills/verify-yo-referrals-surface/SKILL.md(R6).@brouie — please verify when you can. Checklist:
navigator.clipboard.writeTextor after denying permission → error text tells you to select the link manually (not silence).Issue left open per request.
mentioned in issue #85
Verified end-to-end on
7b0f37d. All 3 mandatory checklist items pass.Setup
Live local Anvil stack with VITE_REFERRAL_REGISTRY_ADDRESS wired, MetaMask Imported Account 4 (0x90F79bf6...b906) connected after switching from Account 1 mid-session. Registered code 'qatest3' onchain via the page's CL8Y BURN -> REGISTER A CODE flow (1 CL8Y burn confirmed, post-register state showed 'This wallet has a code' + 'Your share links' panel with both row variants populated).
Test 1 — TimeCurve URL row
Clicked Copy on the http://localhost:5173/timecurve/qatest3 row.
PASS:
Test 2 — Second click while still 'Copied!'
While the 'Copied!' state was still visible from Test 1, clicked the same TimeCurve URL Copy button a second time.
PASS:
This matches the dev's spec: 'a second click while Copied! still refreshes confirmation'.
Test 3 — ?ref= URL row
Clicked Copy on the http://localhost:5173/?ref=qatest3 row.
PASS:
Test 4 — clipboard error path
Skipped per dev's '(Optional)' marker. Engineering a navigator.clipboard.writeText rejection in Chrome without a custom test harness isn't trivial; the StatusMessage error path is covered by the e2e suite and source review of frontend/src/pages/referrals/referralShareCopyFeedback.ts shows the rejection branch wired to the same StatusMessage component used elsewhere on the page (so visible-error contract is consistent).
Side observation — incidentally validates #85
The 'Links that count' panel lede on this same /referrals page renders the post-#85 copy: 'Pending referral codes use key yieldomega.ref.v1 in localStorage and sessionStorage; after you register, your share-link code is cached per wallet under yieldomega.myrefcode.v1. plus your lowercased wallet address (localStorage only).' Good cross-link for live #85 validation.
Closing #86.
cc @PlasticDigits
mentioned in issue #93