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

chore: consolidate tx confirmation panels #21188

Merged
merged 6 commits into from
Dec 14, 2023

Conversation

josheleonard
Copy link
Contributor

@josheleonard josheleonard commented Dec 1, 2023

Resolves brave/brave-browser#34661

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 lint, 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:

Transaction confirmation panel should continue to display all pertinent information for all transaction types without major regression

@josheleonard josheleonard self-assigned this Dec 1, 2023
@josheleonard josheleonard requested a review from a team as a code owner December 1, 2023 16:02
@github-actions github-actions bot added CI/storybook-url Deploy storybook and provide a unique URL for each build feature/web3/wallet labels Dec 1, 2023
@josheleonard josheleonard changed the title Chore consolidate tx confirmation panels chore: consolidate tx confirmation panels Dec 1, 2023
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard enabled auto-merge (squash) December 1, 2023 18:20
@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 699a581 to 8b81915 Compare December 8, 2023 11:19
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@brave brave deleted a comment from github-actions bot Dec 8, 2023
Copy link
Contributor

@Douglashdaniel Douglashdaniel left a comment

Choose a reason for hiding this comment

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

LGTM!

@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 8b81915 to 9fb8142 Compare December 11, 2023 17:44
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 9fb8142 to 11d8243 Compare December 12, 2023 10:33
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 11d8243 to 4f0d2a4 Compare December 12, 2023 14:43
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 4f0d2a4 to 9fcb014 Compare December 13, 2023 12:25
Copy link
Contributor

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

Description

The PR refactors the components/brave_wallet_ui/common/hooks/use-pending-transaction.ts and relevant component files by including transaction detection for ZCash and Bitcoin, as well as removing previous files and code related to distinct transaction confirmations which seem to be now handled in a more unified manner.

Changes

Changes

  • use-pending-transaction.ts: The hook now includes isZCashTransaction and isBitcoinTransaction functions to detect respective transaction types; furthermore, it replaces an undefined value with a boolean false in the returned condition, ensuring a consistent return type.

  • Deleted Panels: Specific confirmation panels for Bitcoin, Solana, and ZCash (bitcoin-transaction-info.tsx, confirm-bitcoin-transaction-panel.tsx, confirm-solana-transaction-panel.stories.tsx, confirm-solana-transaction-panel.tsx, confirm-zcash-transaction-panel.tsx) have been removed, suggesting a consolidation of transaction panels into a more generic component that handles multiple cryptocurrencies.

  • components/brave_wallet_ui/components/extension/confirm-transaction-panel/confirm-transaction-panel.stories.tsx & .tsx: Adjustments made to accommodate the deletion of specific transaction components, and modifications to better handle the display of transaction confirmation data for multiple transaction types.

  • components/brave_wallet_ui/components/extension/confirm-transaction-panel/transaction-info.tsx: The transaction info display component has been updated to include conditions for handling ZCash and Bitcoin transaction information, alongside the already existing Ethereum and Filecoin transactions.

  • components/brave_wallet_ui/components/extension/transaction-box/index.tsx: This file has been updated to handle the presentation of transaction details for Bitcoin, ZCash, and Solana in addition to Ethereum and Filecoin, indicating a more unified approach to transaction info display.

  • components/brave_wallet_ui/panel/container.tsx: Refactored to remove conditionals that directed to specific transaction panels, pointing towards a single ConfirmTransactionPanel being used for all types.

Security Hotspots

  • The changes introduce new types of transactions. Each new type requires validation to ensure transaction details are handled securely.
  • The use of external inputs to determine transaction type (isBitcoinTransaction, isZCashTransaction) should be checked for any potential injections or handling of unvalidated data.
  • Consolidated transaction UI components must ensure there is no opportunity for sensitive information leaks between different transaction types being handled in shared components.

@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard force-pushed the chore--consolidate-tx-confirmation-panels branch from 9fcb014 to a332123 Compare December 13, 2023 17:17
@brave-builds
Copy link
Collaborator

A Storybook has been deployed to preview UI for the latest push

@josheleonard josheleonard merged commit 3a8a76e into master Dec 14, 2023
@josheleonard josheleonard deleted the chore--consolidate-tx-confirmation-panels branch December 14, 2023 12:32
@github-actions github-actions bot added this to the 1.63.x - Nightly milestone Dec 14, 2023
josheleonard added a commit that referenced this pull request Jan 18, 2024
* chore: consolidate tx confirmation panels

* chore: combine transaction-info components

* chore: combine transaction-detail components

* fix: allow rows to wrap content

* fix: allow tx confirm to-from row to wrap

* chore: remove max-width prop from column component
@srirambv
Copy link
Contributor

Verification passed on

Brave 1.64.4 Chromium: 121.0.6167.75 (Official Build) nightly (64-bit)
Revision 85d10cf
OS Linux
  • Verified steps from PR
  • Verified transaction confirmation panel continue to show all transaction information for all transaction types without any regression

kjozwiak pushed a commit that referenced this pull request Jan 19, 2024
…2.x) (#21625)

* chore: consolidate tx confirmation panels (#21188)

* chore: consolidate tx confirmation panels

* chore: combine transaction-info components

* chore: combine transaction-detail components

* fix: allow rows to wrap content

* fix: allow tx confirm to-from row to wrap

* chore: remove max-width prop from column component

* fix: display error when unable to fetch transaction fee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/storybook-url Deploy storybook and provide a unique URL for each build feature/web3/wallet puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combine transaction confirmation panel components
4 participants