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

Fix/wallet issues OK-34910 OK-34875 OK-34849 #6491

Merged
merged 5 commits into from
Jan 12, 2025
Merged

Conversation

weatherstar
Copy link
Contributor

@weatherstar weatherstar commented Jan 11, 2025

Summary by CodeRabbit

  • New Features

    • Introduced internal assets handling in transaction signature confirmation
    • Enhanced asset component rendering with support for different asset types
    • Added more flexible transaction details display logic
  • Improvements

    • Updated type definitions for transaction components
    • Improved error handling in transaction processing
    • Refined component rendering for better type safety
  • Technical Updates

    • Added new enum value for internal assets
    • Updated interfaces to support more comprehensive asset representation

Copy link

codesandbox bot commented Jan 11, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

coderabbitai bot commented Jan 11, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning expo > @expo/config > glob@7.1.6: Glob versions prior to v9 are no longer supported
warning expo > @expo/config > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning expo > @expo/config-plugins > glob@7.1.6: Glob versions prior to v9 are no longer supported
warning expo > @expo/metro-config > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning expo > @expo/cli > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning expo > @expo/config > sucrase > glob@7.1.6: Glob versions prior to v9 are no longer supported
warning expo > @expo/cli > cacache > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning expo > @expo/cli > cacache > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning expo > @expo/config-plugins > @expo/plist > @xmldom/xmldom@0.7.13: this version is no longer supported, please update to at least 0.8.*
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning expo > @expo/metro-config > babel-preset-fbjs > @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-optional-catch-binding@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning expo > @expo/metro-config > babel-preset-fbjs > @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @babel/plugin-proposal-async-generator-functions@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning expo > @expo/cli > tempy > del > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning expo > @expo/cli > cacache > @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs
warning expo > @expo/cli > cacache > @npmcli/move-file > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning expo > @expo/cli > @expo/devcert > sudo-prompt@8.2.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning expo > @expo/cli > @expo/package-manager > sudo-prompt@9.1.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
warning expo > @expo/cli > npm-package-arg > osenv@0.1.5: This package is no longer supported.
warning expo > @expo/cli > @react-native/dev-middleware > chromium-edge-launcher > rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > jscodeshift > @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > jscodeshift > @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > jscodeshift > @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > jscodeshift > temp > rimraf@2.6.3: Rimraf versions prior to v4 are no longer supported
warning expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > jscodeshift > temp > rimraf > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-config > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-2c145c5b-d2ce-492f-99a2-3b0dd36ce9c0 > eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

Walkthrough

The pull request introduces enhancements to transaction display and processing components across multiple files. The changes focus on improving asset rendering, transaction data parsing, and component flexibility. Key modifications include adding support for internal assets, refining transaction component types, and updating the rendering logic to handle different asset types more effectively.

Changes

File Change Summary
packages/kit/src/views/SignatureConfirm/.../TxAdvancedSettings.tsx - Added useSendSelectedFeeInfoAtom for fee information
- Modified transaction processing logic with async updates
- Improved error handling and data consistency
packages/kit/src/views/SignatureConfirm/.../Assets.tsx - Introduced IInternalAssetsProps type
- Created new Assets function for type-based rendering
- Updated component rendering logic
packages/kit/src/views/SignatureConfirm/.../DataViewer.tsx - Added Stack component with bottom padding
- Wrapped SizableText in new Stack component
packages/kit/src/views/SignatureConfirm/.../SignatureConfirmDetails.tsx - Added logic to merge transaction display components
- Introduced isLocalParsed flag
- Added support for internal asset components
packages/shared/src/utils/txActionUtils.ts - Updated type from IDisplayComponentAssets to IDisplayComponentInternalAssets
- Modified component type to InternalAssets
packages/shared/types/signatureConfirm.ts - Added InternalAssets enum value
- Created IDisplayComponentInternalAssets interface
- Updated existing interfaces to support new asset types

