Skip to content

Localization (en / es-419 / pt-BR) + zero ESLint errors - #2447

Merged
kushagrasarathe merged 48 commits into
devfrom
chore/eslint-cleanup
Jul 28, 2026
Merged

Localization (en / es-419 / pt-BR) + zero ESLint errors#2447
kushagrasarathe merged 48 commits into
devfrom
chore/eslint-cleanup

Conversation

@innolope-dev

Copy link
Copy Markdown
Collaborator

What this is

Two tightly-coupled efforts on one branch (the lint guard is what enforces the localization, so they ship together):

  1. App localization — all product-UI copy extracted to next-intl: 1,982 message keys per locale in src/i18n/app/messages/ for English, Latin-American Spanish (es-419), and Brazilian Portuguese (pt-BR), an AppIntlProvider mounted above the context tree, and an ESLint guard (react/jsx-no-literals, scoped to translated surfaces) that fails CI when someone hard-codes new UI copy.
  2. ESLint cleanup — the eslint CI job goes from 832 errors on main to 0 on this branch.

Synced with main as of 2026-07-17 (all 55 commits merged in, 9 conflicts resolved in favor of main's newer copy/logic with the i18n calls preserved).

Lint stats: 832 → 0 errors

Baseline on main (232 files) vs this branch:

Rule main branch How it was resolved
@typescript-eslint/no-explicit-any 307 0 112 production sites properly typed (see below); tests/mocks and dev-only tooling exempted via commented config overrides
@next/next/no-html-link-for-pages 198 0 <a>next/link across marketing/app pages
@typescript-eslint/no-unused-vars 120 0 dead bindings removed; intentional ones _-prefixed
no-restricted-imports (barrel ban) 119 0 deep imports of @/interfaces, @/assets, @/context, @/components, @/config; dead barrels deleted
@typescript-eslint/no-require-imports 72 0 converted to ES imports; the Jest require-after-jest.mock() idiom exempted for test files
react/no-unknown-property 6 0 fixed; styled-jsx's jsx/global attrs whitelisted
import/first 5 0 imports hoisted
misc (display-name, alt-text, no-empty-object-type, stale disable directives) 5 0 fixed individually
Total errors 832 0

Warnings: 183 → 61, almost all react-hooks/exhaustive-deps. The provably-safe deps were fixed on this branch; the remainder genuinely change behavior when "fixed" and are left for a dedicated pass rather than blind suppression.

The no-explicit-any sweep (307 → 0)

  • 112 production sites across 61 files fixed with real types — zero inline suppressions. Patterns: generated API/domain types where they exist (ChainWithTokens, IOnrampData, viem/zerodev exports, StaticImageData, react-hook-form generics); catch (e: any)catch (e) with instanceof narrowing; opaque payloads (websocket, health probes) → unknown or a minimal local interface covering only the fields actually read; vendor globals (navigator.brave, screen.orientation.lock, window.opera) → typed structural casts.
  • Typing surfaced real latent bugs fixed along the way: an undefined React key on badge history entries (b.id is optional), and an any that poisoned a TanStack query's TError inference in qr-pay.
  • Scoped, commented config exemptions (production keeps the ban): tests/mocks/fixtures; dev-only tooling (/dev pages, the window.debug console cheats, the InvitesGraph debug visualization).

New guards this branch adds (all clean at merge time)

  • react/jsx-no-literals on translated surfaces — hard-coded UI copy fails CI. Exempted: marketing (own i18n), /dev, shared primitives that take copy as props, and the hidden fix-card-signature support tool (support DMs the URL; English by design).
  • react/no-unknown-property at error level with styled-jsx exemptions.
  • Guard-rails inherited from earlier PRs kept intact (router.back() ban, nuqs history: 'push' ban, barrel-import ban, self-import ban).

Verification

  • pnpm eslint . → 0 errors, 61 warnings (warnings don't fail the job)
  • pnpm tsc --noEmit → clean
  • Jest: 150/150 suites, 2,045 tests passing
  • pnpm prettier --check . → clean

Notes for reviewers

  • 507 files changed (+15,014 / −4,581) over 45 commits — the bulk is mechanical string extraction and the three locale JSON files. The riskiest commits are the exhaustive-deps fixes and the any → typed conversions; both are covered by the test suite and were reviewed for behavior preservation (runtime semantics deliberately unchanged).
  • Supersedes feat/app-localization — every commit of that branch is contained here; it can be deleted after this merges to avoid a second divergent merge of the same work.
  • es-419 / pt-BR translations were machine-assisted and reviewed for the high-traffic flows; a native-speaker pass on the long tail is a good follow-up.

…zation header

CapacitorHttp's Android GET proxy (_capacitor_http_interceptor_) stalls under
load, timing out every in-flight request after 10s (PEANUT-UI-R44): ~400
timeouts/user on Android vs ~3 on web/iOS over 14d, GETs only, in correlated
bursts. Requests now go direct from the webview, same path as web.

- auth: token moves from the CapacitorHttp cookie jar to @capacitor/preferences
  (survives webview storage eviction, unlike localStorage — PEANUT-UI-QTQ),
  hydrated into an in-memory cache and sent as Authorization. authReady() gates
  callApi and direct fetchWithSentry call sites against cold-start races.
- login: the ZeroDev SDK consumes /passkeys/*/verify responses internally, so a
  window.fetch wrapper captures the body token on native. /users/me sliding
  refresh keeps it current via the existing setAuthToken path.
- old binaries keep working: server still accepts the jwt-token cookie and
  hasNativeSession falls back to the legacy jar. Existing native sessions are
  not migrated — testers log in once after updating.
- fetchWithSentry: idempotent requests (GET/HEAD) get one silent retry on
  timeout before surfacing.
- canary: one-shot startup probe reports direct-fetch viability to Sentry
  (message:"direct-fetch canary", tags outcome/transport) so the transport
  switch is validated fleet-wide via OTA before the binary rolls out.
@capacitor/device requires the next native binary release; JS falls back
to navigator.language on older binaries.
Hoist the lazy viem require in peanut-claim.utils (viem is already
statically imported there) and scope the rule off for Jest test files,
where require() after jest.mock()/resetModules() is intentional.
Remove dead imports/declarations, use bare catch where the binding was
unused, and _-prefix signature-bound params and kept hook results.
Also ignore ios/ and build/ (generated) in eslint.
Replace raw <a> internal-route anchors with <Link> (client-side
navigation) across LandingPage components and the dev debug page.
- src/i18n/app: locale config + resolveLocale normalizer, catalogs
  (en/es-419/pt-BR), deep-merge loader so missing keys render English,
  runtime locale store (Preferences/Device on native, cookie on web),
  AppIntlProvider with hydration-safe English-first state
- provider wired into ClientProviders; native splash gated on the
  startup locale being painted (2s timeout guard)
- loadingStates union converted to a const array + key mapping
- jest: transform ESM-only intl packages (pnpm-aware ignore pattern)

Marketing i18n (src/i18n/*.json) untouched.
/settings/language screen with the supported locales, reached from a
new Profile row showing the active language. Live re-render on switch,
persisted via Preferences (native) / cookie (web).
The OPEN-status badge fix was picked up by 1eb7c3c ("fix(lint): resolve
no-unused-vars") along with that commit's lint sweep. It is unrelated to
localization and is being reviewed on its own branch against main
(peanut-ui#2430), so remove it here to keep the two changes separable.

Pure removal — no behaviour change beyond reverting to main's badge logic.
Step titles/descriptions keyed by screenId (removed from ISetupStep),
all Setup views, wrapper, and (setup) pages on useTranslations.
es-419 + pt-BR drafts included.
Home screen, activation CTAs, carousel, perk/welcome modals, tab bar,
desktop sidebar and top navbar. TopNavbar maps pathname to typed
navigation.* keys, replacing the pathTitles util.
ExchangeRateWidget (marketing-shared) takes an optional labels prop with
English defaults; product callers pass translated labels.
Limits warning-card items now carry a kind discriminator so render
sites can map them to translated copy; qr-pay uses it.
The warning card rendered raw English item text for the withdraw and
add-money callers while qr-pay mapped the kind discriminator at its own
render site. Resolve copy inside the card instead, so every flow gets it,
and drop the duplicated mapping from qr-pay.

Passkey troubleshooting steps and warnings become ids resolved against
setup.passkey.help.*, so the modal's content is translated, not just its
chrome.
The min/max cashout branches assigned the placeholder slugs
'offramp_lt_minimum'/'offramp_mt_maximum', which ErrorAlert rendered
verbatim — users saw the raw slug. Assign real messages with the limit
formatted as currency.

Also return on the over-maximum branch: it set the error and then kept
going, fetching a route and letting the flow continue past the limit,
unlike the under-minimum branch.
validatePin returns reason codes instead of English copy so the util
stays copy-free; CardPinSetupFlow maps them to messages.
CardCountryConfirmScreen feeds the active locale into Intl.DisplayNames
(was hardcoded to en), so country names follow the UI language.
Drop the vestigial capitalize class on the feed's type label: it existed
to case raw enum values (getActionText returned the type verbatim), but
the catalog now supplies cased copy, and CSS title-casing mangles
multi-word labels in every locale.

cardDeclineReason and the bank-account label util return codes now, with
the copy resolved at the render site.
Drop the capitalize class on the badge-unlocked label for the same
reason as the transaction feed: it title-cased translated copy.

Remove invites.consts.ts — it held only display copy, and its last
consumer now reads the setup-flow waitlist key so the two gates can't
drift.
sumsub-reject-labels.consts.ts becomes a copy-free code registry; the
62 reject labels move to the kyc namespace and resolve at the render
site, with unknown codes collapsing to FALLBACK as before.

recover-funds no longer prints a raw loadingState or raw token amounts,
and the KYC screens format dates through the active locale instead of a
hardcoded en-US.
Marketing-shared components under Global/ keep their English and take
copy as props instead: they render inside the app intl context, but the
marketing site resolves its language from the URL, so a shared component
would show the app locale on a marketing page.

Fix UserCard.getTitle reading fullName/username while only depending on
type, which rendered a stale name after a rename.
Extraction silently rewrote ' to the typographic form in 32 places,
changing English copy that ships today (e.g. the balance-warning modal's
"you're the only one who can access your funds"). Straighten them all so
en matches source and reads consistently; the translated catalogs are
unaffected.

Also wrap the useSumsubKycFlow test in an intl provider — the hook now
calls useTranslations and the suite never had one.
friendly-error.utils.tsx becomes copy-free: ErrorHandler is replaced by
friendlyError(), returning a code or backend-provided text, resolved to
a message by the new useFriendlyError hook. Backend copy (rain collateral,
stale-card re-enable with its dynamic retry hint) passes through untranslated.

Three sites compared the rendered error string against a constant to gate
UI; those now compare the error CODE, so the gate survives translation.
src/features/payments was missed by every earlier pass — a lint probe
caught it. Extends the existing payment namespace (no payments dupe);
contributor and receipt counts use ICU plurals, the 'on <chain>' label
reuses the shared tokenSelector.onChain rich-text key. Also covers the
KYC status drawer, sumsub load-error, and amount-input balance label.
Scopes react/jsx-no-literals to the translated surface so new hardcoded
JSX strings fail lint. Excludes tests, the /dev catalog, and marketing-
shared Global components; allowlists non-copy glyphs (card masks, %,
decorative emoji). Extraction stragglers the guard surfaced are also
handled: the beta/demo banners and the transaction 'Enjoy Peanut!' title.
useSendMoney calls useTranslations, and it runs inside ContextProvider
(via TokenContextProvider → useWallet), which was mounted ABOVE the intl
provider — so every route 500'd with a missing-context error. Unit tests
each wrap their subject in a provider, so only a full-app render caught
it. Move AppIntlProvider to wrap ContextProvider (still inside
PeanutProvider, which needs no translations).
'Video element not available' was shown to users when the video element
lost the mount race. Say what it means to them instead.

Adds a ClientProviders provider-order test: it walks the real element
tree rather than rendering it, so the AppIntlProvider-wraps-ContextProvider
contract is checked without mocking the wallet and kernel stack.
Everything except no-explicit-any and no-restricted-imports. Most of these
turned out to be malformed eslint-disable directives rather than the code
defects the rule names suggested.

react-hooks/exhaustive-deps (PerkClaimModal, 2): the disable comments used an
em-dash before the description instead of ESLint's `--` separator, so ESLint
parsed the whole string as a rule name. The suppressions were not suppressing
anything and both exhaustive-deps warnings were firing. Both effects are
deliberately mount-only, so the separator is fixed and the reasoning kept.

react/no-unknown-property (6): `<style jsx global>` is styled-jsx, a Next
built-in, not an invalid DOM attribute. Taught the rule via `ignore` in the
config — two files under Card/share-asset had already been hand-disabling it,
so those disables are now redundant and removed.

import/first (5), jsx-a11y/alt-text (1): both rules are unregistered here (the
config uses import-x, and jsx-a11y is not installed), so these directives only
produced "rule not found" errors. Removed; the Jest-ordering rationale is kept
as a plain comment. The alt-text site is a next/image test mock, not a real
accessibility defect.

react/display-name (1): named the forwardRef render function in a Card mock.
no-empty-object-type (1): ILinkDetails.rawOnchainDepositInfo `{}` ->
Record<string, unknown>; the field is declared but read nowhere.

Also removed 7 dead disable directives for rules that are off in tests
(no-require-imports) or no longer exist (no-var-requires).

eslint: 441 -> 424 errors, 157 -> 148 warnings. typecheck, jest (142 suites /
1974 tests) and prettier all green.
Rewrites all 55 bare `from '@/interfaces'` imports to the file that actually
owns the symbol. The barrel only re-exported ./interfaces and
./wallet.interfaces, so this was uniform except useAccountSetup.ts, which is
the one consumer of WalletProviderType. src/interfaces/index.ts had no
remaining referrers and is deleted.

Also removed a jest.mock('@/interfaces') in withdraw-states.test.tsx. The deep
imports made it dead (it no longer intercepted anything), and it was redundant
regardless: it stubbed AccountType with four members whose values match the
real enum exactly, while shadowing the other three (EVM_ADDRESS,
PEANUT_WALLET, MANTECA). The suite passes against the real enum.

eslint: 424 -> 368 errors. typecheck 0, jest 142 suites / 1974 tests green.
Rewrites all 45 bare `from '@/assets'` imports. The root barrel re-exported ten
category sub-barrels, so a single named import pulled the whole asset graph in.

Most symbols resolve to a leaf file (the sub-barrels are pure
`export { default as X } from './x.svg'` re-exports), so those become direct
default imports — which is already the dominant convention in this codebase.
The exceptions are the computed consts in assets/mascot and assets/cards
(PeanutWhistling = pick(webp, gif), APPLE_WALLET_STEPS); those are defined in
their category index rather than re-exported, so the index is the owning file
and they keep a named import from '@/assets/mascot'.

eslint: 368 -> 323 errors. typecheck 0, jest 142 suites / 1974 tests green.
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview, Comment Jul 28, 2026 7:10am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 17, 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: Pro

Run ID: 91abb806-e8aa-4b81-b385-84c1771a7618

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/eslint-cleanup

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

Keeps the i18n calls while adopting dev's newer work:
- AddMoneyBankDetails: dev's SEPA name-match checklist items extracted to
  bankDetails.doubleCheckSenderName/RecipientName in all three locales
- SumsubKycWrapper test: dev's watchdog-era rewrite taken wholesale, with
  the NextIntlClientProvider wrapper re-added (component requires intl)
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 6284.55 → 6627.25 (+342.7)
Findings: +1 net (+1381 new, -1380 resolved)

🆕 New findings (1381)

  • critical complexity — src/components/Global/InvitesGraph/index.tsx — CC 515, MI 53.18, SLOC 1713
  • critical complexity — src/app/(mobile-ui)/qr-pay/page.tsx — CC 304, MI 52.63, SLOC 1073
  • critical complexity — src/components/Claim/Link/Initial.view.tsx — CC 213, MI 50.68, SLOC 731
  • critical complexity — src/utils/general.utils.ts — CC 199, MI 57.59, SLOC 758
  • critical complexity — src/components/TransactionDetails/TransactionDetailsReceipt.tsx — CC 162, MI 51.41, SLOC 424
  • critical complexity — src/app/(mobile-ui)/withdraw/manteca/page.tsx — CC 156, MI 51.57, SLOC 595
  • critical complexity — src/components/AddWithdraw/DynamicBankAccountForm.tsx — CC 150, MI 52.05, SLOC 461
  • critical complexity — src/components/Global/TokenSelector/TokenSelector.tsx — CC 127, MI 60.45, SLOC 353
  • critical complexity — src/app/(mobile-ui)/card/page.tsx — CC 125, MI 56.97, SLOC 488
  • critical complexity — src/app/(mobile-ui)/withdraw/page.tsx — CC 124, MI 53.2, SLOC 363
  • critical complexity — src/components/AddWithdraw/AddWithdrawCountriesList.tsx — CC 123, MI 56.36, SLOC 369
  • critical complexity — src/components/Claim/Link/views/BankFlowManager.view.tsx — CC 110, MI 46.94, SLOC 425
  • critical complexity — src/app/(mobile-ui)/add-money/[country]/bank/page.tsx — CC 108, MI 57.45, SLOC 393
  • critical method-complexity — src/components/TransactionDetails/TransactionDetailsReceipt.tsx:89 — CC 108 SLOC 215
  • critical complexity — src/utils/demo-api.ts — CC 107, MI 59.53, SLOC 914
  • critical complexity — src/features/payments/flows/semantic-request/useSemanticRequestFlow.ts — CC 106, MI 49.11, SLOC 457
  • critical complexity — src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx — CC 102, MI 53.37, SLOC 386
  • critical complexity — src/components/Home/HomeHistory.tsx — CC 102, MI 57.43, SLOC 317
  • critical complexity — src/context/kernelClient.context.tsx — CC 101, MI 57.09, SLOC 477
  • critical complexity — src/components/Claim/Claim.tsx — CC 100, MI 53.54, SLOC 404

…and 1361 more.

✅ Resolved (1380)

  • src/components/Global/InvitesGraph/index.tsx — CC 518, MI 53.17, SLOC 1709
  • src/app/(mobile-ui)/qr-pay/page.tsx — CC 305, MI 53.59, SLOC 971
  • src/components/Claim/Link/Initial.view.tsx — CC 212, MI 51.11, SLOC 686
  • src/utils/general.utils.ts — CC 202, MI 57.68, SLOC 763
  • src/components/TransactionDetails/TransactionDetailsReceipt.tsx — CC 160, MI 52.91, SLOC 351
  • src/app/(mobile-ui)/withdraw/manteca/page.tsx — CC 155, MI 52.57, SLOC 528
  • src/components/AddWithdraw/DynamicBankAccountForm.tsx — CC 149, MI 53.51, SLOC 410
  • src/components/Global/TokenSelector/TokenSelector.tsx — CC 126, MI 60.85, SLOC 331
  • src/app/(mobile-ui)/card/page.tsx — CC 125, MI 57.27, SLOC 475
  • src/app/(mobile-ui)/withdraw/page.tsx — CC 124, MI 54.12, SLOC 334
  • src/components/AddWithdraw/AddWithdrawCountriesList.tsx — CC 123, MI 56.91, SLOC 351
  • src/components/Claim/Link/views/BankFlowManager.view.tsx — CC 110, MI 47.15, SLOC 417
  • src/app/(mobile-ui)/add-money/[country]/bank/page.tsx — CC 108, MI 57.97, SLOC 375
  • src/components/TransactionDetails/TransactionDetailsReceipt.tsx:74 — CC 108 SLOC 169
  • src/utils/demo-api.ts — CC 107, MI 59.55, SLOC 914
  • src/features/payments/flows/semantic-request/useSemanticRequestFlow.ts — CC 106, MI 49.34, SLOC 448
  • src/app/(mobile-ui)/withdraw/[country]/bank/page.tsx — CC 101, MI 54.48, SLOC 352
  • src/context/kernelClient.context.tsx — CC 101, MI 57.1, SLOC 477
  • src/components/Claim/Claim.tsx — CC 100, MI 53.93, SLOC 389
  • src/components/Home/HomeHistory.tsx — CC 97, MI 58.3, SLOC 296

…and 1360 more.

📈 Painscore deltas (top movers)

File Before After Δ
src/utils/native-auth-capture.ts 0.0 6.8 +6.8
src/i18n/app/AppIntlProvider.tsx 0.0 6.5 +6.5
src/utils/native-canary.ts 0.0 5.8 +5.8
src/components/TransactionDetails/useReceiptDateFormatter.ts 0.0 5.6 +5.6
src/i18n/app/config.ts 0.0 5.5 +5.5
src/components/Settings/LanguageView.tsx 0.0 5.3 +5.3
src/components/Global/FileUploadInput/index.tsx 5.4 10.7 +5.3
src/i18n/app/locale-store.ts 0.0 5.2 +5.2
src/i18n/app/messages.ts 0.0 5.2 +5.2
src/hooks/useFriendlyError.ts 0.0 4.9 +4.9
src/i18n/app/loading-states.ts 0.0 4.5 +4.5
src/components/Global/ConfirmInviteModal/index.tsx 3.0 7.4 +4.4
src/features/limits/components/LimitsDocsLink.tsx 1.0 4.7 +3.7
src/components/Badges/BadgeDetailModal.tsx 2.9 6.5 +3.6
src/components/Kyc/states/KycCompleted.tsx 6.2 9.8 +3.6
src/components/Global/PeanutActionCard/index.tsx 1.8 5.2 +3.4
src/components/Global/SuccessViewComponents/SuccessViewDetailsCard.tsx 2.1 5.4 +3.3
src/features/limits/components/LimitsWarningCard.tsx 4.0 7.3 +3.3
src/components/Global/RainCooldown/IntroModal.tsx 4.6 7.9 +3.3
src/components/Kyc/states/KycProcessing.tsx 5.0 8.3 +3.3

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 2254 ran, 0 failed, 0 skipped, 30.8s

📊 Coverage (unit)

metric %
statements 60.4%
branches 43.8%
functions 49.6%
lines 60.9%
⏱ 10 slowest test cases
time test
2.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.8s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.3s src/utils/__tests__/sentry.utils.test.ts › defaults to the client budget under a browser global
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/utils/__tests__/sentry.utils.test.ts › still lets a per-call timeoutMs win over the default
0.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.2s src/app/actions/__tests__/api-headers-extended.test.ts › should not include apiKey in validateInviteCode body
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a wallet older than the TTL on cold start
0.2s src/utils/__tests__/demo-balance.test.ts › auto-refills a stored balance that has no timestamp (legacy install)
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@kushagrasarathe

Copy link
Copy Markdown
Contributor

Review — safe-mechanical, but too big & mis-based ⚠️

Sampled the riskiest files across the ~314-file diff (--json files capped at 100 hid the real size). It's genuinely two mechanical transforms — i18n string extraction (t('...')) + ESLint type-safety cleanup (anyunknown, catch(e:any)→guarded, de-barreling) — plus real new infra (next-intl, AppIntlProvider, LanguageView, capacitor deps). Spot-checked the two densest logic files:

  • useQRScanner.ts: err:anyerr instanceof Error ? err.name : '' preserves the NOT_READABLE/NOT_FOUND/retry branches; t correctly threaded into deps.
  • ClientProviders.tsx: AppIntlProvider placement above ContextProvider is deliberately reasoned (useSendMoney→useTranslations ordering). Not churn.

No removed-side-effecting-var or altered-deps-array regressions found in the sample.

Concerns:

  1. Scope — bundles (a) eslint config + type cleanup, (b) next-intl infra, (c) per-file string extraction into one ~15k-line PR. Unreviewable as one revert unit. Please split into a/b/c landed in that order if at all possible.
  2. Base branch — targets dev; every other FE PR targets main. A 314-file PR on dev conflicts with every main PR that back-merges; the native-build.js collision with fix(native): don't flag P0_TRANSFORMS pages as uncovered server routes #2436 surfaces at the next release, not now.
  3. native-build.js conflict with fix(native): don't flag P0_TRANSFORMS pages as uncovered server routes #2436 — reconcile explicitly; re-run native-build-scan.test.js after.

Merge order: if it must ship whole, merge it LAST, after all other FE PRs, to minimize the 314-file rebase blast radius. Reviewer spot-check target: the eslint "unused"-removal edits (deleted vars/interfaces, _-prefixed params) — the only place a mechanical PR this size can hide a regression. Everything sampled was clean.

@kushagrasarathe kushagrasarathe 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.

Requesting changes — split / rebase / reconcile

Sampled diff is safe-mechanical (i18n extraction + eslint cleanup; logic preserved in the dense files). But required before approval:

  • Split into (a) eslint config + type-safety cleanup, (b) next-intl infra + provider + language page, (c) per-file string extraction — landed in that order. A ~314-file / +15k-line PR is unreviewable as one revert unit. If it genuinely can't be split, justify here and merge it LAST after all other FE PRs.
  • Rebase onto main (currently base dev, unlike every other FE PR) — or state the dev↔main plan. As-is, this conflicts with every main PR that back-merges, and the native-build.js collision with #2436 surfaces at the next release rather than now.
  • Reconcile scripts/native-build.js with #2436 and re-run native-build-scan.test.js.

Reviewer spot-check target for whoever does the deep pass: the eslint "unused"-removal edits (deleted vars/interfaces, _-prefixed params) — the one place a mechanical PR this size can hide a regression. Everything sampled was clean.

@kushagrasarathe kushagrasarathe 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.

🟡 SECURITY conditions — supply-chain + undisclosed auth-transport rewrite

Adversarial scan of the full ~314-file diff found no external network call, no secret exfiltration, no code-exec primitive — the window.fetch monkeypatch (native-auth-capture.ts) is native-only, gated to the passkey verify endpoints, stores the token in on-device @capacitor/preferences, and sends it nowhere. Clean. But two real security concerns block a direct prod merge:

  • Supply-chain age policy. New deps are below the 14-day floor (minimum-release-age=20160): @capacitor/device + @capacitor/preferences (~3 days old), intl-messageformat (~4d), next-intl/use-intl (~10d). Wait them out, or use the documented MIN_RELEASE_AGE_EXCLUDE override with justification. CI's supply-chain check must be green.
  • Disclose + separately review the native-auth transport rewrite riding inside this "localization" PR: CapacitorHttp disabled, header-based Authorization auth, the fetch interceptor, and native-canary.ts. It's security-sensitive and must not be rubber-stamped as i18n — ideally split into its own PR so it gets a focused auth review.

No malicious code found; these are policy + review-scope blocks, not defects.

@kushagrasarathe

kushagrasarathe commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Still open on this PR

two blockers remain:

  • Supply-chain age floor. @capacitor/device / @capacitor/preferences (~4 days old) and next-intl (~11 days) are still under the 14-day minimum-release-age policy. Wait them out, or add the documented MIN_RELEASE_AGE_EXCLUDE override with justification — CI's supply-chain check must be green.
  • Split out / disclose the native-auth transport rewrite riding inside this PR (CapacitorHttp disabled, header-based Authorization auth, the window.fetch interceptor in native-auth-capture.ts, native-canary.ts). It's security-sensitive and shouldn't be reviewed as "localization" — ideally its own PR for a focused auth review.

Also still applies: this targets dev while the other FE PRs target main (base divergence), and it collides with #2436 on scripts/native-build.js.

@innolope-dev

Copy link
Copy Markdown
Collaborator Author

Re the supply-chain age floor — that blocker is already satisfied

The "~4 days old" / "~11 days" figures look like they came from each package's latest release rather than the version this branch actually resolves to. Checked the lockfile resolutions against npm registry publish dates:

package resolved published age
@capacitor/device 8.0.2 2026-03-25 117d
@capacitor/preferences 8.0.1 2026-02-12 158d
next-intl 4.13.1 2026-06-30 20d
use-intl 4.13.1 2026-06-30 20d
intl-messageformat 11.2.9 2026-06-26 25d

pnpm-lock.yaml pins exactly these (the caret ranges have not floated to anything newer), and minimumReleaseAge applies to the resolved version — so all five clear the 14-day floor with room to spare. No MIN_RELEASE_AGE_EXCLUDE override is needed.

CI agrees: check-min-release-age is green on this PR (as are eslint, format, e2e, analyze, ci-success).

The native-auth transport split is the one real remaining blocker, and I agree with it — CapacitorHttp disabled, header-based Authorization, the window.fetch interceptor in native-auth-capture.ts, and native-canary.ts should not be reviewed as localization. That is queued as its own PR, holding until #1195 lands so it starts from a clean base. Base divergence (dev vs main) and the native-build.js collision with #2436 are tracked with it.

Three conflicts, all the same shape — dev changed English literals that
this branch had already moved into next-intl catalogs:

- InvitesPage: adopt dev's vanity-claim copy split (Sign up CTA + a
  separate login label) via new/updated invites.* keys
- InitiateKycModal: adopt the new region-unavailable (UK) variant with
  kyc.initiate.*RegionUnavailable + ctaWithdrawFunds keys
- CardFace: adopt dev's error-state retry-eye restyle; re-localize the
  Virtual pill it reintroduced; Platinum stays a literal (brand lockup,
  jsx-no-literals expression container)

All three catalogs updated in parity (en / es-419 / pt-BR).
@innolope-dev

Copy link
Copy Markdown
Collaborator Author

Resolved the conflict with dev (merge commit 437efef).

All three conflicts were the same shape — dev changed English copy that this branch had already moved into the next-intl catalogs — so the resolution keeps the t() architecture and adopts dev's newer copy as catalog entries:

  • InvitesPage: dev's vanity-claim rework (fix: honest signup/login CTAs on vanity badge claim screen #2464) split the CTA into "Sign up" + a context-dependent login label. Adopted via updated invites.vanityDescription/vanityCta and a new invites.logIn key.
  • InitiateKycModal: dev's UK-resident block (feat(kyc): honest UK-resident block on Bridge bank flows (TASK-20729) #2457) added a region-unavailable variant. Localized as kyc.initiate.titleRegionUnavailable/descriptionRegionUnavailable/ctaWithdrawFunds.
  • CardFace: adopted dev's error-state retry-eye restyle; re-localized the Virtual pill the restyle reintroduced as a literal. Platinum stays English deliberately (Visa tier lockup, not copy) behind the jsx-no-literals expression-container escape.

All three catalogs (en / es-419 / pt-BR) updated in parity. Verified post-merge: tsc clean, eslint clean on the touched files, all 39 i18n tests green, prettier clean. The supporting UK-block files (capability-gate.ts, bank pages) merged clean with no new user-facing literals.

@kushagrasarathe kushagrasarathe 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.

Re-reviewed for the dev merge — clearing my change request. No longer conflicting (mergeable); the dev-merge introduced no net-new risk (only balance.utils.ts genuinely changed — hardcoded strings migrated into the intl errors namespace, callers updated, typecheck green). Supply-chain CI passes. Approving for merge to dev. Remaining items are dev→main PROMOTION gates, not dev-merge blockers: (1) on-device iOS+Android test of the native-auth transport rewrite, (2) reconcile native-build.js with the merged #2436 + re-run the scan test at the dev↔main integration.

innolope-dev added a commit that referenced this pull request Jul 23, 2026
… fix

Rolls up for the next TestFlight + Play internal build:
  - main → mobile-release sync (push routing, app lock, step-up, CSP,
    Manteca per-rail hotfix, Rhino minimums, Sentry noise) — #2483
  - en / es-419 / pt-BR localization + 0 ESLint errors — #2447
  - $0-balance fix: last-known spendable, balanceUnavailable, no
    non-card /rain/cards poll — cherry-picked from #2482
# Conflicts:
#	pnpm-lock.yaml
#	src/app/(mobile-ui)/add-money/page.tsx
#	src/app/(mobile-ui)/notifications/page.tsx
#	src/app/(mobile-ui)/withdraw/crypto/page.tsx
#	src/app/(mobile-ui)/withdraw/page.tsx
#	src/app/ClientProviders.tsx
#	src/components/Card/ApplicationStatusScreen.tsx
#	src/components/Card/PhysicalCardScreen.tsx
#	src/components/Card/YourCardScreen.tsx
#	src/components/Global/GeneralRecipientInput/index.tsx
#	src/components/Global/QRScanner/index.tsx
#	src/components/Home/ActivationCTAs.tsx
#	src/components/Kyc/KycVerificationInProgressModal.tsx
#	src/components/Send/link/views/Initial.link.send.view.tsx
#	src/components/TransactionDetails/TransactionDetailsReceipt.tsx
#	src/components/TransactionDetails/provider-rows/CardPaymentRows.tsx
#	src/components/TransactionDetails/transaction-details.utils.ts
#	src/components/Withdraw/views/Initial.withdraw.view.tsx
#	src/utils/__tests__/general.utils.test.ts
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.

2 participants