Skip to content

style: tokenize rawHex remainders + FAQs type migration (DS KR1 ratchet) - #2953

Open
kushagrasarathe wants to merge 10 commits into
devfrom
ds/rawhex-token-pass
Open

style: tokenize rawHex remainders + FAQs type migration (DS KR1 ratchet)#2953
kushagrasarathe wants to merge 10 commits into
devfrom
ds/rawhex-token-pass

Conversation

@kushagrasarathe

@kushagrasarathe kushagrasarathe commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

DS cleanup pass ruled by Kush after reviewing the exact rawHex remainders post-#2946 (KR1 metrics of scripts/ds-lint-counts.mjs). Tokenizes every fixable raw hex, migrates the FAQs panel to the DS type ramp, rewords 4 comments the rawHex regex false-positives on, and ratchets the lint baseline down.

Task: TASK-21446 (DS 02 — lint count baselines / KR1 ratchet)

Changes

Comment false positives (no behavior change)

  • qr-pay/page.tsx #920 -> "PR 920", app/page.tsx #418 -> "error 418", not-found.tsx #310 -> "error 310", 0_Bruddle/Card.tsx quoted #161616 -> "near-black border-default"

Inline SVG fills -> tokens

  • Global/OfflineScreen: mascot yellow -> var(--color-action-secondary); banner #F9F4F0 -> var(--color-background-page) (drift fix, see below)
  • Global/BackendErrorScreen: mascot yellow -> var(--color-action-secondary)

