Skip to content

Merge Main to Stable#441

Merged
onahprosper merged 14 commits into
stablefrom
main
Apr 6, 2026
Merged

Merge Main to Stable#441
onahprosper merged 14 commits into
stablefrom
main

Conversation

@Dprof-in-tech
Copy link
Copy Markdown
Collaborator

Description

This pull request introduces several improvements across the codebase, focusing on enhanced error handling, improved user experience through automatic network selection, and better code organization. Notably, it adds client-side Sentry error reporting, refines network selection logic based on user balances, and standardizes error reporting with user-friendly messages. Additionally, it brings improved test coverage and UI enhancements like a theme switcher.

Error Handling & Reporting Enhancements

  • Integrated Sentry (GlitchTip-compatible) client error reporting, including a new SentryClientProvider component that wraps the app in an error boundary and provides user-facing error messages with event references. Environment variable support for Sentry DSN was added in .env.example. (app/components/SentryClientProvider.tsx, app/components/AppLayout.tsx, .env.example) [1] [2] [3] [4]
  • Standardized error reporting for network switching and rate fetching using toastMappedError and mapReportAndAct, providing more informative and actionable error messages to users. (app/components/NetworksDropdown.tsx, app/components/MobileDropdown.tsx, app/components/MainPageContent.tsx) [1] [2] [3] [4] [5] [6]

Network Selection & Balance Logic

  • Implemented automatic network selection based on the user's highest positive token balance, improving the onboarding and transaction experience. This logic considers both injected and Privy wallets and only updates the displayed network when appropriate. (app/components/MainPageContent.tsx, app/lib/getPreferredNetworkForBalances.ts) [1] [2] [3] [4]
  • Added comprehensive tests for the network selection logic, ensuring correct behavior in various scenarios. (__tests__/getPreferredNetworkForBalances.test.ts)
  • Added tests for the NetworksContext to verify correct network switching and persistence behaviors. (__tests__/NetworksContext.test.tsx)

UI & Code Organization Improvements

  • Refactored imports for better clarity and maintainability, replacing grouped imports with explicit file imports. (app/components/AppLayout.tsx, app/components/MobileDropdown.tsx, app/components/WalletDetails.tsx) [1] [2] [3]
  • Added a theme switcher to the settings dropdown, allowing users to toggle the app's appearance. (app/components/SettingsDropdown.tsx) [1] [2]

These changes collectively improve the app's robustness, user experience, and code maintainability.

References

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

Dprof-in-tech and others added 14 commits March 20, 2026 14:00
…r-external-wallet

fix: update migration modal visibility logic
…ling

* Updated the SUPPORTED_CHAINS object to include network names for better clarity.
* Refactored the parseRpcUrl function to utilize the new networkName property for retrieving RPC URLs, improving error handling for unsupported chains.
refactor: enhance SUPPORTED_CHAINS structure and improve RPC URL hand…
Add the existing theme switch to the desktop settings dropdown so users can change theme without relying on the footer. The new section keeps the footer control as a secondary entry point and aligns the dropdown styling with the existing menu items.
feat(settings): add theme switch to desktop dropdown
* refactor: build time enhancements

* refactor: optimize JWT verification and enhance user ID fetching with timeout handling

* fixes

* feat: add audience parameter to JWT verification for enhanced security

* change variable

---------

Co-authored-by: chibie <chibuotu@gmail.com>
Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
… package versions

* Reintroduced cypress dependency with version 15.7.1.
* Minor adjustments to package versions and dependencies for consistency.
chore: update pnpm-lock.yaml to restore cypress dependency
feat: default balance view to highest-value network after login
* refactor: enhance error handling across components

* fix: improve error handling in TransactionPreview component

* fix

* refactor: remove liquidity error handling from errorMessages and TransactionForm

* fix: enhance error handling for network switching in MobileDropdown and NetworksDropdown components

* feat: integrate Sentry for client error reporting

---------

Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
fixes faulty balance fetch for new users
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 3, 2026

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 835010c4-d900-422b-9bdc-410f9fd488f3

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 main

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 and usage tips.

@onahprosper onahprosper merged commit 78cffbe into stable Apr 6, 2026
1 check passed
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.

4 participants