fix: a saved SuccessTx in another shape reopens as itself, and long amounts wrap (closes #740)
The popup refused a saved SuccessTx whose decoded record was in a shape it did not expect, and showed Home. SuccessTx already shows only the lines it can read, so the popup no longer checks the record first. A long amount or token symbol was cut off at the edge of the screen. These now wrap: - the Amount figure - each decoded amount - the token symbol - the name and description of SuccessTx's decoded action WaitTx and ErrorTx share the line that shows the symbol, so they gain this too. Model: opus-5-5
This commit was merged in pull request #742.
This commit is contained in:
@@ -833,7 +833,10 @@
|
||||
<div id="success-tx-decoded" class="mb-3 hidden text-xs"></div>
|
||||
<div class="mb-3">
|
||||
<div class="text-xs text-muted mb-1">Amount</div>
|
||||
<div id="success-tx-summary" class="font-bold"></div>
|
||||
<div
|
||||
id="success-tx-summary"
|
||||
class="font-bold break-words"
|
||||
></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="text-xs text-muted mb-1">To</div>
|
||||
|
||||
@@ -116,21 +116,6 @@ function isAddressText(value) {
|
||||
return isText(value);
|
||||
}
|
||||
|
||||
// Decoded calldata, as decodedDetailsHtml() (src/popup/views/txStatus.js)
|
||||
// walks it: `for (const d of decoded.details)` needs an iterable, and each
|
||||
// entry's `address` reaches toAddressHtml(). Absent or falsy is the ordinary
|
||||
// case and short-circuits before either.
|
||||
function isRenderableDecoded(value) {
|
||||
if (!value) return true;
|
||||
if (!isRecord(value)) return false;
|
||||
if (!value.details) return true;
|
||||
if (!Array.isArray(value.details)) return false;
|
||||
return value.details.every(
|
||||
(entry) =>
|
||||
isRecord(entry) && (!entry.address || isAddressText(entry.address)),
|
||||
);
|
||||
}
|
||||
|
||||
// The pending transaction confirmTx.show() renders: `token` reaches
|
||||
// renderAddressHtml() when it is not "ETH", `from`/`to` reach
|
||||
// addressTitle(), makeBlockie() and getLocalWarnings(), and `amount` reaches
|
||||
@@ -209,7 +194,6 @@ function renderView(view, state, views) {
|
||||
case "success-tx":
|
||||
if (!data.hash) return false;
|
||||
if (!isAddressText(data.to)) return false;
|
||||
if (!isRenderableDecoded(data.decoded)) return false;
|
||||
// `chainId` picks the network whose explorer the links open, so
|
||||
// when it is there it has to name one. Likewise on error-tx.
|
||||
if (data.chainId && !SUPPORTED_CHAIN_IDS.has(data.chainId)) {
|
||||
|
||||
@@ -91,7 +91,7 @@ function decodedAddressHtml(d, chainId) {
|
||||
if (!d.isToken) return toAddressHtml(d.address, chainId);
|
||||
const sym = tokenLabel(d.address, chainId) || "Unknown token";
|
||||
return (
|
||||
`<div class="font-bold">${escapeHtml(sym)}</div>` +
|
||||
`<div class="font-bold break-words">${escapeHtml(sym)}</div>` +
|
||||
blockscoutOffTokenNoteHtml(d.address, chainId) +
|
||||
toAddressHtml(d.address, chainId)
|
||||
);
|
||||
@@ -329,11 +329,11 @@ function decodedDetailsHtml(decoded, chainId) {
|
||||
let html = `<div class="border border-border border-dashed p-2 mb-3">`;
|
||||
if (decoded.name && typeof decoded.name === "string") {
|
||||
html += `<div class="mb-2"><div class="text-xs text-muted mb-1">Action</div>`;
|
||||
html += `<div class="font-bold">${escapeHtml(decoded.name)}</div></div>`;
|
||||
html += `<div class="font-bold break-words">${escapeHtml(decoded.name)}</div></div>`;
|
||||
}
|
||||
if (decoded.description && typeof decoded.description === "string") {
|
||||
html += `<div class="mb-2"><div class="text-xs text-muted mb-1">Description</div>`;
|
||||
html += `<div>${escapeHtml(decoded.description)}</div></div>`;
|
||||
html += `<div class="break-words">${escapeHtml(decoded.description)}</div></div>`;
|
||||
}
|
||||
for (const d of lines) {
|
||||
html += `<div class="mb-2">`;
|
||||
@@ -341,7 +341,7 @@ function decodedDetailsHtml(decoded, chainId) {
|
||||
if (d.address) {
|
||||
html += decodedAddressHtml(d, chainId);
|
||||
} else {
|
||||
html += `<div class="font-bold">${escapeHtml(d.value)}</div>`;
|
||||
html += `<div class="font-bold break-words">${escapeHtml(d.value)}</div>`;
|
||||
}
|
||||
html += `</div>`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user