Dynamic color logic -> css vars (all consumers land in CSS style props, verified)

  • AddWithdraw/AddWithdrawCountriesList x2, Global/Contributors/ContributorCard (bg + textColor), Global/PeanutActionDetailsCard (#29CC6A -> --color-background-icon-bubble-green, #FFC900 -> --color-background-icon-bubble-yellow), User/UserCard (#FFD700 -> yellow token, see below)

One-offs

  • rewards/page.tsx: InvitesGraph backgroundColor -> var(--color-background-default) — force-graph applies the prop as canvas.style.background, so a css var resolves
  • AddMoney/views/CryptoDeposit.view + Card/CardRejectionScreen: offset-shadow hex -> var(--color-shadow-primary) inside the arbitrary class (kept arbitrary: 0.12rem has no DS utility; shadow-4 would add a dark: variant the capture asset never had)
  • Claim/Generic/Claimed.view: bg-[#FFCC00] -> bg-background-icon-bubble-yellow (drift fix)
  • Global/FAQs: bg-[#F9F4F0] -> bg-background-page (drift fix)

FAQ type migration (Global/FAQs — used by MerchantLandingPage, Marketing/mdx FAQ, LandingPage/faq)

  • learn-more link text-base/md:text-lg -> text-body-m/md:text-body-l
  • question summary text-lg font-extraBlack md:text-xl -> text-heading-card md:text-heading-xs (tokens carry weight; stacked weights are banned, so extraBlack 1000 becomes 700/800)
  • + glyph text-3xl -> text-heading-m
  • answers text-lg leading-6 font-semibold md:text-xl -> text-body-l (no 20px body step in the ramp — answers settle at 18px regular at all widths)
  • CardPinScreen digits: text-6xl leading-none font-extrabold -> text-heading-xl (Kush-approved follow-up; three-way comparison in the keep-or-revert section below). Plus a card-pin fixture so ds-shots covers the PIN screen (masked state) per PR

Metrics (node scripts/ds-lint-counts.mjs)

metric before after
rawHex 27 8
rawHexFiles 20 5
stockTextSize 8 0
nonDsClassesInViews 16 15

Baseline rebased downward (scripts/ds-lint-baseline.json); all other ratchet metrics unchanged, --check green.

Remaining rawHex (all ruled leave-alone): (setup)/layout.tsx Capacitor StatusBar literal, Global/Icons/Icon.tsx:181 var fallback, Global/Icons/{invite-heart,bulb} icon artwork, Global/ConsoleGreeting console.log styling.

PIN size: keep or revert? (three-way)

CardPinScreen digits moved off the last stock text size. Two ramp candidates were tried — the branch currently ships heading-xl; say the word to switch back to big-input or revert to the original.

variant font / weight / line note
original text-6xl leading-none font-extrabold 48px / 800 / 48px this repo overrides text-6xl to 3rem/3.25rem — not the stock 60px
text-heading-big-input 52px / 700 / 64px matches the h-[52px] skeleton height exactly
text-heading-xl (current) 42px / 800 / 48px keeps the original's weight; smaller than the skeleton — if this is the pick, decide whether the h-[52px] skeleton/wrapper should follow the 48px line box (left untouched here, not resized silently)

Row geometry is held by the fixed h-[52px] wrapper in all three (the eye button does not move). Mock data only — captured on a local throwaway route (not committed) that patches rainApi.getCardPin to return 1234, over the card-pin fixture (fake card, last4 4242). 375x667.

original (48px/800) big-input (52px/700) heading-xl (42px/800) — current
original revealed big-input revealed heading-xl revealed
original masked big-input masked heading-xl masked

The pr-assets-2953 branch is deleted after merge.

Visual changes — review these

Five deliberate visible shifts (the rest is value-identical tokenization) — the PIN change above, plus:

  1. UserCard wallet avatar: gold -> yellow. #FFD700 has no token; snapped to #FFC900. Veto point — say the word and it reverts.
  2. Claimed.view icon circle: #FFCC00 -> #FFC900 (subtle).
  3. OfflineScreen banner + FAQs section bg: near-miss #F9F4F0 -> token #FAF4F0 (imperceptible).
  4. FAQs typography: question weight extraBlack(1000) -> heading tokens (700/800); answers 20px semibold at md -> 18px regular. Largest visual delta of the PR; inherent to the type-ramp migration.

ds-shots CI diff: the drift fixes SHOULD produce small diffs on fixture-covered screens; anything else diffing is a bug.

Risks / breaking changes

  • None cross-repo; FE-only, no logic changes. Colors now resolve via CSS vars — verified every consumer is a CSS style prop (AvatarWithBadge style/textColor, force-graph canvas.style.background), not canvas ctx.
  • Comment-only and token-value-identical changes carry zero runtime risk.

QA

  • pnpm prettier --check . clean, npm run typecheck clean, npm test 438 suites / 5603 tests green
  • node scripts/ds-lint-counts.mjs --check green (no metric increased)

Design notes / accepted trade-offs

  • Yellow avatar/icon-circle backgrounds use --color-background-icon-bubble-yellow (the semantic role token, same value as action-secondary); SVG mascot artwork uses --color-action-secondary.
  • Smell pass: adds none. Reveals pre-existing duplication — the avatar bg/text color decision (special color vs getColorForUsername) is hand-rolled in UserCard, ContributorCard, PeanutActionDetailsCard and AddWithdrawCountriesList (candidate for one shared helper), and AddWithdrawCountriesList has a constant color: bank ? 'black' : 'black' ternary. Follow-up material, not touched here.
  • No docs/legal impact: internal styling only, no customer-facing fact changes, nothing new leaves our systems.
  • ds-shots: 62 shots identical — correct outcome. Fixture-covered screens (add-money bank list, crypto deposit, rewards) only got value-identical tokenization; the four visible drift fixes live on screens without fixtures (UserCard address flow, claim, offline screen, landing FAQs).
  • Chip review: clean at exact head d1f08e0 — no blocking findings, 0 inline comments, third opinion (claude-opus) 0 findings. (It fired late, on ready-for-review rather than open — bot was recovering from the earlier outage.)

The ds-lint rawHex regex reads #920 / #418 / #310 and a quoted #161616
as raw hex colors. Reword the prose so the counter sees real debt only.
…cots

Yellow body -> var(--color-action-secondary); the offline banner's
near-miss #F9F4F0 -> var(--color-background-page) (#FAF4F0) — a
deliberate one-shade drift fix onto the token.
AvatarWithBadge inlineStyle/textColor land in CSS style props, so the
hex literals become var(--color-background-icon-bubble-yellow/green)
and var(--color-foreground-primary). UserCard's wallet avatar was
off-token gold #FFD700 — snapped to the DS yellow (visible drift fix,
flagged in the PR body for veto).
…ble)

- rewards InvitesGraph backgroundColor -> var(--color-background-default);
  force-graph applies the prop as canvas.style.background, so a css var
  resolves fine
- the two arbitrary offset shadows now spell var(--color-shadow-primary)
  instead of #000; kept the arbitrary form (0.12rem has no DS utility,
  and shadow-4 would add a dark: variant the capture asset never had)
