feat(settings): redesign the Import Key dialog

Rework the full-node Import Key dialog into a safer, Material-consistent, more
capable flow:

- Security: the key is masked by default (Password) with a reveal (eye) toggle,
  a DialogWarningHeader "only import a key you own" note, and the buffer is
  wiped with sodium_memzero on close and on successful import.
- Progress: import triggers a blocking full-chain rescan; the dialog now shows
  "Importing & rescanning — this can take several minutes" with LoadingDots and
  disables Import while it runs (no double-submit). Offline shows a "connect a
  running node" note and disables Import up front.
- Viewing keys: the classifier gains isViewingKey / isRecognizedImportKey;
  importPrivateKey auto-detects a shielded viewing key (zxviews…) and routes to
  z_importviewingkey (watch-only) vs z_importkey / importprivkey. The live type
  indicator shows Transparent / Shielded spending / Shielded viewing (watch-only).
- Result: on success the imported address is captured from the RPC result and
  shown via AddressCopyField.
- Material restyle (OverlayDialogSpec/BlurFloat + TactileButton + Esc) and full
  i18n (12 new keys x 8 languages; CJK subset rebuilt).

Verified: rendered on dark + light skins; a seeded zxviews… key shows the masked
field + "Shielded viewing key (watch-only)" indicator.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 12:58:36 -05:00
parent 8293f02e36
commit 46f3001360
15 changed files with 274 additions and 88 deletions

View File

@@ -416,18 +416,30 @@
"history": "历史",
"immature_type": "未成熟",
"import": "导入",
"import_key_address": "地址:",
"import_key_btn": "导入密钥",
"import_key_done": "已导入。钱包正在重新扫描。",
"import_key_field": "密钥",
"import_key_formats": "支持的密钥格式:",
"import_key_full_rescan": "0 = 完整重扫)",
"import_key_import": "导入",
"import_key_label": "私钥:",
"import_key_need_node": "请连接一个运行中的节点以导入密钥。",
"import_key_no_valid": "输入中未找到有效密钥",
"import_key_progress": "正在导入 %d/%d...",
"import_key_rescan": "导入后重新扫描区块链",
"import_key_rescanning": "正在导入并重新扫描——可能需要几分钟",
"import_key_reveal_tip": "显示/隐藏密钥",
"import_key_start_height": "起始高度:",
"import_key_success": "密钥导入成功",
"import_key_t_format": "T 地址 WIF 私钥",
"import_key_title": "导入私钥",
"import_key_tooltip": "输入一个或多个私钥,每行一个。\n支持 z 地址和 t 地址密钥。\n以 # 开头的行视为注释。",
"import_key_type_tkey": "透明私钥",
"import_key_type_unknown": "无法识别的密钥格式",
"import_key_type_zspend": "屏蔽花费密钥",
"import_key_type_zview": "屏蔽查看密钥(仅查看)",
"import_key_warn": "只导入你自己拥有的密钥——它可访问该地址的资金。",
"import_key_warning": "警告:切勿分享您的私钥!从不可信来源导入密钥可能会危及您的钱包安全。",
"import_key_z_format": "Z 地址花费密钥 (secret-extended-key-...)",
"import_private_key": "导入私钥...",