Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chain Badge consolidation & backend delivery #6328

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

walmat
Copy link
Contributor

@walmat walmat commented Dec 12, 2024

WHEN REVIEWING FILES, MAKE SURE YOU FILTER OUR .png / .json FILES

Blocked until #6344 lands as we currently rely on local ios imagesets for chain selectors.

What changed (plus any additional context for devs)

1. Badge System Refactoring

Changes to Chain Badge Implementation

  • Removed the old badge system that used static image assets in ios/Images.xcassets/badges/
  • Replaced ChainBadge component with new ChainImage component
  • Switched from local image assets to remote image URLs for chain badges
  • Added new getChainsBadge() method to backendNetworksStore to manage badge URLs

Component Updates

  • Updated all components that previously used ChainBadge or EthCoinIcon to use the new ChainImage component, including:
    • WalletConnectApprovalSheet
    • TransactionDetailsValueAndFeeSection
    • MintSheet
    • ClaimCustomization
    • FastTransactionCoinRow
    • And many others

2. Image Caching Improvements

FastImage Integration

  • Added FastImage cache clearing in multiple places:
    • Added to model migrations (v24)
    • Updated clearImageCache function in DevSection to clear both ImgixImage and FastImage caches
try {
  FastImage.clearDiskCache();
  FastImage.clearMemoryCache();
} catch (e) {
  logger.error(new RainbowError(`Error clearing FastImage cache: ${e}`));
}

3. Menu System Updates

Dropdown Menu Refactoring

  • Renamed DropdownMenu to ClaimableMenu in claimables section
  • Updated menu item interfaces to support remote icons
  • Improved handling of menu actions and selections
  • Added better TypeScript typing for menu configurations

4. UI/UX Improvements

Chain Badge Positioning

  • Added explicit chain badge positioning through a new prop:
chainBadgePosition: {
  x: number;
  y: number;
}
  • Improved consistency of badge placement across the app

Component Cleanup

  • Removed unused imports and components
  • Simplified component props
  • Improved type safety across components

This PR represents a significant refactoring of the chain badge system, moving from static assets to remote images while improving the overall architecture and maintainability of the codebase.

Screen recordings / screenshots

// wip

What to test

TestFlight: 1.9.50 (3)
https://www.notion.so/rainbowdotme/App-Chain-Image-QA-Checklist-15fb001b85b480839cb1e0cf1665de12

@brunobar79 brunobar79 added the release for release blockers and release candidate branches label Dec 12, 2024
@walmat walmat removed the release for release blockers and release candidate branches label Dec 13, 2024
@walmat walmat marked this pull request as ready for review December 17, 2024 18:42
@brunobar79
Copy link
Member

Launch in simulator or device for 31c82d1

@walmat walmat added the blocked Blocked by anything (design, UI work, other task, etc) label Dec 17, 2024
@brunobar79
Copy link
Member

Launch in simulator or device for 5f8f028

@brunobar79
Copy link
Member

Launch in simulator or device for a282bd6

Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

* start work on converting existing chain selection dropdowns to Zeego

* available networks v2 convert

* add token icons to claim dropdown and fix but with AvailableNetworks not showing ever

* latest changes to try to get hitslop to work
@brunobar79
Copy link
Member

Launch in simulator or device for c3048bc

@walmat walmat removed the blocked Blocked by anything (design, UI work, other task, etc) label Dec 27, 2024
@brunobar79
Copy link
Member

Launch in simulator or device for a22001a

@walmat walmat removed the request for review from benisgold January 3, 2025 18:08
Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

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

Lgtm! Initially I was going to post the PoW screenshots here but it would probably clutter the thread. I have them if needed.

I checked 85% of the QA checklist and didn't see any issues other than zksync era missing an icon and the avaiable on other networks badges looking off in the image below:
Screenshot 2025-01-06 at 12 38 11 PM

src/components/ExchangeTokenRow.tsx Outdated Show resolved Hide resolved
@brunobar79
Copy link
Member

Launch in simulator or device for d5615d1

@brunobar79
Copy link
Member

Launch in simulator or device for d8624f2

@brunobar79
Copy link
Member

Launch in simulator or device for 3719759

@brunobar79
Copy link
Member

Launch in simulator or device for 62069b2

@brunobar79
Copy link
Member

Launch in simulator or device for 9be06c7

Copy link
Contributor

@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

Bug fixes all look good on both OS's, QA Passed ✅

@brunobar79
Copy link
Member

Launch in simulator or device for 108597d

@walmat
Copy link
Contributor Author

walmat commented Jan 10, 2025

Waiting to merge until @christianbaroni introduces a few positioning changes to the ChainImage component

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