From bf9a4830310993d6fcdde8f51df4ea06cbdccb10 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 27 Feb 2026 14:28:20 -0800 Subject: [PATCH] fix: show wallet/address titles in send, txStatus, and home tx list (closes #26, closes #27, closes #28) - send.js: show addressTitle() above ENS name and address in From field - txStatus.js: show addressTitle() in To address when it's a local wallet - home.js: show addressTitle() for counterparties in tx list when they are local wallet addresses --- src/popup/views/home.js | 4 +++- src/popup/views/send.js | 17 +++++++++++++++-- src/popup/views/txStatus.js | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/popup/views/home.js b/src/popup/views/home.js index 78fbff2..cb7cd24 100644 --- a/src/popup/views/home.js +++ b/src/popup/views/home.js @@ -6,6 +6,7 @@ const { isoDate, timeAgo, addressDotHtml, + addressTitle, escapeHtml, truncateMiddle, } = require("./helpers"); @@ -110,8 +111,9 @@ function renderHomeTxList(ctx) { const amountStr = tx.value ? escapeHtml(tx.value + " " + tx.symbol) : escapeHtml(tx.symbol); + const title = addressTitle(counterparty, state.wallets); const maxAddr = Math.max(32, 36 - Math.max(0, amountStr.length - 10)); - const displayAddr = truncateMiddle(counterparty, maxAddr); + const displayAddr = title || truncateMiddle(counterparty, maxAddr); const addrStr = escapeHtml(displayAddr); const dot = addressDotHtml(counterparty); const err = tx.isError ? " (failed)" : ""; diff --git a/src/popup/views/send.js b/src/popup/views/send.js index d96d5b7..6a7b630 100644 --- a/src/popup/views/send.js +++ b/src/popup/views/send.js @@ -1,6 +1,12 @@ // Send view: collect To, Amount, Token. Then go to confirmation. -const { $, showFlash, addressDotHtml, escapeHtml } = require("./helpers"); +const { + $, + showFlash, + addressDotHtml, + addressTitle, + escapeHtml, +} = require("./helpers"); const { state, currentAddress } = require("../../shared/state"); let ctx; const { getProvider } = require("../../shared/balances"); @@ -44,8 +50,15 @@ function updateSendBalance() { const dot = addressDotHtml(addr.address); const link = `https://etherscan.io/address/${addr.address}`; const extLink = `${EXT_ICON}`; + const title = addressTitle(addr.address, state.wallets); let fromHtml = ""; - if (addr.ensName) { + if (title) { + fromHtml += `
${dot}${escapeHtml(title)}
`; + if (addr.ensName) { + fromHtml += `
${escapeHtml(addr.ensName)}
`; + } + fromHtml += `
${escapeHtml(addr.address)}${extLink}
`; + } else if (addr.ensName) { fromHtml += `
${dot}${escapeHtml(addr.ensName)}
`; fromHtml += `
${escapeHtml(addr.address)}${extLink}
`; } else { diff --git a/src/popup/views/txStatus.js b/src/popup/views/txStatus.js index a36fd31..a755b84 100644 --- a/src/popup/views/txStatus.js +++ b/src/popup/views/txStatus.js @@ -5,6 +5,7 @@ const { showView, showFlash, addressDotHtml, + addressTitle, escapeHtml, } = require("./helpers"); const { state, saveState } = require("../../shared/state"); @@ -37,6 +38,13 @@ function toAddressHtml(address) { const dot = addressDotHtml(address); const link = `https://etherscan.io/address/${address}`; const extLink = `${EXT_ICON}`; + const title = addressTitle(address, state.wallets); + if (title) { + return ( + `
${dot}${escapeHtml(title)}
` + + `
${escapeHtml(address)}${extLink}
` + ); + } return `
${dot}${escapeHtml(address)}${extLink}
`; }