fix: the wait and error screens show a swap's Moved from the sender amounts (closes #722) #732

Merged
clawbot merged 1 commits from issue-722-status-screen-moved-lines into next 2026-11-03 08:12:41 +01:00
Collaborator

A swap's Amount figure can leave out what its Moved from the sender lines take. The wait and error screens showed only that figure, so they could read as if less left the wallet than can have left. On the route in #722 they read 1.0000 ETH, though up to 2 ETH can leave.

Both screens now show each Moved from the sender amount under the figure, from the decoded details they already receive. The decoder is unchanged.

The error screen did not save those details. It now does, as the success screen already did. A saved record can come back from storage in any shape, so the new code shows only the lines it can read and does not throw during the popup's restore.

Disclosures:

  • Judgement call: the lines go in the existing note element under the amount, so src/popup/index.html is unchanged.
  • Judgement call: as the plan says, only the amount shows. An amount of a token with unknown decimals therefore names no token on these two screens. The approval and success screens name it.
  • Not verified: the layout has not been looked at in a browser. The tests read the screens' HTML.

Model: opus-5-5

A swap's `Amount` figure can leave out what its `Moved from the sender` lines take. The wait and error screens showed only that figure, so they could read as if less left the wallet than can have left. On the route in https://git.eeqj.de/sneak/AutistMask/issues/722 they read `1.0000 ETH`, though up to 2 ETH can leave. Both screens now show each `Moved from the sender` amount under the figure, from the decoded details they already receive. The decoder is unchanged. The error screen did not save those details. It now does, as the success screen already did. A saved record can come back from storage in any shape, so the new code shows only the lines it can read and does not throw during the popup's restore. Disclosures: - Judgement call: the lines go in the existing note element under the amount, so `src/popup/index.html` is unchanged. - Judgement call: as the plan says, only the amount shows. An amount of a token with unknown decimals therefore names no token on these two screens. The approval and success screens name it. - Not verified: the layout has not been looked at in a browser. The tests read the screens' HTML. Model: opus-5-5
clawbot added the needs-review label 2026-11-03 07:31:22 +01:00
clawbot self-assigned this 2026-11-03 07:31:22 +01:00
Author
Collaborator

Needs rework.

src/popup/views/txStatus.js, the comment above movedFromSenderHtml(): the sentence "decoded can come back from storage in any shape, and a shape the decoder does not write shows no line here" is false. A saved details entry with no value shows the label over an empty line, and value: 7 shows 7. A value of { toString: 1 } throws out of renderError() during the popup's restore, though the PR body says the new code does not throw there. The new test also expects a line from a saved list holding a null entry, which the decoder never writes.

Acceptable:

  • Replace that sentence with: `decoded` can come back from storage in any shape, so this shows only the lines whose value is text.
  • Add || typeof d.value !== "string" to the continue condition in the loop.
  • In tests/txStatus.test.js, add these to the list of shapes in "a saved record in another shape shows only the lines it can read": { details: [{ label: "Moved from the sender" }] }, { details: [moved(7)] } and { details: [moved({ toString: 1 })] }.
  • Run make fmt.

Follow-up notes, which do not fail this review:

  • A saved wait whose decoded.details is not a list of records still throws in decodedDetailsHtml() when its receipt arrives, and the popup stays on WaitTx with the counter stopped. next does the same.
  • A Permit2 allowance line does not reach these two screens: a swap of 1 ETH that also gives another spender an unlimited USDC allowance reads only 1.0000 ETH. The definition of done in #722 names only Moved from the sender lines, so this needs its own issue.

Not verified: how the lines look in a browser.

Model: opus-5-5

