From 8c071ae508df39db131b7a09a8b234dbe717a900 Mon Sep 17 00:00:00 2001 From: user Date: Sat, 28 Feb 2026 15:26:49 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20never=20collapse=20warning=20container?= =?UTF-8?q?=20=E2=80=94=20always=20reserve=20space=20to=20prevent=20layout?= =?UTF-8?q?=20shift?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace display:none with persistent visibility:hidden so the warning area occupies the same vertical space regardless of API result. This eliminates the layout shift that occurred when the container was collapsed after the recipient history check returned. --- src/popup/views/confirmTx.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/popup/views/confirmTx.js b/src/popup/views/confirmTx.js index e2977ba..f9b4f34 100644 --- a/src/popup/views/confirmTx.js +++ b/src/popup/views/confirmTx.js @@ -246,7 +246,6 @@ function show(txInfo) { // Reset recipient warning: reserve space (visibility:hidden) while // the async check runs, preventing layout shift per README policy. const recipientWarning = $("confirm-recipient-warning"); - recipientWarning.style.display = ""; recipientWarning.style.visibility = "hidden"; estimateGas(txInfo); @@ -302,22 +301,18 @@ async function checkRecipientHistory(txInfo) { // the nonce, i.e. sent-tx count only). const code = await provider.getCode(txInfo.to); if (code && code !== "0x") { - // Contract address — hide the reserved space entirely - el.style.display = "none"; + // Contract address — no warning needed, keep space reserved + // but invisible to prevent layout shift return; } const txCount = await provider.getTransactionCount(txInfo.to); if (txCount === 0) { el.style.visibility = "visible"; - } else { - // Address has history — collapse the reserved space - el.style.display = "none"; } + // If txCount > 0, leave visibility:hidden — space stays reserved } catch (e) { log.errorf("recipient history check failed:", e.message); - // On error, collapse the reserved space rather than showing a - // false warning or leaving an empty gap - el.style.display = "none"; + // On error, leave visibility:hidden — no layout shift, no false warning } }