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

(Wallet) Clean up and improve transaction fragment implementation #25628

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

simoarpe
Copy link
Collaborator

Resolves brave/brave-browser#41122

  • Remove unused classes, styles, and methods.
  • Perform code refactoring
  • Adjust window flags and make status bar translucent
  • Improve bottom sheet dialog animation and remove flickering
  • Increase bottom sheet dialog height
  • Change logic to show transaction fragment without overlapping Wallet panel

Demo

screen-20240918-142544.mp4

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

  • Navigate to Wallet section and create a transaction
  • Observe the Wallet icon in the address bar showing a red dot
  • Tap on the Wallet icon and observe the transaction dialog animation is rendered smoothly without flickering
  • Dismiss the transaction dialog as you like (swiping or tapping back)
  • Observe the Wallet panel pops up when the dialog is dismissed

@simoarpe simoarpe added CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 labels Sep 18, 2024
@simoarpe simoarpe self-assigned this Sep 18, 2024
@simoarpe simoarpe requested review from deeppandya and a team as code owners September 18, 2024 12:33
Copy link
Contributor

[puLL-Merge] - brave/brave-core@25628

Description

This PR makes significant changes to the Brave Wallet functionality in the Android app. It primarily focuses on improving the UI/UX of transaction approval and details views, refactoring code for better maintainability, and addressing potential issues.

Changes

Changes

  1. android/java/org/chromium/chrome/browser/app/BraveActivity.java:

    • Refactored wallet-related methods for better organization and reduced code duplication.
    • Improved error handling and null checks.
    • Updated method signatures and visibility.
  2. android/java/org/chromium/chrome/browser/crypto_wallet/activities/BraveWalletDAppsActivity.java:

    • Updated activity lifecycle methods and UI setup.
    • Improved error handling and logging.
  3. android/java/org/chromium/chrome/browser/crypto_wallet/fragments/ApproveTxBottomSheetDialogFragment.java:

    • Significant refactoring of the transaction approval UI.
    • Improved lifecycle management and UI updates.
    • Enhanced error handling and null checks.
  4. Removed TransactionDetailsSheetFragment.java:

    • Functionality likely merged into ApproveTxBottomSheetDialogFragment.
  5. android/java/org/chromium/chrome/browser/crypto_wallet/fragments/WalletBottomSheetDialogFragment.java:

    • Minor updates to improve null safety.
  6. android/java/org/chromium/chrome/browser/crypto_wallet/model/TxNonSwipeableViewPager.java:

    • Removed custom onMeasure method, likely to use default behavior.
  7. android/java/org/chromium/chrome/browser/crypto_wallet/util/BalanceHelper.java and TokenUtils.java:

    • Added null checks and improved error handling.
  8. XML layout files:

    • Updated approve_tx_bottom_sheet.xml for improved layout and constraints.
    • Removed tx_details_bottom_sheet.xml.
    • Updated styles in brave_styles.xml files.
  9. String resources:

    • Removed some unused string resources.

Possible Issues

  1. The removal of TransactionDetailsSheetFragment might affect features that were using it. Ensure all functionalities are properly migrated or replaced.
  2. Changes in UI layouts and styles might affect the app's appearance across different device sizes and Android versions. Thorough testing on various devices is recommended.

Security Hotspots

  1. In BraveActivity.java, the showWalletPanel method now takes a boolean parameter showPendingTransactions. Ensure this doesn't unintentionally expose sensitive information when set to false.
  2. The refactoring in ApproveTxBottomSheetDialogFragment involves handling transaction details. Verify that all sensitive data is properly protected and not leaked through the UI or logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 feature/web3/wallet puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clean up and improve transaction fragment implementation
1 participant