- Claimed.view icon circle: off-token #FFCC00 -> bg-background-icon-bubble-yellow
  (visible drift fix, flagged in the PR body)
Stock text sizes -> the type ramp by role: learn-more link
text-base/md:text-lg -> text-body-m/md:text-body-l; question summary
text-lg/md:text-xl (+font-extraBlack) -> text-heading-card/md:text-heading-xs
(tokens carry their own weight, stacked weights are banned); the + glyph
text-3xl -> text-heading-m; answers text-lg/md:text-xl semibold ->
text-body-l (no 20px body step exists — answers settle at 18px regular).
Section bg near-miss #F9F4F0 -> bg-background-page (drift fix).
Used by MerchantLandingPage, Marketing/mdx FAQ, LandingPage/faq.
rawHex 27 -> 8 (files 20 -> 5), stockTextSize 8 -> 1,
nonDsClassesInViews 16 -> 15. Debt only goes down.
@vercel

vercel Bot commented Sep 3, 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 3, 2026 7:31pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 3, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: e8569386-6ea9-4baf-84d1-52c9a7251c29

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 3, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7096.21 → 7092.74 (-3.47)
Findings: 0 net (+9 new, -9 resolved)

🆕 New findings (9)

  • critical complexity — src/dev/fixtures/registry.ts — CC 1, MI 20.67, SLOC 376
  • high hotspot — src/app/(mobile-ui)/qr-pay/page.tsx — 144 commits, +1957/-1654 lines since 6 months ago
  • high hotspot — src/components/AddWithdraw/AddWithdrawCountriesList.tsx — 55 commits, +741/-510 lines since 6 months ago
  • medium high-mdd — src/components/Claim/Generic/Claimed.view.tsx:15 — ClaimedView: MDD 31.8 (uses across many lines from declarations)
  • medium high-mdd — src/components/Global/Contributors/ContributorCard.tsx:24 — ContributorCard: MDD 20.0 (uses across many lines from declarations)
  • low high-mdd — src/components/Global/FAQs/index.tsx:62 — : MDD 17.6 (uses across many lines from declarations)
  • low high-mdd — src/components/User/UserCard.tsx:31 — UserCard: MDD 16.9 (uses across many lines from declarations)
  • low high-mdd — src/components/Global/FAQs/index.tsx:28 — linkifyText: MDD 10.2 (uses across many lines from declarations)
  • low missing-return-type — src/components/Global/FAQs/index.tsx:53 — FAQsPanel: exported fn missing return type annotation

✅ Resolved (9)

  • src/dev/fixtures/registry.ts — CC 1, MI 21.19, SLOC 359
  • src/app/(mobile-ui)/qr-pay/page.tsx — 143 commits, +1956/-1653 lines since 6 months ago
  • src/components/AddWithdraw/AddWithdrawCountriesList.tsx — 54 commits, +739/-508 lines since 6 months ago
  • src/components/Claim/Generic/Claimed.view.tsx:15 — ClaimedView: MDD 30.8 (uses across many lines from declarations)
  • src/components/Global/FAQs/index.tsx:60 — : MDD 17.6 (uses across many lines from declarations)
  • src/components/Global/Contributors/ContributorCard.tsx:24 — ContributorCard: MDD 17.3 (uses across many lines from declarations)
  • src/components/User/UserCard.tsx:31 — UserCard: MDD 16.7 (uses across many lines from declarations)
  • src/components/Global/FAQs/index.tsx:27 — linkifyText: MDD 10.2 (uses across many lines from declarations)
  • src/components/Global/FAQs/index.tsx:52 — FAQsPanel: exported fn missing return type annotation

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 5635 ran, 0 failed, 0 skipped, 1.7m

📊 Coverage (unit)

