Skip to content

Add transaction preview v2#50

Open
Jim8y wants to merge 5 commits into
neoorder:masterfrom
Jim8y:codex/p3-transaction-preview-v2
Open

Add transaction preview v2#50
Jim8y wants to merge 5 commits into
neoorder:masterfrom
Jim8y:codex/p3-transaction-preview-v2

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Transaction Preview v2 sections to the signing popup: decoded asset changes, fee details, and a risk review before approval.
  • Highlights unknown asset movement, contract/invocation risk, execution warnings, and GAS fee notices.
  • Keeps the signing sheet focused by hiding request/execution detail sections when they do not add useful information.

Scope

  • Only updates the transaction signing preview popup and localized strings.
  • Does not change transaction creation, signing, broadcasting, wallet authorization, or dApp routing behavior.

Verification

  • git diff --check
  • iOS build: DEVELOPER_DIR=/Applications/Xcode-26.5.0.app/Contents/Developer dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:BuildIpa=false -p:EnableCodeSigning=false
  • Android build: JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:RuntimeIdentifier=android-arm64 -p:AndroidSdkDirectory=/opt/homebrew/share/android-commandlinetools -p:JavaSdkDirectory=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home -p:EmbedAssembliesIntoApk=true
  • iOS Simulator: iPhone 17 Pro, iOS 26.5. Loaded a temporary local dAPI page through Developer Tools, triggered provider.sign(context), and stopped at the preview without pressing Continue/signing/broadcasting.
  • Android Emulator: Android 16 arm64, emulator-5554. Loaded https://example.com in the dApp WebView, triggered provider.sign(context) through WebView CDP, and stopped at the preview without pressing Continue/signing/broadcasting. Crash buffer was empty.

Screenshots

Known Limitations

  • Asset changes are based on existing decoded TransferIntent and Nep11TransferIntent data; generic contract calls remain flagged as unknown/contract risk.
  • The preview does not simulate final post-chain balances or guarantee execution finality.

@Jim8y

Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Review update: transaction preview v2

Addressed Erik's review items in the latest commit 67bfe73:

  • reduced repeated transfer/fee information by keeping the fee as one compact total row with sys/net details
  • removed the separate ordinary GAS fee risk card so important transaction details stay visible without extra scrolling
  • added the missing asset hash to each decoded asset-change row so users can distinguish genuine and fake tokens
  • added full payment and receiving addresses to decoded transfer/NFT transfer rows
  • kept full addresses middle-truncated on small screens so labels and values remain readable on mobile
  • filled the Transaction Preview v2 resource keys across all supported language files, not only English and zh-Hans

Copilot's two inline comments are now outdated by the current diff: the duplicate pattern variable and unused popup converter were already removed.

Screenshots are GitHub Release assets from the fork and are not committed to this repository.

Platform Screenshot
iOS Simulator - iPhone 17 Pro, iOS 26.5 iOS transaction preview with asset hash and addresses
Android Emulator - Android 16 arm64, emulator-5554 Android transaction preview with asset hash and addresses

Validation:

  • git diff --check passed
  • resource parity check passed: all Strings*.resx files contain the same 306 keys
  • iOS build passed: DEVELOPER_DIR=/Applications/Xcode-26.5.0.app/Contents/Developer dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:BuildIpa=false -p:EnableCodeSigning=false
  • Android build passed: JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:RuntimeIdentifier=android-arm64 -p:AndroidSdkDirectory=/opt/homebrew/share/android-commandlinetools -p:JavaSdkDirectory=/opt/homebrew/Cellar/openjdk@17/17.0.19/libexec/openjdk.jdk/Contents/Home -p:EmbedAssembliesIntoApk=true
  • iOS Simulator verified: preview sheet rendered with asset hash, payment address, receiving address; final build reinstalled/launched after removing local screenshot harness
  • Android Emulator verified: preview sheet rendered with asset hash, payment address, receiving address; final build reinstalled/launched after removing local screenshot harness; crash buffer was empty

Known existing warning: both builds still report the pre-existing SQLitePCLRaw NU1903 advisory.

Copilot AI review requested due to automatic review settings June 21, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the transaction signing popup to “Transaction Preview v2” by adding localized UI sections for decoded asset changes, fee details, and a risk review (including unknown asset movement / contract risk / execution warnings / GAS fee notices).

Changes:

  • Added new localized strings for asset changes and risk review messaging (EN + zh-Hans) and updated the generated Strings.Designer.cs.
  • Introduced lightweight view-model types for asset change rows and risk warnings.
  • Updated SendTransactionPopup UI + code-behind to compute and display asset-change rows, fee info, and risk warnings, while conditionally hiding request/execution details.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
OneGateApp/Properties/Strings.zh-Hans.resx Adds zh-Hans strings for the new preview sections.
OneGateApp/Properties/Strings.resx Adds English strings for the new preview sections.
OneGateApp/Properties/Strings.Designer.cs Exposes the new resource keys via strongly-typed properties.
OneGateApp/Models/TransactionPreviewWarning.cs New model for risk warning rows in the preview UI.
OneGateApp/Models/TransactionPreviewAssetChange.cs New model for decoded asset-change rows in the preview UI.
OneGateApp/Controls/Popups/SendTransactionPopup.xaml.cs Builds asset-change and warning lists; updates DI constructor and derived visibility properties.
OneGateApp/Controls/Popups/SendTransactionPopup.xaml Adds new sections (asset changes, risk review) and conditional visibility of detail sections.
Files not reviewed (1)
  • OneGateApp/Properties/Strings.Designer.cs: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread OneGateApp/Controls/Popups/SendTransactionPopup.xaml.cs Outdated
Comment thread OneGateApp/Controls/Popups/SendTransactionPopup.xaml

@erikzhang erikzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's too much repetitive information, such as transfer amounts and fees. The fee notifications also take up too much space, causing the most important transaction details to be pushed to the bottom, requiring scrolling to see them.

@erikzhang erikzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some key information is missing:

  1. Asset hash, which users need to distinguish between genuine and fake tokens.
  2. Payment address and receiving address, which are crucial information users need to verify.

@Jim8y

Jim8y commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Latest review follow-up after merging current master (bb40f15): Erik requested fields are present in Transaction Preview v2. Each decoded asset-change row includes Asset hash, Payment address, and Receiving address; fees are kept as a compact total row with sys/net details, avoiding the earlier repetitive fee/risk layout. Copilot stale duplicate-pattern-variable and unused-XAML-resource threads are resolved. Validation on the current branch: conflict-marker scan passed; git diff --check origin/master...HEAD passed; resource parity passed across all 15 Strings*.resx files (302 keys); iOS simulator build/install/launch verified; Android emulator build/install/launch verified with empty crash log. Refreshed screenshot assets (not committed): iOS transaction preview, Android transaction preview. Ready for re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants