Skip to content

TASK-23054: blocked Home cards can be hidden; no highlight on the next checklist row - #3484

Merged
Hugo0 merged 2 commits into
devfrom
task-23054-hide-blocked-cards
Sep 25, 2026
Merged

Hugo0 merged 2 commits into
devfrom
task-23054-hide-blocked-cards

Conversation

@Hugo0

@Hugo0 Hugo0 commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

TASK-23054. Two follow-ups from Hugo on the Home onboarding (after #3474 and #3481).

Blocked cards can be hidden

The "Verification issue" card (provider rejection: Contact support, and the Add email, Upload document and Verify again variants) and the "We can't verify IDs from this country" card (region refused) could not be dismissed.

  • Both cards get the same tertiary "Hide" LinkButton as the checklist. It sits 24px under the primary button.
  • One code path. useProviderRejection now returns blockedCard: the kind, the reason code and the dismissal key. It follows the precedence the card itself uses: region first, then add email, complete setup, restart, verification issue. HomePage and ActivationCTAs read the same answer.
  • One store. The choice goes in the Home CTA dismissal store that carousel cards and the checklist use (hideHomeCta / readHiddenHomeCtas). useHomeFlow now keeps one hiddenHomeCtas set and one hideCta(id).
  • The key is the card kind plus the reason code: blocked-card:<kind>:<code> (blockedCardCtaId). A new rejection reason, meaning another verdict or code, gives a new key, so the card shows again once.
  • After Hide, Home shows the carousel.
  • PostHog home_blocked_card_hidden sends { card_kind, reason_code }.
  • The fix or support route stays reachable at Profile → Accounts (/profile/accounts, the "Accounts" row on Profile, MoneySettings). Tapping the locked region there opens the provider-rejection modal with the same routes: Upload document, Verify again, or Contact support. A region-refused user gets KycRegionRestrictedModal there.

No highlight on the next checklist row

Hugo: the pink outline on the next row is against the design system. Every row now has only the ListGroup/ListItem border. The next step shows by its order and its chevron. The outline class and its tests are removed. design/design.md has no rule that allowed the outline, so it needs no change.

Screens (375×667, local dev with the existing fixtures)

Sheet in mono: local/scratch/home-viz/blocked-cards-before-after.jpg (columns: before, after, after Hide). The rows are:

  • the provider rejection,
  • the region refusal,
  • a funded checklist (the outline is gone).

All 20 states, with full-size shots, the stuck-states table and the copy table, are in local/scratch/home-viz/onboarding.html.

Tests

  • ActivationCTAs.test.tsx: the region card hides under blocked-card:region-restricted:identity_region_restricted, and the event carries the kind and code. The verification-issue card hides under its rail reason code. The checklist has no blocked-card Hide.
  • HomePage.test.tsx: a hidden blocked card hands over to the carousel. A card hidden under an older reason code shows again.
  • GettingStartedChecklist.test.tsx: every row has the same border, with no highlight on the next step.
  • Local: prettier, tsc and the affected Jest suites are green.

…t checklist row

Hugo: the region and provider-rejection cards could not be dismissed. They
now take the same tertiary Hide as the checklist, stored in the one Home CTA
dismissal store and keyed by card kind plus reason code, so a new reason
shows the card again once. Hiding hands over to the carousel; the fix or
support route stays in Profile > Accounts. And the pink outline on the next
checklist row is gone: every row has the same ListItem border.
@notion-workspace

Copy link
Copy Markdown

1 similar comment
@notion-workspace

Copy link
Copy Markdown

@vercel

vercel Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Sep 25, 2026 6:06pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: peanutprotocol/peanut-ui/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 03672aac-de12-447f-8491-857288b18d42

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 8967.43 → 8969.24 (+1.81)
Findings: +1 net (+33 new, -32 resolved)

🆕 New findings (33)

  • critical complexity — src/hooks/useHomeCarouselCTAs.tsx — CC 54, MI 58.79, SLOC 278
  • high hotspot — src/constants/analytics.consts.ts — 85 commits, +440/-85 lines since 6 months ago
  • high hotspot — src/components/Home/ActivationCTAs.tsx — 70 commits, +1064/-808 lines since 6 months ago
  • high hotspot — src/hooks/useHomeCarouselCTAs.tsx — 53 commits, +575/-444 lines since 6 months ago
  • high complexity — src/components/Home/ActivationCTAs.tsx — CC 40, MI 50.85, SLOC 170
  • high complexity — src/hooks/useProviderRejection.ts — CC 37, MI 61.11, SLOC 126
  • high complexity — src/components/Send/views/SendRouter.view.tsx — CC 35, MI 58.59, SLOC 147
  • high complexity — src/components/Home/GettingStartedChecklist.tsx — CC 33, MI 58.95, SLOC 149
  • high complexity — src/constants/analytics.consts.ts — CC 1, MI 30.11, SLOC 220
  • medium high-mdd — src/hooks/useHomeCarouselCTAs.tsx:54 — useHomeCarouselCTAs: MDD 144.9 (uses across many lines from declarations)
  • medium high-mdd — src/hooks/useHomeCarouselCTAs.tsx:107 — : MDD 97.8 (uses across many lines from declarations)
  • medium high-mdd — src/components/Home/ActivationCTAs.tsx:50 — ActivationCTAs: MDD 84.4 (uses across many lines from declarations)
  • medium high-mdd — src/components/Send/views/SendRouter.view.tsx:38 — SendRouterView: MDD 65.1 (uses across many lines from declarations)
  • medium high-dlt — src/hooks/useHomeCarouselCTAs.tsx:54 — useHomeCarouselCTAs: DLT 51 (calls 51 distinct functions — high context load)
  • medium high-mdd — src/components/Home/GettingStartedChecklist.tsx:82 — GettingStartedChecklist: MDD 46.7 (uses across many lines from declarations)
  • medium high-mdd — src/features/home/HomePage.tsx:36 — HomePage: MDD 29.0 (uses across many lines from declarations)
  • medium method-complexity — src/hooks/useHomeCarouselCTAs.tsx:107 — CC 25 SLOC 144
  • medium complexity — src/utils/home-carousel.utils.ts — CC 21, MI 65.98, SLOC 56
  • medium complexity — src/features/home/useHomeFlow.ts — CC 11, MI 63.44, SLOC 80
  • medium complexity — src/features/home/HomePage.tsx — CC 7, MI 55.09, SLOC 35

…and 13 more.

✅ Resolved (32)

  • src/hooks/useHomeCarouselCTAs.tsx — CC 56, MI 58.96, SLOC 273
  • src/constants/analytics.consts.ts — 84 commits, +439/-85 lines since 6 months ago
  • src/components/Home/ActivationCTAs.tsx — 69 commits, +1041/-807 lines since 6 months ago
  • src/hooks/useHomeCarouselCTAs.tsx — 52 commits, +571/-441 lines since 6 months ago
  • src/components/Home/ActivationCTAs.tsx — CC 37, MI 49.97, SLOC 161
  • src/components/Home/GettingStartedChecklist.tsx — CC 37, MI 59.31, SLOC 153
  • src/components/Send/views/SendRouter.view.tsx — CC 35, MI 58.67, SLOC 146
  • src/hooks/useProviderRejection.ts — CC 30, MI 62.62, SLOC 96
  • src/constants/analytics.consts.ts — CC 1, MI 30.16, SLOC 219
  • src/hooks/useHomeCarouselCTAs.tsx:54 — useHomeCarouselCTAs: MDD 145.4 (uses across many lines from declarations)
  • src/hooks/useHomeCarouselCTAs.tsx:107 — : MDD 98.2 (uses across many lines from declarations)
  • src/components/Home/ActivationCTAs.tsx:47 — ActivationCTAs: MDD 81.1 (uses across many lines from declarations)
  • src/components/Send/views/SendRouter.view.tsx:38 — SendRouterView: MDD 63.2 (uses across many lines from declarations)
  • src/hooks/useHomeCarouselCTAs.tsx:54 — useHomeCarouselCTAs: DLT 50 (calls 50 distinct functions — high context load)
  • src/components/Home/GettingStartedChecklist.tsx:82 — GettingStartedChecklist: MDD 47.7 (uses across many lines from declarations)
  • src/features/home/HomePage.tsx:36 — HomePage: MDD 26.7 (uses across many lines from declarations)
  • src/hooks/useHomeCarouselCTAs.tsx:107 — CC 27 SLOC 139
  • src/utils/home-carousel.utils.ts — CC 15, MI 64.89, SLOC 51
  • src/features/home/useHomeFlow.ts — CC 9, MI 62.7, SLOC 68
  • src/features/home/HomePage.tsx — CC 7, MI 56.35, SLOC 32

…and 12 more.

📈 Painscore deltas (top movers)

File Before After Δ
src/hooks/useProviderRejection.ts 5.7 6.3 +0.6
src/features/home/HomePage.tsx 9.1 9.8 +0.6

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • ✅ unit: 10289 ran, 0 failed, 0 skipped, 2.4m

📊 Coverage (unit)

metric %
statements 82.5%
branches 72.3%
functions 77.3%
lines 83.7%
⏱ 10 slowest test cases
time test
🐢 9.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Network failure keeps loading while retries remain, then shows the generic error
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › User KYC not approved fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_SOURCE_OVER_MONTHLY_CAP fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_RECENT_REFUND fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_MERCHANT_VOLUME_NEAR_CAP fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › MANTECA_USER_NOT_PROVISIONED fails fast with copy that names the real cause
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › routes the KYC rejection on its wire code, and does not retry it
4.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › a refused idempotency key tells the user to scan again, not to contact support
3.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Going offline blames the connection, and reconnecting clears it for the recovered scan
3.0s src/app/(mobile-ui)/qr-pay/__tests__/qr-pay-states.test.tsx › Scan that recovers on the retry lands on the payment screen, not an error
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Chip review — no blocking findings — this is not an approval

One non-blocking Home carousel regression after dismissing a terminal verification card.

Findings

  • MAJOR · src/features/home/HomePage.tsx:62 · Hiding a terminal card exposes an impossible verification prompt
    For a region-restricted user with no enabled or pending rail and card eligibility false, Hide makes showCarousel true. useHomeCarouselCTAs then offers kyc-prompt (“Unlock QR code payments”) because it does not exclude isRegionRestricted; its tap routes to /profile/accounts, which correctly shows the terminal region refusal rather than a verification path. A terminal provider rejection can take the same path. Filter the verification prompt for these blocked states when handing over to the carousel, while keeping other carousel cards available.

Checked clean

  • Exact head and merge base confirmed; reviewed Home card selection, dismissal persistence, carousel gates, identity status, and Accounts fallback.
  • Security/privacy pass: new event sends a reason code to PostHog; dedicated review requested. No other security defect confirmed.
  • Head CI: unit, typecheck, native-export, format, eslint, and backdoor-scan succeeded; press-contract, ds-shots, and preview checks were still running at last read.

Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.

Third opinion: did not run — claude-api_error. This review is one reviewer short.

Exact head: f47fd7b5a8b5 · Context: repo · Took 8m

Comment thread src/features/home/HomePage.tsx
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

English · Español · Español (Argentina) · Português (Brasil)

Open screen library dashboard

After merge: 477ae05 → 6bfe451. Capture complete in all locales.

@github-actions

Copy link
Copy Markdown
Contributor

🖼 Visual diff — 28 screens moved

48 of 212 shots changed · 164 identical · baseline 3f10b4a → head f47fd7b

worst % screen widths
41.29% avatar-picker 320
2.96% setup-pending 430
1.71% home-provider-rejection 320, 430
1.67% home-region-restricted 320, 430
0.79% empty-home 320, 430
0.79% home-money-before-verify 320, 430
0.79% home-new-user 320, 430
0.47% home-qr-blocked-unfunded 320, 430
0.47% home-verified-unfunded-no-card 320, 430
0.47% home-verified-unfunded 320, 430
0.47% home-verify-processing-long 320, 430
0.47% home-verify-processing 320, 430
0.47% card-access 320, 430
0.47% early-user 320, 430
0.47% home-avatar 320, 430
0.47% home-card-application-pending 320, 430
0.47% home-collateral-only 320, 430
0.47% home-funded-qr 320, 430
0.47% home-funded 320, 430
0.47% home-money-in-out-only 320, 430
…and 8 more

job summary · before/after/diff images — artifact

Fixture screenshots, no backend. Advisory — this check never blocks a merge. Posted from the default branch by ds-shots-comment.yml; the report it renders is untrusted data.

Chip: a region-refused user who hides the region card lands on the carousel,
which then asked them to 'Unlock QR code payments' through an ID check that
can never pass. The slide now reads the same gate as the QR slide and the
QR pay page: never for a refused region or a blocked provider.

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Chip review — no blocking findings — this is not an approval

P1 is fixed at this head; no actionable findings.

Checked clean

  • P1 fixed: the Home verify slide now reads the QR-pay gate and is suppressed for region refusal and blocked provider states, while remaining available when identity verification can open QR pay.
  • Reviewed the full Home card-to-carousel flow, persistence key, Accounts fallback, checklist styling, and new helper/test coverage against the exact head and merge base.
  • Head CI: typecheck, eslint, format, screen tests, and backdoor scan succeeded; unit, press-contract, visual, and preview jobs were still running at last read.

Security review by moonshotai/kimi-k3: 0 finding(s), marked with the model name. It reads the diff only and answers only security, privacy and money, so treat its findings as advice.

Third opinion: did not run — it reads only the first review of a pull request; the first reviewer checks later rounds. This review is one reviewer short.

Exact head: 22e00c0d147d · Context: repo · Took 6m

@Hugo0
Hugo0 merged commit 6bfe451 into dev Sep 25, 2026
36 of 38 checks passed

This branch was successfully deployed

1 active deployment
Preview — 22e00c0d Deployed Sep 25, 2026 by vercel[bot]
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.

1 participant