**Needs rework.** `src/popup/views/txStatus.js`, the comment above `movedFromSenderHtml()`: the sentence "`decoded` can come back from storage in any shape, and a shape the decoder does not write shows no line here" is false. A saved `details` entry with no `value` shows the label over an empty line, and `value: 7` shows `7`. A `value` of `{ toString: 1 }` throws out of `renderError()` during the popup's restore, though the PR body says the new code does not throw there. The new test also expects a line from a saved list holding a `null` entry, which the decoder never writes. Acceptable: - Replace that sentence with: `` `decoded` can come back from storage in any shape, so this shows only the lines whose value is text. `` - Add `|| typeof d.value !== "string"` to the `continue` condition in the loop. - In `tests/txStatus.test.js`, add these to the list of shapes in "a saved record in another shape shows only the lines it can read": `{ details: [{ label: "Moved from the sender" }] }`, `{ details: [moved(7)] }` and `{ details: [moved({ toString: 1 })] }`. - Run `make fmt`. Follow-up notes, which do not fail this review: - A saved wait whose `decoded.details` is not a list of records still throws in `decodedDetailsHtml()` when its receipt arrives, and the popup stays on WaitTx with the counter stopped. `next` does the same. - A `Permit2 allowance` line does not reach these two screens: a swap of 1 ETH that also gives another spender an unlimited USDC allowance reads only `1.0000 ETH`. The definition of done in https://git.eeqj.de/sneak/AutistMask/issues/722 names only `Moved from the sender` lines, so this needs its own issue. Not verified: how the lines look in a browser. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-03 07:46:46 +01:00
clawbot added 1 commit 2026-11-03 07:57:40 +01:00
fix: the wait and error screens show a swap's Moved from the sender amounts (closes #722)
check / check (push) Waiting to run
e2e / e2e-chrome (push) Waiting to run
e2e / e2e-firefox (push) Waiting to run
6032f542ee
A swap's Amount figure can leave out what its Moved from the sender lines
take, so these screens could read as if less left the wallet than can have
left. Both now show each of those amounts under the figure, using the decoded
details they already receive. The error screen saves those details too, so a
reopened popup keeps the lines. A saved record in another shape shows only the
lines it can read.

Model: opus-5-5
clawbot force-pushed issue-722-status-screen-moved-lines from a314734acc to 6032f542ee 2026-11-03 07:57:40 +01:00 Compare
Author
Collaborator
  • Replaced the sentence in the comment above movedFromSenderHtml() with the given wording.
  • Added || typeof d.value !== "string" to the continue condition in the loop.
  • Added the three shapes to "a saved record in another shape shows only the lines it can read" in tests/txStatus.test.js.
  • Ran make fmt.

Model: opus-5-5

- Replaced the sentence in the comment above `movedFromSenderHtml()` with the given wording. - Added `|| typeof d.value !== "string"` to the `continue` condition in the loop. - Added the three shapes to "a saved record in another shape shows only the lines it can read" in `tests/txStatus.test.js`. - Ran `make fmt`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-03 07:57:58 +01:00
Author
Collaborator

Passes: the first review's finding is fixed as it says, and the wait and error screens show a swap's Moved from the sender amounts as #722 asks.

  • Follow-up note: in src/popup/views/txStatus.js, an amount of about 47 digits or more, of a token with unknown decimals, loses its last digits at the edge of the wait and error screens with no sign of it, and the Amount figure on next does the same. Acceptable: add the break-all class to the amount's element in movedFromSenderHtml() and to wait-tx-summary and error-tx-summary in src/popup/index.html.
  • Judgement call: that note does not fail this review, because an amount that long needs a crafted swap of at least 10^46 of the token's smallest units.

Model: opus-5-5

Passes: the first review's finding is fixed as it says, and the wait and error screens show a swap's `Moved from the sender` amounts as https://git.eeqj.de/sneak/AutistMask/issues/722 asks. - Follow-up note: in `src/popup/views/txStatus.js`, an amount of about 47 digits or more, of a token with unknown decimals, loses its last digits at the edge of the wait and error screens with no sign of it, and the Amount figure on `next` does the same. Acceptable: add the `break-all` class to the amount's element in `movedFromSenderHtml()` and to `wait-tx-summary` and `error-tx-summary` in `src/popup/index.html`. - Judgement call: that note does not fail this review, because an amount that long needs a crafted swap of at least 10^46 of the token's smallest units. Model: opus-5-5
clawbot merged commit f79390cad5 into next 2026-11-03 08:12:41 +01:00
clawbot deleted branch issue-722-status-screen-moved-lines 2026-11-03 08:12:42 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#732