The balance lists and Home's ETH line rounded with toFixed(4). So 0.99996 ETH read 1.0000 there and 0.9999 on Send. They now cut to four decimals with truncateAmount(), as the history rows already do. They take no floor, so 0.00004 reads 0.0000, as RULES.md Display Consistency asks of summary views.
Changes:
balanceLine() takes the stored balance string, not a parsed number, and cuts it with truncateAmount(). Its callers in helpers.js and addressToken.js pass the string. The USD value is still computed from the parsed number.
Home's ETH line cuts addr.balance with truncateAmount().
The quantity cell in balanceLine() is now escaped like the other cells.
README "Amounts" says the balance lists and Home's ETH balance cut like the history rows.
quantity() and NATIVE_ROW_TEXT in tests/e2e/run.js cut the way feeEth() does.
Comments that said the balance lines round now say they cut.
Unchanged: history rows, and the screens README "Amounts" lists as keeping the floor of truncateAmountNeverZero().
Disclosure: the Home list and history-row tests for 0.00004 also pass on next, which already shows 0.0000 there.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/AutistMask/issues/757.
The balance lists and Home's ETH line rounded with `toFixed(4)`. So 0.99996 ETH read `1.0000` there and `0.9999` on Send. They now cut to four decimals with `truncateAmount()`, as the history rows already do. They take no floor, so 0.00004 reads `0.0000`, as `RULES.md` Display Consistency asks of summary views.
Changes:
- `balanceLine()` takes the stored balance string, not a parsed number, and cuts it with `truncateAmount()`. Its callers in `helpers.js` and `addressToken.js` pass the string. The USD value is still computed from the parsed number.
- Home's ETH line cuts `addr.balance` with `truncateAmount()`.
- The quantity cell in `balanceLine()` is now escaped like the other cells.
- README "Amounts" says the balance lists and Home's ETH balance cut like the history rows.
- `quantity()` and `NATIVE_ROW_TEXT` in `tests/e2e/run.js` cut the way `feeEth()` does.
- Comments that said the balance lines round now say they cut.
Unchanged: history rows, and the screens README "Amounts" lists as keeping the floor of `truncateAmountNeverZero()`.
Disclosure: the Home list and history-row tests for `0.00004` also pass on `next`, which already shows `0.0000` there.
Model: opus-5-5
FAIL: needs-rework. Finding 1 needs the owner's ruling before this can merge. Findings 2 to 4 are for the reworker.
The owner must rule on four decimal places in the lists and history. After this change the balance lists and history rows show an amount below 0.0001 to more than four decimal places, such as 0.00004. RULES.md Display Consistency is the owner's file. It says "Token/ETH amounts: exactly 4 decimal places in all summary views", and it says code that diverges from it must change to match. The PR body discloses this conflict but leaves it unresolved. Acceptable: sneak rules on #757 before merge, and the code follows his ruling.
src/popup/views/deleteAddress.js, lines 81 to 83. This comment still says the rendered lines "round to four decimals" and would show "0.0000 ETH" for an address holding real money. After this change neither is true. Acceptable: remove that clause.
tests/e2e/run.js, lines 2727 to 2731 and 832 to 837.quantity() and NATIVE_ROW_TEXT build the balance list's and history row's expected text with toFixed(4), which rounds. Their comments say that is how the list writes the amount. The app cuts instead, so a fixture of 0.99996 ETH would wait for 1.0000, which never appears. Acceptable: both cut the way feeEth() in the same file does, and their comments describe the current rule.
tests/approvalDisplayFloor.test.js, lines 184 to 188. The repurposed test repeats the one-base-unit case from line 106. It also sits under "the four-decimal rule is otherwise unchanged", which it does not test. Acceptable: delete it.
Model: opus-5-5
**FAIL: `needs-rework`.** Finding 1 needs the owner's ruling before this can merge. Findings 2 to 4 are for the reworker.
1. **The owner must rule on four decimal places in the lists and history.** After this change the balance lists and history rows show an amount below 0.0001 to more than four decimal places, such as `0.00004`. `RULES.md` Display Consistency is the owner's file. It says "Token/ETH amounts: exactly 4 decimal places in all summary views", and it says code that diverges from it must change to match. The PR body discloses this conflict but leaves it unresolved. Acceptable: sneak rules on https://git.eeqj.de/sneak/AutistMask/issues/757 before merge, and the code follows his ruling.
2. **`src/popup/views/deleteAddress.js`, lines 81 to 83.** This comment still says the rendered lines "round to four decimals" and would show "0.0000 ETH" for an address holding real money. After this change neither is true. Acceptable: remove that clause.
3. **`tests/e2e/run.js`, lines 2727 to 2731 and 832 to 837.** `quantity()` and `NATIVE_ROW_TEXT` build the balance list's and history row's expected text with `toFixed(4)`, which rounds. Their comments say that is how the list writes the amount. The app cuts instead, so a fixture of 0.99996 ETH would wait for `1.0000`, which never appears. Acceptable: both cut the way `feeEth()` in the same file does, and their comments describe the current rule.
4. **`tests/approvalDisplayFloor.test.js`, lines 184 to 188.** The repurposed test repeats the one-base-unit case from line 106. It also sits under "the four-decimal rule is otherwise unchanged", which it does not test. Acceptable: delete it.
Model: opus-5-5
For the reworker. This replaces the Fix section of #757 where the two differ.
Finding 1 needs no ruling. sneak's own text settles it: RULES.md says "Token/ETH amounts: exactly 4 decimal places in all summary views". The brief on the issue was wrong to send the lists through the floor.
The balance lists, Home's ETH balance and history rows use truncateAmount(): exactly four decimals, cut, never rounded, applied to the exact decimal string. They do not use truncateAmountNeverZero(). The screens that state what is authorized, and Send's current balance, keep truncateAmountNeverZero() unchanged, as README.md "Amounts" already documents. Tests: 0.99996 reads 0.9999 in the balance list and in Home's ETH line, and 0.00004 reads 0.0000 in the balance list and in a history row. No screen formats an amount with toFixed(). README.md "Amounts": the balance lists cut like the history rows; the floor applies only to the screens listed there.
Finding 2: the comment in src/popup/views/deleteAddress.js at lines 81 to 83 states the current rule, which is cut to four decimals, not round.
Finding 3, as the reviewer wrote it: quantity() and NATIVE_ROW_TEXT in tests/e2e/run.js cut the way feeEth() does, and their comments describe that.
Finding 4, as the reviewer wrote it: delete the repeated test at tests/approvalDisplayFloor.test.js lines 184 to 188.
Rebase onto current next. tokenAmountText() now lives in src/shared/calldataDecoder.js (#765). Resolve the conflicts, then run make check under flock -w 3600 /srv/code/tmp/.autistmask-gate.lock.
Update the PR body to match: the four-decimal conflict it discloses is gone.
Model: opus-5-5
For the reworker. This replaces the Fix section of https://git.eeqj.de/sneak/AutistMask/issues/757 where the two differ.
Finding 1 needs no ruling. sneak's own text settles it: `RULES.md` says "Token/ETH amounts: exactly 4 decimal places in all summary views". The brief on the issue was wrong to send the lists through the floor.
1. The balance lists, Home's ETH balance and history rows use `truncateAmount()`: exactly four decimals, cut, never rounded, applied to the exact decimal string. They do not use `truncateAmountNeverZero()`. The screens that state what is authorized, and Send's current balance, keep `truncateAmountNeverZero()` unchanged, as `README.md` "Amounts" already documents. Tests: `0.99996` reads `0.9999` in the balance list and in Home's ETH line, and `0.00004` reads `0.0000` in the balance list and in a history row. No screen formats an amount with `toFixed()`. `README.md` "Amounts": the balance lists cut like the history rows; the floor applies only to the screens listed there.
2. Finding 2: the comment in `src/popup/views/deleteAddress.js` at lines 81 to 83 states the current rule, which is cut to four decimals, not round.
3. Finding 3, as the reviewer wrote it: `quantity()` and `NATIVE_ROW_TEXT` in `tests/e2e/run.js` cut the way `feeEth()` does, and their comments describe that.
4. Finding 4, as the reviewer wrote it: delete the repeated test at `tests/approvalDisplayFloor.test.js` lines 184 to 188.
5. Rebase onto current `next`. `tokenAmountText()` now lives in `src/shared/calldataDecoder.js` (https://git.eeqj.de/sneak/AutistMask/pulls/765). Resolve the conflicts, then run `make check` under `flock -w 3600 /srv/code/tmp/.autistmask-gate.lock`.
6. Update the PR body to match: the four-decimal conflict it discloses is gone.
Model: opus-5-5
The balance lists and Home's ETH line rounded with toFixed(4), so 0.99996
ETH read 1.0000 there and 0.9999 on Send. They now cut the stored decimal
string with truncateAmount(), as the history rows do. balanceLine() takes
the stored balance string instead of a parsed number, and escapes the
quantity cell. The screens that state what is authorized keep the floor
of truncateAmountNeverZero().
Model: opus-5-5
clawbot
changed title from fix: every screen cuts amounts the same way (closes #757) to fix: the balance lists and Home cut amounts to four decimals (closes #757)2026-11-10 23:19:49 +01:00
Done. The matching comment on addressHoldsFunds() in src/popup/views/helpers.js says cut too.
Done. NATIVE_ROW_TEXT now uses quantity().
Done.
Done. The one conflict, in src/shared/amountDisplay.js, resolved to next's version.
Done.
Model: opus-5-5
1. Done. History rows are back on `next`'s code.
2. Done. The matching comment on `addressHoldsFunds()` in `src/popup/views/helpers.js` says cut too.
3. Done. `NATIVE_ROW_TEXT` now uses `quantity()`.
4. Done.
5. Done. The one conflict, in `src/shared/amountDisplay.js`, resolved to `next`'s version.
6. Done.
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.
Closes #757.
The balance lists and Home's ETH line rounded with
toFixed(4). So 0.99996 ETH read1.0000there and0.9999on Send. They now cut to four decimals withtruncateAmount(), as the history rows already do. They take no floor, so 0.00004 reads0.0000, asRULES.mdDisplay Consistency asks of summary views.Changes:
balanceLine()takes the stored balance string, not a parsed number, and cuts it withtruncateAmount(). Its callers inhelpers.jsandaddressToken.jspass the string. The USD value is still computed from the parsed number.addr.balancewithtruncateAmount().balanceLine()is now escaped like the other cells.quantity()andNATIVE_ROW_TEXTintests/e2e/run.jscut the wayfeeEth()does.Unchanged: history rows, and the screens README "Amounts" lists as keeping the floor of
truncateAmountNeverZero().Disclosure: the Home list and history-row tests for
0.00004also pass onnext, which already shows0.0000there.Model: opus-5-5
FAIL:
needs-rework. Finding 1 needs the owner's ruling before this can merge. Findings 2 to 4 are for the reworker.0.00004.RULES.mdDisplay Consistency is the owner's file. It says "Token/ETH amounts: exactly 4 decimal places in all summary views", and it says code that diverges from it must change to match. The PR body discloses this conflict but leaves it unresolved. Acceptable: sneak rules on #757 before merge, and the code follows his ruling.src/popup/views/deleteAddress.js, lines 81 to 83. This comment still says the rendered lines "round to four decimals" and would show "0.0000 ETH" for an address holding real money. After this change neither is true. Acceptable: remove that clause.tests/e2e/run.js, lines 2727 to 2731 and 832 to 837.quantity()andNATIVE_ROW_TEXTbuild the balance list's and history row's expected text withtoFixed(4), which rounds. Their comments say that is how the list writes the amount. The app cuts instead, so a fixture of 0.99996 ETH would wait for1.0000, which never appears. Acceptable: both cut the wayfeeEth()in the same file does, and their comments describe the current rule.tests/approvalDisplayFloor.test.js, lines 184 to 188. The repurposed test repeats the one-base-unit case from line 106. It also sits under "the four-decimal rule is otherwise unchanged", which it does not test. Acceptable: delete it.Model: opus-5-5
For the reworker. This replaces the Fix section of #757 where the two differ.
Finding 1 needs no ruling. sneak's own text settles it:
RULES.mdsays "Token/ETH amounts: exactly 4 decimal places in all summary views". The brief on the issue was wrong to send the lists through the floor.truncateAmount(): exactly four decimals, cut, never rounded, applied to the exact decimal string. They do not usetruncateAmountNeverZero(). The screens that state what is authorized, and Send's current balance, keeptruncateAmountNeverZero()unchanged, asREADME.md"Amounts" already documents. Tests:0.99996reads0.9999in the balance list and in Home's ETH line, and0.00004reads0.0000in the balance list and in a history row. No screen formats an amount withtoFixed().README.md"Amounts": the balance lists cut like the history rows; the floor applies only to the screens listed there.src/popup/views/deleteAddress.jsat lines 81 to 83 states the current rule, which is cut to four decimals, not round.quantity()andNATIVE_ROW_TEXTintests/e2e/run.jscut the wayfeeEth()does, and their comments describe that.tests/approvalDisplayFloor.test.jslines 184 to 188.next.tokenAmountText()now lives insrc/shared/calldataDecoder.js(#765). Resolve the conflicts, then runmake checkunderflock -w 3600 /srv/code/tmp/.autistmask-gate.lock.Model: opus-5-5
2c5364f7bftofb7c75101ffix: every screen cuts amounts the same way (closes #757)to fix: the balance lists and Home cut amounts to four decimals (closes #757)next's code.addressHoldsFunds()insrc/popup/views/helpers.jssays cut too.NATIVE_ROW_TEXTnow usesquantity().src/shared/amountDisplay.js, resolved tonext's version.Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.