Skip to content

TASK-23054 drawer CTAs keep their bottom shadow; gate the class in CI - #3487

Merged
Hugo0 merged 3 commits into
devfrom
fix/TASK-23054-cta-shadow-clip
Sep 25, 2026
Merged

Hugo0 merged 3 commits into
devfrom
fix/TASK-23054-cta-shadow-clip

Conversation

@Hugo0

@Hugo0 Hugo0 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Bug (staging QA): in the Accounts page's "Residence required" drawer, the bottom of the "Update residence" CTA's offset shadow was cut off flat. The "Verify identity first" drawer on Add money had the same cut.

Root cause: since #3459 removed the caption under the CTA, the CTA ends the drawer content. DrawerContent's scroll box is overflow-auto, so it clips at its own bottom edge. The panel's pb-4 (ClosedRowDrawer, CorridorGateDrawer) is outside that box and never protected the shadow. #3019 fixed the same problem for the left and right edges only.

Fix, once, in Global/Drawer:

  • The scroll box gets an 8px ::after block (the deepest button shadow, shadowSize="8") inside the clip box. It is a pseudo-element, so a caller's scrollAreaClassName="pb-*" cannot remove it (KycStatusDrawer passes pb-12).
  • Its wrapper gets -mb-2, which gives the 8px back. No drawer changes height or spacing. The only visible difference: a drawer already at its max-h-[80vh] cap sits 8px lower, and its content ends in the same place.
  • pb-safe-bottom stays on the scroll box below the reserve, so the native inset still applies.

Guard:

  • e2e/utils/shadow-clip.ts: the DS showcase's detector, moved out of ds-shadow-clip.spec.ts so both specs share it. It also takes an optional scope (open dialog only) and viewportClips.
  • e2e/flows/drawer-shadow-clip.spec.ts checks 87 cases at 375x667. It covers every renderable /dev/surfaces surface, the three home drawers, and the account drawers that open from a tap (closed row ARS on Accounts and on Add money, unlock BRL/USD, and the EUR corridor gate). It scrolls each dialog to the end, then fails when a button's shadow sits outside its nearest clipping ancestor or off screen.
  • The spec runs in the required press-contract job, so a clipped CTA shadow fails ci-success. The job timeout goes from 20 to 25 min. This changes .github/workflows/tests.yml, so the backdoor guard check stays red until someone other than the author reads that file.
  • A jest contract test on DrawerContent checks the reserve.

Verified locally (preview build, next start):

  • Before the fix, the sweep flagged "Update residence" on both routes (4.0px clipped). After the fix, all 87 drawer cases and the 2 DS showcase cases pass. The spec also passed in CI (87 in 1.4 min).
  • With the fix reverted in the page, the detector flags both the closed-row and corridor-gate CTAs.
  • A one-off sweep of all 106 fixture pages found no other clipped shadow.
  • prettier --check, tsc --noEmit and jest --runInBand (772 suites) pass.

Staging QA: the "Update residence" CTA in the Accounts page's "Residence
required" drawer had its offset shadow cut flat at the bottom. Since ui#3459
removed the caption under it, the CTA ends the drawer content, and the
DrawerContent scroll box (overflow-auto) clipped at its own bottom edge. The
panel's pb-4 sits outside that box, so it never helped. CorridorGateDrawer on
Add money had the same cut.

The fix is once, in DrawerContent: an 8px ::after block (the deepest button
shadow) inside the scroll box, given back by -mb-2 on its wrapper so no
sheet changes height or spacing. A pseudo-element, so a caller's
scrollAreaClassName pb-* cannot drop it; pb-safe-bottom still applies below.

Guard: the DS showcase's shadow-clip detector moves to e2e/utils and a new
spec runs it over every /dev/surfaces surface, the home drawers and the
tap-opened account drawers at 375x667. It runs in press-contract, so a
clipped CTA shadow now fails ci-success instead of reaching QA.
@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:23pm UTC

Request Review

@notion-workspace

Copy link
Copy Markdown

@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: 7f56f714-ce47-435e-bd04-68487790b1d7

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

Copy link
Copy Markdown
Contributor

⚠️ This PR changes CI workflows or the backdoor scan itself

The scan in tests.yml runs this PR's own workflow, so a change here could switch it off. This check stays red until the change is merged. Someone other than the author must read these files before anyone runs the branch:

  • .github/workflows/tests.yml

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 8968.88 → 8968.56 (-0.32)
Findings: +1 net (+15 new, -14 resolved)

