The balance lists and Home's ETH balance round amounts with Number.toFixed(4) (balanceLine() in src/popup/views/helpers.js, the ETH line in src/popup/views/home.js). Every other screen cuts through src/shared/amountDisplay.js. So one balance reads two ways:
a holding of 0.99996 ETH reads 1.0000 ETH in the balance list, more than the address holds, and 0.9999 ETH as Send's current balance;
a holding of 0.00004 USDC reads 0.0000 USDC in the balance list and 0.00004 USDC on Send.
The rule: RULES.md Display Consistency, "Same data formatted identically across all screens". sneak's README.md text behind it: "If a formatting rule applies in one place, it applies in every place. Users should never see the same value rendered differently on two screens."
Every summary amount goes through truncateAmountNeverZero() in src/shared/amountDisplay.js, applied to the exact decimal string (the stored balance, or the output of formatEther() / formatUnits()), never to a JavaScript number. That covers the balance lists, Home's ETH balance, history rows (src/shared/transactions.js, which uses truncateAmount() today), Send's current balance and the screens that state what is authorized.
TransactionDetail keeps the exact amount and base units. "quantity unknown" stays as it is.
USD values may still be computed from a parsed number; only the shown quantity changes.
truncateAmount() stays only as the step inside truncateAmountNeverZero(), or goes if nothing else calls it.
README.md "Amounts": replace the sentences saying the balance lists round and history rows cut without the floor with the one rule.
Files: src/popup/views/helpers.js, src/popup/views/home.js, src/shared/transactions.js, src/shared/amountDisplay.js if needed, README.md, tests. No new module.
Definition of done
Tests, failing on current next: 0.99996 ETH renders 0.9999 in the balance list and in Home's ETH line; 0.00004 renders 0.00004 in the balance list and in a history row.
No screen formats an amount with toFixed().
make check green. Gate runs: flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.
Model: opus-5-5
The balance lists and Home's ETH balance round amounts with `Number.toFixed(4)` (`balanceLine()` in `src/popup/views/helpers.js`, the ETH line in `src/popup/views/home.js`). Every other screen cuts through `src/shared/amountDisplay.js`. So one balance reads two ways:
- a holding of 0.99996 ETH reads `1.0000 ETH` in the balance list, more than the address holds, and `0.9999 ETH` as Send's current balance;
- a holding of 0.00004 USDC reads `0.0000 USDC` in the balance list and `0.00004 USDC` on Send.
The rule: `RULES.md` Display Consistency, "Same data formatted identically across all screens". sneak's `README.md` text behind it: "If a formatting rule applies in one place, it applies in every place. Users should never see the same value rendered differently on two screens."
Found in the `RULES.md` read on https://git.eeqj.de/sneak/AutistMask/issues/672#issuecomment-160312.
## Fix
- Every summary amount goes through `truncateAmountNeverZero()` in `src/shared/amountDisplay.js`, applied to the exact decimal string (the stored balance, or the output of `formatEther()` / `formatUnits()`), never to a JavaScript number. That covers the balance lists, Home's ETH balance, history rows (`src/shared/transactions.js`, which uses `truncateAmount()` today), Send's current balance and the screens that state what is authorized.
- TransactionDetail keeps the exact amount and base units. "quantity unknown" stays as it is.
- USD values may still be computed from a parsed number; only the shown quantity changes.
- `truncateAmount()` stays only as the step inside `truncateAmountNeverZero()`, or goes if nothing else calls it.
- `README.md` "Amounts": replace the sentences saying the balance lists round and history rows cut without the floor with the one rule.
Files: `src/popup/views/helpers.js`, `src/popup/views/home.js`, `src/shared/transactions.js`, `src/shared/amountDisplay.js` if needed, `README.md`, tests. No new module.
## Definition of done
- Tests, failing on current `next`: `0.99996` ETH renders `0.9999` in the balance list and in Home's ETH line; `0.00004` renders `0.00004` in the balance list and in a history row.
- No screen formats an amount with `toFixed()`.
- `make check` green. Gate runs: `flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild`.
Model: opus-5-5
clawbot
self-assigned this 2026-11-10 20:54:17 +01:00
clawbot
added this to the 1.0.0 milestone 2026-11-10 20:54:24 +01:00
Built in #768. The balance lists, Home's ETH line and history rows now show amounts through truncateAmountNeverZero().
For the owner: RULES.md Display Consistency says "exactly 4 decimal places in all summary views". The floor this issue asks for shows an amount below 0.0001 in the lists with more places, such as 0.00004. RULES.md is unchanged.
Model: opus-5-5
Built in https://git.eeqj.de/sneak/AutistMask/pulls/768. The balance lists, Home's ETH line and history rows now show amounts through `truncateAmountNeverZero()`.
For the owner: `RULES.md` Display Consistency says "exactly 4 decimal places in all summary views". The floor this issue asks for shows an amount below 0.0001 in the lists with more places, such as `0.00004`. `RULES.md` is unchanged.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The balance lists and Home's ETH balance round amounts with
Number.toFixed(4)(balanceLine()insrc/popup/views/helpers.js, the ETH line insrc/popup/views/home.js). Every other screen cuts throughsrc/shared/amountDisplay.js. So one balance reads two ways:1.0000 ETHin the balance list, more than the address holds, and0.9999 ETHas Send's current balance;0.0000 USDCin the balance list and0.00004 USDCon Send.The rule:
RULES.mdDisplay Consistency, "Same data formatted identically across all screens". sneak'sREADME.mdtext behind it: "If a formatting rule applies in one place, it applies in every place. Users should never see the same value rendered differently on two screens."Found in the
RULES.mdread on #672 (comment).Fix
truncateAmountNeverZero()insrc/shared/amountDisplay.js, applied to the exact decimal string (the stored balance, or the output offormatEther()/formatUnits()), never to a JavaScript number. That covers the balance lists, Home's ETH balance, history rows (src/shared/transactions.js, which usestruncateAmount()today), Send's current balance and the screens that state what is authorized.truncateAmount()stays only as the step insidetruncateAmountNeverZero(), or goes if nothing else calls it.README.md"Amounts": replace the sentences saying the balance lists round and history rows cut without the floor with the one rule.Files:
src/popup/views/helpers.js,src/popup/views/home.js,src/shared/transactions.js,src/shared/amountDisplay.jsif needed,README.md, tests. No new module.Definition of done
next:0.99996ETH renders0.9999in the balance list and in Home's ETH line;0.00004renders0.00004in the balance list and in a history row.toFixed().make checkgreen. Gate runs:flock -w 3600 /srv/code/tmp/.autistmask-gate.lock script/cibuild.Model: opus-5-5
Built in #768. The balance lists, Home's ETH line and history rows now show amounts through
truncateAmountNeverZero().For the owner:
RULES.mdDisplay Consistency says "exactly 4 decimal places in all summary views". The floor this issue asks for shows an amount below 0.0001 in the lists with more places, such as0.00004.RULES.mdis unchanged.Model: opus-5-5