Assessment against linked issues

Objective Addressed Explanation
Unify nonce display in hexadecimal [OK-34910]
Fix iOS data scrolling display issue [OK-34875]
Resolve duplicate asset category display for ADA token transfer [OK-34849]

Finishing Touches

  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or Summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@weatherstar weatherstar enabled auto-merge (squash) January 11, 2025 07:25
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between afef291 and 9ff95ad.

📒 Files selected for processing (6)
  • packages/kit/src/views/SignatureConfirm/components/SignatureConfirmAdvanced/TxAdvancedSettings.tsx (4 hunks)
  • packages/kit/src/views/SignatureConfirm/components/SignatureConfirmComponents/Assets.tsx (8 hunks)
  • packages/kit/src/views/SignatureConfirm/components/SignatureConfirmDataViewer/DataViewer.tsx (2 hunks)
  • packages/kit/src/views/SignatureConfirm/components/SignatureConfirmDetails/SignatureConfirmDetails.tsx (3 hunks)
  • packages/shared/src/utils/txActionUtils.ts (3 hunks)
  • packages/shared/types/signatureConfirm.ts (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint (20.x)
🔇 Additional comments (16)
packages/kit/src/views/SignatureConfirm/components/SignatureConfirmDetails/SignatureConfirmDetails.tsx (3)

9-12: Imported types are correctly added.

The addition of IDisplayComponentAssets to the imports is appropriate.


66-113: Assets merging logic is implemented correctly.

The code merges token, NFT, and internal asset components based on labels when isLocalParsed is true. The logic is sound.


152-159: Added rendering for internal assets component.

The new case for EParseTxComponentType.InternalAssets correctly handles internal assets rendering.

packages/shared/types/signatureConfirm.ts (4)

16-16: Included InternalAssets in component types enum.

Adding InternalAssets to EParseTxComponentType expands the component types appropriately.


72-77: Updated assets property in IDisplayComponentAssets.

The assets array now accommodates IDisplayComponentInternalAssets along with NFT and token components.


Line range hint 79-89: Defined IDisplayComponentInternalAssets interface.

The new interface correctly describes internal assets components.


116-116: Extended IDisplayComponent union type.

Including IDisplayComponentInternalAssets ensures internal assets are properly recognized.

packages/kit/src/views/SignatureConfirm/components/SignatureConfirmComponents/Assets.tsx (5)

39-39: Added hideLabel prop to common asset properties.

This enhances component flexibility.


Line range hint 76-88: Updated SignatureAssetDetailItem to accept hideLabel.

Allowing conditional display of labels improves UI control.


Line range hint 263-269: Implemented AssetsInternalAssets component.

The new component properly renders internal assets.


281-313: Modified Assets function to handle multiple asset types.

The function now correctly maps and renders different asset components based on their type.


319-319: Exported Assets.InternalAssets correctly.

This ensures the AssetsInternalAssets component is accessible where needed.

packages/kit/src/views/SignatureConfirm/components/SignatureConfirmAdvanced/TxAdvancedSettings.tsx (2)

24-24: LGTM: Added fee info atom import

Clean addition of the fee information atom for transaction processing.


284-284: Good defensive programming with null coalescing

Smart use of the null coalescing operator to prevent undefined data in the viewer.

packages/shared/src/utils/txActionUtils.ts (1)

277-278: Type safety improvement for asset components

Good conversion to more specific internal asset types. This improves type safety and makes the code more maintainable.

Also applies to: 301-302

packages/kit/src/views/SignatureConfirm/components/SignatureConfirmDataViewer/DataViewer.tsx (1)

12-21: Enhanced layout with proper spacing

Good addition of Stack wrapper with bottom padding. This improves readability and component spacing.

@weatherstar weatherstar merged commit 34563bf into x Jan 12, 2025
8 checks passed
@weatherstar weatherstar deleted the fix/wallet-issues branch January 12, 2025 11:17
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.

3 participants