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

@@ -1346,6 +1346,18 @@ void I18n::loadBuiltinEnglish()
strings_["import_key_tooltip"] = "Enter one or more private keys, one per line.\nSupports both z-address and t-address keys.\nLines starting with # are treated as comments.";
strings_["import_key_warning"] = "Warning: Never share your private keys! Importing keys from untrusted sources can compromise your wallet.";
strings_["import_key_z_format"] = "Z-address spending keys (secret-extended-key-...)";
strings_["import_key_warn"] = "Only import a key you own \xE2\x80\x94 it grants access to its funds.";
strings_["import_key_need_node"] = "Connect a running node to import a key.";
strings_["import_key_field"] = "Key";
strings_["import_key_reveal_tip"] = "Show/hide the key";
strings_["import_key_type_tkey"] = "Transparent private key";
strings_["import_key_type_zspend"] = "Shielded spending key";
strings_["import_key_type_zview"] = "Shielded viewing key (watch-only)";
strings_["import_key_type_unknown"] = "Unrecognized key format";
strings_["import_key_rescanning"] = "Importing & rescanning \xE2\x80\x94 this can take several minutes";
strings_["import_key_done"] = "Imported. Wallet is rescanning.";
strings_["import_key_address"] = "Address:";
strings_["import_key_import"] = "Import";
// --- Key Export Dialog ---
strings_["key_export_fetching"] = "Fetching key from wallet...";