feat(settings): send-tab-style slider for the rescan start height

The optional "scan from block height" control in the Import Private/Viewing
Key dialog now leads with a slider styled like the send-tab amount bar
(rounded track, accent fill, glass thumb) bounded by the chain tip, with the
numeric field beside it for exact entry and the current chain height
right-aligned above. When the node's height is unknown (state_.sync.blocks == 0,
e.g. not yet synced) the slider is omitted and the field spans the full row —
which also fixes the previous cramped 140px field that left the row half empty.

- New static helpers in app.cpp: formatIntWithCommas() and RenderScanHeightControl()
  (mirrors RenderAmountBar in send_tab.cpp). The height decimal string is the single
  source of truth shared by slider + field; the slider reserves/queries its
  InvisibleButton before drawing so a drag has no one-frame lag; the bar height is
  ImGui::GetFrameHeight() so it aligns with the numeric field.
- Import handler clamps the parsed start height to the chain tip.
- i18n: added import_scan_tip ("current height") in en + 8 langs.

Reviewed via an adversarial multi-agent pass (slider-math / state-sync /
dpi-layout / consistency); the one confirmed finding (bar/field height mismatch)
is fixed here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-13 15:17:15 -05:00
parent 1fc3e03e6f
commit 0c55ed0fe4
10 changed files with 105 additions and 9 deletions

View File

@@ -446,6 +446,7 @@
"import_private_key": "Privaten Schlüssel importieren...",
"import_scan_hint": "0 = von Anfang an neu scannen",
"import_scan_label": "Ab Blockhöhe scannen (optional)",
"import_scan_tip": "aktuelle Höhe",
"import_scan_transparent": "Transparente Schlüssel scannen immer vollständig neu",
"import_viewkey_field": "Anzeigeschlüssel",
"import_viewkey_note": "Nur Lesen: Ein Anzeigeschlüssel zeigt Guthaben und Transaktionen einer Adresse, kann deren Mittel aber nicht ausgeben.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "Importar Clave Privada...",
"import_scan_hint": "0 = volver a escanear desde el inicio",
"import_scan_label": "Escanear desde la altura de bloque (opcional)",
"import_scan_tip": "altura actual",
"import_scan_transparent": "Las claves transparentes siempre se reescanean por completo",
"import_viewkey_field": "Clave de visualización",
"import_viewkey_note": "Solo lectura: una clave de visualización revela el saldo y las transacciones de una dirección, pero no puede gastar sus fondos.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "Importer une clé privée...",
"import_scan_hint": "0 = réanalyser depuis le début",
"import_scan_label": "Analyser à partir de la hauteur de bloc (facultatif)",
"import_scan_tip": "hauteur actuelle",
"import_scan_transparent": "Les clés transparentes réanalysent toujours entièrement",
"import_viewkey_field": "Clé de visualisation",
"import_viewkey_note": "Lecture seule : une clé de visualisation révèle le solde et les transactions d'une adresse, mais ne peut pas dépenser ses fonds.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "秘密鍵をインポート...",
"import_scan_hint": "0 = 最初から再スキャン",
"import_scan_label": "スキャン開始ブロック高(任意)",
"import_scan_tip": "現在の高さ",
"import_scan_transparent": "透明鍵は常に全体を再スキャンします",
"import_viewkey_field": "閲覧鍵",
"import_viewkey_note": "監視のみ:閲覧鍵はアドレスの残高と取引を表示できますが、資金を送金することはできません。",

View File

@@ -446,6 +446,7 @@
"import_private_key": "개인 키 가져오기...",
"import_scan_hint": "0 = 처음부터 다시 스캔",
"import_scan_label": "스캔 시작 블록 높이(선택 사항)",
"import_scan_tip": "현재 높이",
"import_scan_transparent": "투명 키는 항상 전체를 다시 스캔합니다",
"import_viewkey_field": "조회 키",
"import_viewkey_note": "읽기 전용: 조회 키는 주소의 잔액과 거래를 보여주지만 자금을 사용할 수는 없습니다.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "Importar Chave Privada...",
"import_scan_hint": "0 = reescanear desde o início",
"import_scan_label": "Escanear a partir da altura do bloco (opcional)",
"import_scan_tip": "altura atual",
"import_scan_transparent": "Chaves transparentes sempre reescaneiam totalmente",
"import_viewkey_field": "Chave de visualização",
"import_viewkey_note": "Somente leitura: uma chave de visualização revela o saldo e as transações de um endereço, mas não pode gastar seus fundos.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "Импорт приватного ключа...",
"import_scan_hint": "0 = повторное сканирование с начала",
"import_scan_label": "Сканировать с высоты блока (необязательно)",
"import_scan_tip": "текущая высота",
"import_scan_transparent": "Прозрачные ключи всегда пересканируются полностью",
"import_viewkey_field": "Ключ просмотра",
"import_viewkey_note": "Только чтение: ключ просмотра показывает баланс и транзакции адреса, но не может тратить его средства.",

View File

@@ -446,6 +446,7 @@
"import_private_key": "导入私钥...",
"import_scan_hint": "0 = 从头重新扫描",
"import_scan_label": "从区块高度开始扫描(可选)",
"import_scan_tip": "当前高度",
"import_scan_transparent": "透明密钥始终完整重新扫描",
"import_viewkey_field": "查看密钥",
"import_viewkey_note": "仅查看:查看密钥可显示地址的余额和交易,但无法花费其资金。",