Skip to content

Improve receive request flow#34

Closed
Jim8y wants to merge 3 commits into
neoorder:masterfrom
Jim8y:codex/p2-receive-request
Closed

Improve receive request flow#34
Jim8y wants to merge 3 commits into
neoorder:masterfrom
Jim8y:codex/p2-receive-request

Conversation

@Jim8y

@Jim8y Jim8y commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR is the second small P2 wallet UX improvement and focuses only on the receive/payment-request flow. It turns the old static receive QR page into a clearer, more useful wallet receive request experience without changing transaction signing, dAPI, RPC selection, wallet storage, or send execution.

What changed

  • Reworked the Receive page into a structured receive request screen with a QR card, optional amount, memo, reference data, safety copy, and primary actions.
  • The generated neo: URI now includes optional asset, positive amount, memo, and data query parameters.
  • Added request validation so invalid/non-positive amounts show an inline error and disable copy/share actions.
  • Added copy-request and share-QR actions. Share QR captures the QR card to a temporary PNG and opens the native share sheet.
  • Added an optional request summary inside the QR card so shared QR images can visibly show amount/memo/reference details when present.
  • Preserved scanned payment-request metadata through ScanPage and shows memo/data as read-only request details on SendPage.
  • Normalized QR amount parsing/formatting with invariant culture so amount=1.23 behaves consistently across device languages.
  • Added English and Simplified Chinese strings for the new receive request UI.

Out of scope

  • No transaction construction changes.
  • No private-key, password, biometric, storage, dAPI, or network behavior changes.
  • No global visual system or Shell navigation redesign.
  • Homepage, Send risk hints, and Settings Security Center improvements remain separate PRs.

Validation

  • xmllint --noout OneGateApp/Pages/ReceivePage.xaml OneGateApp/Pages/SendPage.xaml OneGateApp/Properties/Strings.resx OneGateApp/Properties/Strings.zh-Hans.resx
  • git diff --check
  • Android build: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true
  • iOS simulator build: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:EnableCodeSigning=false -p:CodesignKey= -p:CodesignProvision= -p:ProvisioningType=automatic
  • Android emulator smoke test: launched on onegate_api36, opened the Receive page, verified layout, scrolling, and receive action buttons are reachable. Screenshot will be added as a PR comment, not committed to the repository.
  • iOS simulator: clean build succeeded. Runtime UI automation was limited because global xcode-select points to CommandLineTools and the accessibility tooling requires full Xcode selection via sudo; direct simctl launch was inconsistent on this simulator, so iOS validation is build-level for this PR.
  • Current checkout does not contain a test project, so dotnet test is not available.

Known existing warnings: NU1903 for SQLitePCLRaw.* packages and iOS asset duplicate MT7158 warnings were observed; they are pre-existing and not introduced by this PR.


目的

这个 PR 是第二个小型 P2 钱包体验优化,只聚焦收款/付款请求流程。它把旧的静态收款二维码页升级成更清晰、更有用的钱包收款请求体验,不改变交易签名、dAPI、RPC 选择、钱包存储或发送执行逻辑。

修改内容

  • 将 Receive 页面重构为结构化收款请求界面,包含二维码卡片、可选金额、备注、参考数据、安全说明和主要操作按钮。
  • 生成的 neo: URI 现在会包含可选的 asset、正数 amountmemodata 查询参数。
  • 添加请求校验,非法或非正数金额会显示内联错误,并禁用复制/分享操作。
  • 添加复制请求和分享二维码操作。分享二维码会将二维码卡片截成临时 PNG,并打开系统原生分享面板。
  • 在二维码卡片中添加可选请求摘要,因此分享出去的二维码图片在有金额/备注/参考数据时也能直接显示这些信息。
  • ScanPage 中保留扫码得到的付款请求元数据,并在 SendPage 中以只读请求详情展示 memo/data。
  • 使用 invariant culture 规范二维码金额的解析和格式化,确保 amount=1.23 在不同设备语言下行为一致。
  • 为新的收款请求界面添加英文和简体中文文案。

不在范围内

  • 不修改交易构造。
  • 不修改私钥、密码、生物识别、存储、dAPI 或网络行为。
  • 不做全局视觉系统或 Shell 导航重构。
  • 首页、发送风险提示和设置安全中心优化仍然留在独立 PR 中。

验证

  • xmllint --noout OneGateApp/Pages/ReceivePage.xaml OneGateApp/Pages/SendPage.xaml OneGateApp/Properties/Strings.resx OneGateApp/Properties/Strings.zh-Hans.resx
  • git diff --check
  • Android build: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-android -p:RuntimeIdentifier=android-arm64 -p:EmbedAssembliesIntoApk=true
  • iOS simulator build: dotnet build OneGateApp/OneGateApp.csproj -f net10.0-ios -p:RuntimeIdentifier=iossimulator-arm64 -p:EnableCodeSigning=false -p:CodesignKey= -p:CodesignProvision= -p:ProvisioningType=automatic
  • Android 模拟器冒烟测试:在 onegate_api36 上启动应用,打开 Receive 页面,验证布局、滚动和收款操作按钮可达。截图会以 PR 评论形式添加,不提交进代码库。
  • iOS 模拟器:clean build 成功。运行时 UI 自动化受限,因为全局 xcode-select 指向 CommandLineTools,而可访问性工具需要通过 sudo 切到完整 Xcode;当前 simulator 的直接 simctl launch 也不稳定,所以这个 PR 的 iOS 验证覆盖到 build 级别。
  • 当前 checkout 中没有测试项目,因此无法运行 dotnet test

已知既有警告:观察到 SQLitePCLRaw.* 包的 NU1903 警告和 iOS asset duplicate MT7158 警告;这些是既有问题,不是本 PR 引入。

@Jim8y

Jim8y commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Android emulator screenshots

Captured from onegate_api36. Screenshots are attached here only and are not committed to the repository.

Receive request first screen:

Android receive request first screen

Receive request details and action buttons:

Android receive request details and actions

@Jim8y

Jim8y commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Split follow-up for easier review:

  • Created PR Improve receive request UI #39 with only the Receive request UI: optional amount/memo/data fields, request URI generation, validation, copy request, share QR, and related strings.
  • Kept ScanPage parsing and SendPage payment-request display out of Improve receive request UI #39 so those can be reviewed separately if needed.

This keeps the first Receive change around the same review size as PR #33.

@Jim8y

Jim8y commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of smaller receive-flow PRs. The ReceivePage payment-request redesign ships in #39 (which also completes zh-Hant); the remaining Scan->Send payment-request metadata round-trip (memo/data pass-through + decode hardening) will be opened as a separate small PR carved from this branch. The branch codex/p2-receive-request is preserved so that slice can still be extracted.

@Jim8y Jim8y closed this Jun 20, 2026
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.

1 participant