Skip to content

🐛 app: misc fixes & improvements#1100

Merged
cruzdanilo merged 8 commits into
mainfrom
fixes
Jun 24, 2026
Merged

🐛 app: misc fixes & improvements#1100
cruzdanilo merged 8 commits into
mainfrom
fixes

Conversation

@dieguezguille

@dieguezguille dieguezguille commented Jun 16, 2026

Copy link
Copy Markdown
Member

closes #446

Summary by CodeRabbit

  • Bug Fixes
    • Fixed installment APR calculation for mobile.
    • Corrected SVG/icon positioning by scoping absolutely positioned visuals with relative containers.
    • Improved refresh behavior on unsupported-chain flows and reduced refresh-control test flakiness.
    • Prevented incorrectly marking cross-chain assets as “deployed” unless the query succeeded.
  • New Features
    • Improved development error visibility in special environments (E2E).
  • Refactor
    • Unified pull-to-refresh across key screens using a shared refresh control with consistent async handling.
  • Style
    • Standardized CTAs/buttons using the composed styled button layout and more consistent default icon rendering.

@dieguezguille dieguezguille self-assigned this Jun 16, 2026
@changeset-bot

changeset-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 42a3df9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@exactly/mobile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Removes the legacy Button and ActionButton shared components and migrates ~30 screens to the StyledButton composition API (Button.Text/Button.Icon). Introduces a shared RefreshControl wrapper that manages pull-to-refresh via React Query mutations. Fixes installment APR calculation by sourcing floatingAssetsAverage from a new previewFloatingAssetsAverage contract call in useMarkets. Refines deployed-chain detection with a combined isSuccess + data-shape check. Adds an E2E-only redbox.ts utility to suppress LogBox warnings and route errors to console.error.

Changes

StyledButton Migration and Visual Fixes

Layer / File(s) Summary
StyledButton default stroke width and legacy component removal
src/components/shared/StyledButton.tsx, src/components/shared/Button.tsx, src/components/shared/ActionButton.tsx, .changeset/plain-bags-rhyme.md
ButtonIcon default strokeWidth changes from "$iconStroke.md" to 2.5. The legacy Tamagui styled(Button, ...) export and the ActionButton i18n loading wrapper are deleted entirely.
Shared component button migrations
src/components/shared/AddressDialog.tsx, src/components/shared/AmountSelector.tsx, src/components/shared/CopyAddressSheet.tsx, src/components/shared/Error.tsx, src/components/shared/ErrorDialog.tsx
All shared utility components switch Button imports to StyledButton and replace iconAfter/prop-based configurations with Button.Text/Button.Icon child composition.
Auth, activity, passkeys screen migrations
src/components/auth/Passkeys.tsx, src/components/auth/Success.tsx, src/components/activity/details/ActivityDetails.tsx
Removes ActionButton/old Button imports, removes the "owner available" alternate account flow in Passkeys, adds position="relative" to illustration containers, and rewrites CTAs using Button.Text/Button.Icon.
Card screen button migrations
src/components/card/CardPIN.tsx, src/components/card/CardDisclaimer.tsx, src/components/card/VerificationFailure.tsx, src/components/card/CardFreezeSheet.tsx
Card UI screens replace ActionButton and legacy button usage with StyledButton, refactor PIN countdown display into Button.Text lines, and update icon rendering.
Getting-started and defi button migrations
src/components/getting-started/GettingStarted.tsx, src/components/defi/AboutDefiSheet.tsx
Feature onboarding and defi screens switch to StyledButton with conditional icon selection (e.g., ArrowDownToLine vs IdCard in GettingStarted).
Home and card-upgrade button migrations
src/components/home/CollateralAssetsSheet.tsx, src/components/home/CreditLimitSheet.tsx, src/components/home/ExternalAssetsSheet.tsx, src/components/home/PayModeSheet.tsx, src/components/home/SpendingLimitSheet.tsx, src/components/home/UnsupportedNetworksSheet.tsx, src/components/home/card-upgrade/ActivateCard.tsx, src/components/home/card-upgrade/Intro.tsx, src/components/home/card-upgrade/UpgradeAccount.tsx, src/components/home/card-upgrade/VerifyIdentity.tsx
Home-related sheets and card-upgrade flows switch button implementations to StyledButton with variant-driven styling (primary, dangerSecondary), full-width layout, and Button.Text/Button.Icon composition.
Add-funds, swaps, send-funds button migrations
src/components/add-funds/Ramp.tsx, src/components/add-funds/SupportedAssetsSheet.tsx, src/components/swaps/Success.tsx, src/components/swaps/Swaps.tsx, src/components/send-funds/Asset.tsx
Feature transaction screens migrate button APIs to StyledButton composition, update variant handling (e.g., contact-toggle secondary/dangerSecondary in Asset), and remove old contained/main/spaced/fullwidth prop sets.
SVG container positioning and icon strokeWidth cleanup
src/components/activity/Empty.tsx, src/components/pay/Empty.tsx, src/components/add-funds/Bridge.tsx, src/components/pay/Pay.tsx, src/components/pay/PaymentSheet.tsx, src/components/pay/RolloverIntroSheet.tsx, .changeset/warm-pandas-fold.md
Adds position="relative" to wrapper View elements so absolutely positioned SVG children are anchored correctly. Removes explicit strokeWidth and color props from icons now covered by the StyledButton default.

Shared RefreshControl and Pull-to-Refresh Refactoring

Layer / File(s) Summary
Shared RefreshControl wrapper implementation
src/components/shared/RefreshControl.tsx, .changeset/neat-clubs-film.md
New wrapper component that connects React Native's RefreshControl to React Query useMutation, accepting an async onRefresh promise callback, driving the native refreshing prop from isPending, and reporting errors through reportError.
Activity, pending proposals, and bridge refresh migrations
src/components/activity/Activity.tsx, src/components/activity/PendingProposals.tsx, src/components/add-funds/Bridge.tsx
Switch from React Native's RefreshControl to the shared wrapper by removing isFetching from query destructuring, refactoring refresh handlers to return Promise.all for invalidate/refetch operations, and updating ScrollView/FlatList to use only onRefresh without refreshing boolean.
Card, Home, Portfolio, Loans, and Pay refresh migrations
src/components/card/Card.tsx, src/components/home/Home.tsx, src/components/home/Portfolio.tsx, src/components/loans/Loans.tsx, src/components/pay/Pay.tsx
Apply the same refactoring pattern: replace native RefreshControl, remove isFetching* tracking, consolidate refresh logic into Promise.all handlers, and update ScrollView configuration. Loans.tsx also switches exported ref from loansRefreshControlReference to loansScrollReference.

Installment APR Calculation and Deployed-Chain Detection

Layer / File(s) Summary
useMarkets: add floatingAssetsAverage contract call
src/utils/useMarkets.ts
Imports marketAbi and marketUSDCAddress from chain config and appends a previewFloatingAssetsAverage multicall to useReadContracts, exposing the result as floatingAssetsAverage at data?.[3].
useInstallmentRates: switch to floatingAssetsAverage
src/utils/useInstallmentRates.ts, .changeset/full-towns-glow.md
Replaces useAsset(marketUSDCAddress) with useMarkets(), reads floatingAssetsAverage as assets, adds early returns when assets is undefined or 0n, rewrites the count === 1 fixed-rate path with headroom-adjusted floatingBackupBorrowed, and updates count > 1 pool-utilization logic and splitInstallments arguments.
Deployed-chain detection fix and cache invalidation
src/components/home/ExternalAssets.tsx, src/utils/deployedOptions.ts, src/utils/queryClient.ts, .changeset/swift-pandas-heal.md
ExternalAssets tightens deployed detection to require both result.isSuccess and typeof result.data === "boolean". New revalidateUnsupported() helper invalidates deployed queries where data === false. queryClient adds "deployed" to INVALIDATE_ON_UPGRADE to clear stale deployed cache on app version changes.

E2E Redbox and LogBox Suppression

Layer / File(s) Summary
redbox utility and entrypoint wiring
src/utils/redbox.ts, src/index.js
Adds redbox.ts that conditionally calls LogBox.ignoreAllLogs() and sets ErrorUtils.setGlobalHandler to console.error when EXPO_PUBLIC_ENV === "e2e". src/index.js imports the module at startup.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • exactly/exa#682: Both PRs modify src/utils/queryClient.ts's version-aware persistence invalidation by changing the INVALIDATE_ON_UPGRADE set, directly affecting query-cache upgrade behavior.
  • exactly/exa#810: Both PRs adjust the installments APR calculation logic in src/utils/useInstallmentRates.ts, with overlapping changes to installment rate computation and inputs.
  • exactly/exa#970: The main PR's multi-chain "deployed" handling in src/components/home/ExternalAssets.tsx and src/utils/deployedOptions.ts overlaps with PR #970's multi-chain asset recovery feature.
