Skip to content

fix(ds): two leftovers from the button/input axis renames (TASK-22817) - #3317

Merged
kushagrasarathe merged 1 commit into
devfrom
chore/ds-drift-followups
Sep 22, 2026
Merged

kushagrasarathe merged 1 commit into
devfrom
chore/ds-drift-followups

Conversation

@kushagrasarathe

Copy link
Copy Markdown
Contributor

Follow-up to #3302, which merged before its review fixes were applied. Two leftovers the axis renames left behind.

BaseInput doc page seeded the wrong prop

/dev/ds/primitives/base-input still set defaults={{ variant: 'md' }}. The height axis became size in 7b7b955, but Playground.defaults is typed Record<string, any>, so the typecheck never saw the stale name. The playground opened with no size and an empty select. One word.

CopyField names the exported union

CopyFieldProps.shadowSize hand-wrote '4' | '6' | '8' for a value it forwards straight to Button. 8c786c9 exported ShadowSize for exactly this; the field now names it. The set widens by '3', which Button already accepts, so no call site changes and nothing renders differently.

Scope

A doc-page default and a type alias. No runtime behaviour, no new dependency, no analytics.

Checks

pnpm prettier --check, npm run typecheck and TZ=UTC npm test (719 suites, 9163 tests) are green locally.


A third review item — a restore-only Next build cache on the press-contract job — is not in this PR on purpose. The reason is in the first comment below.

The BaseInput doc page still seeded its playground with `variant: 'md'`.
The prop became `size` in 7b7b955, but `Playground.defaults` is typed
`Record<string, any>`, so the typecheck could not see it. The playground
therefore opened with no size at all and its select started empty.

CopyField still hand-wrote `'4' | '6' | '8'` for the shadow size it
forwards to Button. 8c786c9 exported `ShadowSize` for exactly this, so
the field now names the same union the prop it feeds is typed with. The
set widens by '3', which Button already accepts. No call site changes.
@coderabbitai

coderabbitai Bot commented Sep 22, 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: 8e9b8682-ba88-4da2-82fa-7d1f27612c95

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.

@vercel

vercel Bot commented Sep 22, 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 22, 2026 10:14am UTC

Request Review

@notion-workspace

Copy link
Copy Markdown

@kushagrasarathe

Copy link
Copy Markdown
Contributor Author

Why the press-contract Next cache is not here

The review asked for a restore-only .next/cache step on press-contract, reusing ds-shots' warm entry so the required gate stops paying for a cold ~4 min build. I read the two jobs and did not write it. The key is poisoned for any build that actually uses it.

What ds-shots does. It restores ds-shots-next-v4-… and then builds with SCREEN_CAPTURE_BUILD: '1'. That env is not cosmetic — next.config.js:345 turns it into config.cache = false, which switches webpack's filesystem cache off for that build. So ds-shots restores the entry and then declines to read it. The flag was added on 2026-09-14 ("Use uncached capture builds for design screenshots", aeb70d0) and the key was still bumped v3 → v4 on 2026-09-17 because PRs restoring it crashed in WasmHash._updateWithBuffer ~60s into Build (ui#3227, ui#3232). Twice in five days.

What that means for press-contract. Its build has no SCREEN_CAPTURE_BUILD, so webpack's fs cache is on and it would read the restored entry — the exact configuration that has crashed. Two outcomes, both bad on a job in ci-success.needs:

  1. the restored webpack/ dir holds hashes from another build configuration → TypeError: Cannot read properties of undefined and a red required check on a PR that changed nothing;
  2. it is effectively empty, because the only job that writes the key never populates it → 30-60s of cache download for no build speedup.

Setting SCREEN_CAPTURE_BUILD: '1' on press-contract too would dodge the crash, and also dodge the saving: the webpack cache is the thing that halves the build.

What would actually work, if the cost is worth a follow-up: give press-contract its own key (press-contract-next-v1-…, same hash inputs) with restore on every run and save on push only, matching the ds-shots comment's reasoning. Then the entry is written by a build with the same env as the one that reads it, which is the invariant the shared key breaks. That is a separate change with its own risk, not a 6-line copy, so it wants its own PR and its own week of watching.

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 8705.18 → 8705.18 (0)
Findings: -1 net (+1 new, -2 resolved)

🆕 New findings (1)

  • medium complexity — src/app/(mobile-ui)/dev/ds/primitives/base-input/page.tsx — CC 9, MI 61.27, SLOC 49

✅ Resolved (2)

  • src/app/(mobile-ui)/dev/ds/primitives/base-input/page.tsx — CC 9, MI 61.29, SLOC 49
  • src/components/0_Bruddle/Button.tsx:13 — unused type: ShadowSize

@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

Two type-level leftovers from the axis renames, exactly as described: the base-input playground now seeds the real size prop, and CopyField names Button's exported ShadowSize union instead of hand-writing a subset. Verified Button accepts ShadowSize ('3' | '4' | '6' | '8') and CopyField forwards shadowSize to it unchanged, so the widened union adds only a value Button already renders; no call site passes '3'. No runtime behavior changes, no money/auth surface.

Checked clean

  • Worktree HEAD matches the supplied head SHA 09fc8d6
  • base-input doc page: Playground.defaults now seeds size:'md', matching BaseInputProps.size ('sm'|'md') and the page's select options
  • CopyField: shadowSize forwarded verbatim to Button, which accepts ShadowSize; the union widens by '3' only, which Button's buttonShadows map already covers
  • No call site passes shadowSize='3' to CopyField, so nothing renders differently
  • PR scope: 2 files, 3 insertions, 3 deletions — no runtime, dependency, analytics, or security surface
  • CI at this head: no failing checks caused by the PR (typecheck, eslint, format, ds-lint, human-authors, bot-approval green; several jobs still running)

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 by claude-opus: 0 finding(s), marked with the model name. It answers only product truth, missing tests and the cross-repo contract, so treat its findings as advice.

The usual first reviewer was out of plan, so this review was done by openrouter/z-ai/glm-5.3.

Exact head: 09fc8d6be58d · Context: repo · Took 1m

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • ✅ unit: 9168 ran, 0 failed, 0 skipped, 3.4m

📊 Coverage (unit)

metric %
statements 81.2%
branches 70.0%
functions 76.1%
lines 82.3%
⏱ 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 › 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_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_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 › 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 › 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 › routes the KYC rejection on its wire code, and does not retry it
3.8s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
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`.

@github-actions

Copy link
Copy Markdown
Contributor

🖼 Visual diff — 4 screens moved

7 of 146 shots changed · 139 identical · baseline b194ae8 → head 09fc8d6

worst % screen widths
48.91% early-user 320
43.29% avatar-picker 320, 430
1.52% guest-invite 320, 430
0.30% empty-history 320, 430

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.

@kushagrasarathe
kushagrasarathe merged commit 788c488 into dev Sep 22, 2026
31 of 32 checks passed
@kushagrasarathe
kushagrasarathe deleted the chore/ds-drift-followups branch September 22, 2026 11:23
@github-actions

Copy link
Copy Markdown
Contributor

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

Open screen library dashboard

After merge: 6f687a0 → 788c488. Capture complete in all locales.

This branch was successfully deployed

1 active deployment
Preview — 09fc8d6b Deployed Sep 22, 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