metric %
statements 74.1%
branches 59.5%
functions 67.7%
lines 75.0%
⏱ 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_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 › 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 › 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_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 › 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 › 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
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`.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🖼 Visual diff — 7 screens moved

14 of 62 shots changed · 48 identical · baseline 367da93 → head 98e4d56

worst % screen widths
11.93% hugo-long-username 320, 430
10.99% long-full-name 320, 430
10.30% profile-edit 320, 430
9.40% profile 320, 430
5.84% home 320, 430
2.44% empty-home 320, 430
0.87% reconsent 320, 430
new screens (3)
  • avatar-picker
  • card-pin
  • home-avatar

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 marked this pull request as ready for review September 3, 2026 16:54

@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

Clean review: the design-system tokenization and FAQ type migration preserve the intended behavior, with the documented visual drift only.

Checked clean

  • Confirmed the detached worktree head, exact base merge-base, trusted author, and PR metadata match the supplied review target.
  • Reviewed all 16 changed files for token-value equivalence, CSS-variable consumers, FAQ typography changes, baseline ratcheting, and regression paths.
  • Verified ForceGraph 1.51.0 applies backgroundColor through canvas.style.background, so the CSS variable resolves rather than being parsed as a canvas color.
  • Exact-head CI passed ds-lint, ds-shots, format, eslint, typecheck, unit, analyze, native-export, and preview checks.
  • Correctness, security, adversarial, and slop passes found no reachable defect or new security, privacy, or money surface.

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.

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

Masked state only — the reveal needs a passkey step-up no fixture can
answer, and the masked '****' uses the same span as the digits.
text-6xl leading-none font-extrabold -> text-heading-big-input (the
token carries 700 + its own line-height; stacked weights are banned).
Actual delta: 48px/800 -> 52px/700 — this repo's 6xl is overridden to
3rem/3.25rem. The loading skeleton is already h-[52px], so the old 48px
text made the row content jump size on load; digits at 52px now match
the skeleton exactly. Row geometry is held by the fixed h-[52px]
wrapper either way. Baseline: stockTextSize 1 -> 0.

@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

Clean at the pinned head. The token substitutions preserve intended CSS behavior, the deliberate typography and color drift changes are internally consistent, and no correctness, security, or maintainability defect survived adversarial review.

Checked clean

  • Confirmed the detached worktree HEAD, merge base, trusted author, and dev base exactly match the supplied review coordinates.
  • Traced every changed dynamic color through its consumer; AvatarWithBadge accepts CSS color values, SVG presentation attributes accept the tokens, and force-graph 1.51.0 assigns backgroundColor to canvas.style.background rather than a drawing context.
  • Verified the replacement color, shadow, background, and typography tokens exist and that value changes match the PR's declared visual drift.
  • Checked CardPinScreen's masked, loading, and revealed geometry plus replay-redaction boundary; the new fixture contains fake masked-state data only.
  • Ran the design-system lint ratchet and diff whitespace check successfully at this head.
  • Reviewed exact-head CI: code, type, lint, format, unit, visual, export, provenance, and aggregate gates passed; the separate review dispatcher failed only because its worker socket was temporarily unavailable, not because of repository code.

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.

Exact head: 988bce20fb28 · Context: repo · Took 5m (queued 6m)

…rison

Kush wants both candidates side by side: heading-xl is 42px/800/48px
line vs big-input's 52px/700/64px. Both are ramp tokens, counts
unchanged. Loading skeleton stays h-[52px] — if heading-xl is the pick,
deciding whether the skeleton follows the 48px line box is called out
in the PR body rather than resized silently.

@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

Clean review. The design-token migrations preserve compatible CSS/SVG/canvas behavior, the deliberate visual changes are scoped, and the PIN typography change has fixture coverage.

Checked clean

  • Confirmed the detached worktree head and merge base match the supplied SHAs, and verified the trusted PR metadata targets dev.
  • Reviewed all changed token substitutions across inline SVG attributes, React style props, Tailwind arbitrary shadows, avatar colors, and the invite graph canvas background.
  • Checked the FAQ type-ramp migration and CardPinScreen geometry, including the new masked-state card PIN fixture and active-card response shape.
  • Ran git diff --check and the design-system lint ratchet locally; both passed.
  • Exact-head unit, typecheck, format, eslint, native-export, analyze, and aggregate ci-success checks passed; ds-shots was still in progress when reviewed.

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.

Exact head: 98e4d566de74 · Context: repo · Took 5m

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