🚥 Pre-merge checks | ✅ 2 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Multiple out-of-scope refactorings present: widespread Button to StyledButton migration, RefreshControl abstraction, error handling improvements, and redbox utility for E2E testing beyond APR fix scope. Separate out-of-scope changes into distinct PRs: button component migration, RefreshControl abstraction, and E2E testing utilities should be handled independently from APR calculation fixes.
Title check ❓ Inconclusive Title is vague and generic, using emoji and 'misc fixes & improvements' without describing the primary change. Replace with a specific, descriptive title that highlights the main objective (e.g., 'fix: correct installment APR calculation' or 'refactor: migrate button components to StyledButton').
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed PR changes address installment APR calculation issue (#446) through useInstallmentRates updates, button UI refactoring, and refresh control improvements aligned with issue scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fixes
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fixes

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the button components by migrating from legacy Button and ActionButton to StyledButton across the application, while deleting the obsolete button files. Additionally, it fixes SVG positioning by adding position="relative" to several wrapper views, disables Redbox and Logbox for E2E testing, and corrects the installment APR calculation in useInstallmentRates using floatingAssetsAverage. The review feedback recommends removing redundant color props from icons wrapped in Button.Icon within the payment components, as StyledButton automatically handles icon coloring.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/components/pay/Pay.tsx
Comment thread src/components/pay/Pay.tsx
Comment thread src/components/pay/Pay.tsx
Comment thread src/components/pay/Pay.tsx
Comment thread src/components/pay/PaymentSheet.tsx
Comment thread src/components/pay/PaymentSheet.tsx
Comment thread src/components/pay/RolloverIntroSheet.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: aa377fe4-c360-4e69-861f-8aee2e4300bd

📥 Commits

Reviewing files that changed from the base of the PR and between e59c92c and 0e8ed30.

📒 Files selected for processing (46)
  • .changeset/full-towns-glow.md
  • .changeset/plain-bags-rhyme.md
  • .changeset/rare-parks-arrive.md
  • .changeset/warm-pandas-fold.md
  • src/components/activity/Empty.tsx
  • src/components/activity/details/ActivityDetails.tsx
  • src/components/add-funds/Bridge.tsx
  • src/components/add-funds/Ramp.tsx
  • src/components/add-funds/SupportedAssetsSheet.tsx
  • src/components/auth/Passkeys.tsx
  • src/components/auth/Success.tsx
  • src/components/card/CardDisclaimer.tsx
  • src/components/card/CardFreezeSheet.tsx
  • src/components/card/CardPIN.tsx
  • src/components/card/VerificationFailure.tsx
  • src/components/defi/AboutDefiSheet.tsx
  • src/components/getting-started/GettingStarted.tsx
  • src/components/home/CollateralAssetsSheet.tsx
  • src/components/home/CreditLimitSheet.tsx
  • src/components/home/ExternalAssetsSheet.tsx
  • src/components/home/PayModeSheet.tsx
  • src/components/home/SpendingLimitSheet.tsx
  • src/components/home/UnsupportedNetworksSheet.tsx
  • src/components/home/card-upgrade/ActivateCard.tsx
  • src/components/home/card-upgrade/Intro.tsx
  • src/components/home/card-upgrade/UpgradeAccount.tsx
  • src/components/home/card-upgrade/VerifyIdentity.tsx
  • src/components/pay/Empty.tsx
  • src/components/pay/Pay.tsx
  • src/components/pay/PaymentSheet.tsx
  • src/components/pay/RolloverIntroSheet.tsx
  • src/components/send-funds/Asset.tsx
  • src/components/shared/ActionButton.tsx
  • src/components/shared/AddressDialog.tsx
  • src/components/shared/AmountSelector.tsx
  • src/components/shared/Button.tsx
  • src/components/shared/CopyAddressSheet.tsx
  • src/components/shared/Error.tsx
  • src/components/shared/ErrorDialog.tsx
  • src/components/shared/StyledButton.tsx
  • src/components/swaps/Success.tsx
  • src/components/swaps/Swaps.tsx
  • src/index.js
  • src/utils/redbox.ts
  • src/utils/useInstallmentRates.ts
  • src/utils/useMarkets.ts
💤 Files with no reviewable changes (2)
  • src/components/shared/Button.tsx
  • src/components/shared/ActionButton.tsx

Comment thread .changeset/rare-parks-arrive.md Outdated
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.14286% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.00%. Comparing base (149d39f) to head (6f345f6).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/components/card/Card.tsx 66.66% 4 Missing ⚠️
src/utils/useInstallmentRates.ts 80.95% 4 Missing ⚠️
src/components/activity/Activity.tsx 50.00% 2 Missing ⚠️
src/components/loans/Loans.tsx 33.33% 2 Missing ⚠️
src/components/pay/Pay.tsx 50.00% 2 Missing ⚠️
src/components/home/ExternalAssets.tsx 0.00% 1 Missing ⚠️
src/components/home/Portfolio.tsx 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1100      +/-   ##
==========================================
- Coverage   76.02%   76.00%   -0.02%     
==========================================
  Files         245      247       +2     
  Lines       12044    11974      -70     
  Branches     4284     4240      -44     
==========================================
- Hits         9156     9101      -55     
+ Misses       2572     2556      -16     
- Partials      316      317       +1     
Flag Coverage Δ
e2e 75.29% <77.14%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dieguezguille dieguezguille force-pushed the fixes branch 2 times, most recently from 9a464e6 to c665726 Compare June 17, 2026 13:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 424d3949-4911-4933-a623-b63161fa937c

📥 Commits

Reviewing files that changed from the base of the PR and between 0e8ed30 and c665726.

📒 Files selected for processing (42)
  • .changeset/plain-bags-rhyme.md
  • .changeset/warm-pandas-fold.md
  • src/components/activity/Empty.tsx
  • src/components/activity/details/ActivityDetails.tsx
  • src/components/add-funds/Bridge.tsx
  • src/components/add-funds/Ramp.tsx
  • src/components/add-funds/SupportedAssetsSheet.tsx
  • src/components/auth/Passkeys.tsx
  • src/components/auth/Success.tsx
  • src/components/card/CardDisclaimer.tsx
  • src/components/card/CardFreezeSheet.tsx
  • src/components/card/CardPIN.tsx
  • src/components/card/VerificationFailure.tsx
  • src/components/defi/AboutDefiSheet.tsx
  • src/components/getting-started/GettingStarted.tsx
  • src/components/home/CollateralAssetsSheet.tsx
  • src/components/home/CreditLimitSheet.tsx
  • src/components/home/ExternalAssetsSheet.tsx
  • src/components/home/PayModeSheet.tsx
  • src/components/home/SpendingLimitSheet.tsx
  • src/components/home/UnsupportedNetworksSheet.tsx
  • src/components/home/card-upgrade/ActivateCard.tsx
  • src/components/home/card-upgrade/Intro.tsx
  • src/components/home/card-upgrade/UpgradeAccount.tsx
  • src/components/home/card-upgrade/VerifyIdentity.tsx
  • src/components/pay/Empty.tsx
  • src/components/pay/Pay.tsx
  • src/components/pay/PaymentSheet.tsx
  • src/components/pay/RolloverIntroSheet.tsx
  • src/components/send-funds/Asset.tsx
  • src/components/shared/ActionButton.tsx
  • src/components/shared/AddressDialog.tsx
  • src/components/shared/AmountSelector.tsx
  • src/components/shared/Button.tsx
  • src/components/shared/CopyAddressSheet.tsx
  • src/components/shared/Error.tsx
  • src/components/shared/ErrorDialog.tsx
  • src/components/shared/StyledButton.tsx
  • src/components/swaps/Success.tsx
  • src/components/swaps/Swaps.tsx
  • src/index.js
  • src/utils/redbox.ts
💤 Files with no reviewable changes (2)
  • src/components/shared/ActionButton.tsx
  • src/components/shared/Button.tsx

Comment thread src/components/auth/Passkeys.tsx
Comment thread src/utils/overlay.ts Outdated
@dieguezguille dieguezguille marked this pull request as ready for review June 17, 2026 15:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7f9a7645e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/utils/overlay.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42d2a72830

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/utils/useInstallmentRates.ts
@cruzdanilo cruzdanilo merged commit 42a3df9 into main Jun 24, 2026
3 of 4 checks passed
@cruzdanilo cruzdanilo deleted the fixes branch June 24, 2026 19:36
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.

bug: Difference in APR between pay later simulation and purchase

2 participants