🆕 New findings (15)

  • critical complexity — src/lib/content.ts — CC 107, MI 57.9, SLOC 397
  • medium complexity — src/app/[locale]/(marketing)/help/[slug]/page.tsx — CC 13, MI 58.46, SLOC 68
  • low structural-dup — app/[locale]/(marketing)/[country]/page.tsx:72 — 17 duplicate lines / 60 tokens with app/[locale]/(marketing)/help/[slug]/page.tsx:74
  • low high-mdd — src/components/Global/Drawer/index.tsx:100 — : MDD 17.0 (uses across many lines from declarations)
  • low high-mdd — src/app/[locale]/(marketing)/help/[slug]/page.tsx:55 — HelpArticlePage: MDD 11.1 (uses across many lines from declarations)
  • low high-mdd — src/lib/content.ts:518 — listAllContent: MDD 11.1 (uses across many lines from declarations)
  • low structural-dup — lib/content.ts:382 — 10 duplicate lines / 50 tokens with lib/content.ts:395
  • low structural-dup — app/[locale]/(marketing)/help/[slug]/page.tsx:26 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/stories/[slug]/page.tsx:24
  • low structural-dup — app/[locale]/(marketing)/help/[slug]/page.tsx:26 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/use-cases/[slug]/page.tsx:23
  • low structural-dup — app/[locale]/(marketing)/help/[slug]/page.tsx:26 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/withdraw/[slug]/page.tsx:23
  • low structural-dup — app/[locale]/(marketing)/card-esign/page.tsx:57 — 7 duplicate lines / 51 tokens with app/[locale]/(marketing)/help/[slug]/page.tsx:59
  • low missing-return-type — src/app/[locale]/(marketing)/help/[slug]/page.tsx:25 — generateStaticParams: exported fn missing return type annotation
  • low missing-return-type — src/app/[locale]/(marketing)/help/[slug]/page.tsx:55 — HelpArticlePage: exported fn missing return type annotation
  • low unused-export — src/components/Global/Drawer/index.tsx:210 — unused export: DrawerFooter
  • low unused-export — src/lib/content.ts:413 — unused export: isPublished

✅ Resolved (14)

  • src/lib/content.ts — CC 108, MI 58.11, SLOC 400
  • src/app/[locale]/(marketing)/help/[slug]/page.tsx — CC 13, MI 58.44, SLOC 68
  • app/[locale]/(marketing)/[country]/page.tsx:72 — 17 duplicate lines / 60 tokens with app/[locale]/(marketing)/help/[slug]/page.tsx:80
  • src/components/Global/Drawer/index.tsx:100 — : MDD 13.3 (uses across many lines from declarations)
  • src/app/[locale]/(marketing)/help/[slug]/page.tsx:61 — HelpArticlePage: MDD 11.1 (uses across many lines from declarations)
  • src/lib/content.ts:527 — listAllContent: MDD 11.1 (uses across many lines from declarations)
  • lib/content.ts:391 — 10 duplicate lines / 50 tokens with lib/content.ts:404
  • app/[locale]/(marketing)/help/[slug]/page.tsx:32 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/stories/[slug]/page.tsx:24
  • app/[locale]/(marketing)/help/[slug]/page.tsx:32 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/use-cases/[slug]/page.tsx:23
  • app/[locale]/(marketing)/help/[slug]/page.tsx:32 — 9 duplicate lines / 64 tokens with app/[locale]/(marketing)/withdraw/[slug]/page.tsx:23
  • src/app/[locale]/(marketing)/help/[slug]/page.tsx:31 — generateStaticParams: exported fn missing return type annotation
  • src/app/[locale]/(marketing)/help/[slug]/page.tsx:61 — HelpArticlePage: exported fn missing return type annotation
  • src/components/Global/Drawer/index.tsx:199 — unused export: DrawerFooter
  • src/lib/content.ts:422 — unused export: isPublished

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • ✅ unit: 10291 ran, 0 failed, 0 skipped, 3.8m

📊 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.1s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
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_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 › a refused idempotency key tells the user to scan again, not to contact support
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_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
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`.

The workflow change trips the backdoor guard, which waits for a non-author
read. The fix and its spec land tonight; the gate follows in a separate PR.

@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

No actionable findings in the drawer shadow reserve or its browser sweep.

Checked clean

  • Reviewed the exact merge-base patch and shared DrawerContent behavior, including panel padding, capped scroll height, safe-area padding, and caller scroll classes.
  • Reviewed shadow detector extraction and new drawer/fixture cases; the new sweep is advisory at this head, with required CI wiring explicitly deferred to a separate PR.
  • Exact-head available checks included successful guard and backdoor scan; capture and preview checks were still running when reviewed. No full unit or browser-suite conclusion was available.

Security review: did not run — this change has no security, privacy or money surface, so it was not asked. This review is one reviewer short.

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

Exact head: c6aefa1b9746 · Context: repo · Took 6m

Hugo's call: land the fix and its gate together rather than split them. A
clipped CTA shadow shows only in real layout and has shipped twice.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR changes CI workflows or the backdoor scan itself

The scan in tests.yml runs this PR's own workflow, so a change here could switch it off. This check stays red until the change is merged. Someone other than the author must read these files before anyone runs the branch:

  • .github/workflows/tests.yml

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR changes CI workflows or the backdoor scan itself

The scan in tests.yml runs this PR's own workflow, so a change here could switch it off. This check stays red until the change is merged. Someone other than the author must read these files before anyone runs the branch:

  • .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

No actionable findings in the drawer shadow fix or its required CI gate.

Checked clean

  • Re-reviewed the exact-head merge-base patch and the new workflow delta: press-contract runs both Playwright specs sequentially, and ci-success already requires press-contract.
  • Checked the exact-head guard log: the backdoor scan was clean; guard fails intentionally because the PR changes a guarded workflow file.
  • Required build, unit, and press-contract checks had not completed at review time; their outcomes remain unverified.

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: bd1ee1d19eb4 · Context: repo · Took 6m

@Hugo0
Hugo0 merged commit ebdfc5a into dev Sep 25, 2026
35 of 39 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

Open screen library dashboard

After merge: 37ff433 → ebdfc5a. Capture complete in all locales.

This branch was successfully deployed

1 active deployment
Preview — bd1ee1d1 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