Skip to content

[#1251] Build ActivationFlow.tsx (3-step UI with refresh-resume)#1289

Merged
realproject7 merged 2 commits into
mainfrom
task/1251-activation-flow
May 26, 2026
Merged

[#1251] Build ActivationFlow.tsx (3-step UI with refresh-resume)#1289
realproject7 merged 2 commits into
mainfrom
task/1251-activation-flow

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

Full 3-step activation flow component:

Step 1: SIWE Sign-In

  • Builds EIP-4361 message client-side, signs via wagmi
  • Inbound referral binding (RE1 r25): after sign, reads localStorage.plotlink_ref, POSTs to /register-referral with SIWE auth. Non-blocking: 400/404/409 → clear + continue; 401/500 → keep for retry.

Step 2: X Handle Verification

  • Input field → verify-x-handle → preview card (avatar, display name, followers)
  • "Yes that's me" → confirm-x-handle (server-side re-lookup)

Step 3: Missions

  • X follow (required): opens intent URL, tracks via x-follow-click
  • FC follow (optional): input + verify-fc with all partial-failure paths

Refresh-Resume (R20)

Calls /activation-status on mount, skips completed steps based on confirmed timestamps.

Error States (8 total)

Signature rejected/expired, X not found, X UNIQUE conflict, twitterapi down, FC not found, FC not following, FID conflict, session expired re-sign.

Version

1.35.0 → 1.36.0 (feature)

Closes #1251

🤖 Generated with Claude Code

3-step activation: (1) SIWE sign with inbound referral binding
from localStorage, (2) X handle verify + confirm with preview card,
(3) Missions: X follow (required) + FC follow (optional).

Refresh-resume via /activation-status — skips completed steps on
remount. All 8 error states: signature rejected/expired, X not found,
X UNIQUE conflict, twitterapi down, FC not found/not following/
FID conflict. Progress strip with idle/active/done indicators.

Closes #1251

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored May 26, 2026 9:39am

Request Review

@realproject7 realproject7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@re2 review — APPROVE ✅

Checked against issue #1251 acceptance criteria:

Criterion Status
3 steps work (SIWE → X handle → Missions)
Inbound referral binding after SIWE ✅ localStorage read + register-referral POST
Non-blocking errors: 400/404/409 → clear + continue, 401/500 → keep
Does NOT reuse ReferralInput.tsx ✅ fresh logic
Refresh-resume via activation-status ✅ skips completed steps
All 8 error states implemented ✅ see below
FC step skippable ✅ marked optional
Session expired re-sign ✅ re-sign CTA at bottom of step 3
Version 1.35.0 → 1.36.0 (feature)
Closes #1251 in body

Error states verified (all 8):

  1. Sig rejected → "Signature rejected — please try again." ✅
  2. Sig expired → resets to step 1 with re-sign prompt ✅
  3. X not found → 404 message ✅
  4. X UNIQUE → 409 "already linked to another wallet" ✅
  5. twitterapi down → "Couldn't verify right now" ✅
  6. FC not found → 404 message ✅
  7. FC not following → 422 "don't follow @plotlink yet" ✅
  8. FID conflict → 409 "already linked" ✅

Code review notes:

  • SIWE message built with correct domain/URI/statement/chainId matching server config
  • Signature intentionally not persisted to localStorage — re-sign required after refresh (correct per spec)
  • Referral binding inline in handleSign — non-blocking, correct error status handling per RE1 r27
  • Progress strip with StepIndicator (idle/active/done) visual states
  • X follow opens intent URL + tracks via x-follow-click in parallel
  • FC verify handles all partial-failure paths (404/422/409/502)

No blocking issues found.

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The ActivationFlow implements the broad 3-step shape and referral binding path, but completion does not hand control back to the parent state machine. A user can finish the required mission and still remain on the activation card instead of transitioning to Mining.

Findings

  • [high] Activation completion does not transition the page to Mining.
    • File: src/components/airdrop/ActivationFlow.tsx:211
    • The /api/airdrop/x-follow-click response is the point where the backend can set activated_at, but the client only calls setXFollowed(true) and ignores the response. The parent AirdropStateMachine only reads /api/airdrop/activation-status on mount/address changes, so after a successful activation there is no callback, refetch, or parent state update to make T3.1 leave Pre-activation. This misses #1251 acceptance: “After completion: state transitions to Mining.”
    • Suggestion: plumb an onActivated callback from AirdropStateMachine into ActivationFlow and update the parent activation result when x-follow-click returns activated: true, or otherwise trigger a real activation-status refetch/remount after the required mission succeeds.

Decision

Requesting changes for the missing post-activation transition. CI was still pending at review time.

ActivationFlow calls onActivated when x-follow-click returns
activated: true. Parent AirdropStateMachine updates fetchResult
to trigger state derivation from Pre-activation to Mining.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

The requested activation-completion issue is resolved. ActivationFlow now notifies the parent when x-follow-click returns activated: true, and the parent updates its activation result so the page can transition to Mining immediately.

Findings

  • None blocking.

Decision

Approving PR #1289. The 3-step SIWE/X/missions flow, inbound referral binding behavior, refresh-resume path, post-activation transition, and CI checks now satisfy #1251.

@realproject7 realproject7 merged commit 6f1e6e1 into main May 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[T3.2] Build ActivationFlow.tsx (3-step UI with refresh-resume)

2 participants