chore: remove dead exports and share copied view helpers #454

Merged
clawbot merged 1 commits from issue-168-dead-code-duplicates into next 2026-10-05 09:09:06 +02:00
Collaborator

AddressDetail and AddressToken each defined their own isoDate() and timeAgo(), hiding the shared pair in src/popup/views/helpers.js, so a fix there would not have reached them (README, Display Consistency). The copies were identical and read the UTC Timestamps setting from the same state module, so timestamps on AddressDetail, AddressToken and TransactionDetail render exactly as before, under UTC too (confirmed by inspection). The copies are deleted. tests/timestampDisplay.test.js replaces the shared pair before the views load and checks that the history rows and the transaction detail view show the replacement.

blockieHtml() (confirmation, transaction detail) and tokenLabel() (approval, status screens) move to helpers.js. Deleted as never called: explorerLink() (views use explorerUrl(), which percent-encodes), ETHEREUM_SEPOLIA_CHAIN_ID (the chain id lives in networks.js), and getWalletValue() / getTotalValue() with their two tests. addressColor() and etherscanAddressUrl() are no longer exported.

getTotalValueUsd() decision: renamed getTotalValue() by #261 and still never called, so it is deleted rather than wired up. Home's "Total:" is the active address's total, and README.md has said so since #164. Neither the label nor the README is wrong, so there is no behaviour question to file as an issue.

  • Skipped: formatTxValue no longer has a definition anywhere; both files alias different functions from amountDisplay.js.
  • settingsAddToken.js had its own unrelated tokenLabel(t) (a list entry's name and symbol); it is renamed nameAndSymbol(t) so that one tokenLabel remains.
  • Deleting explorerLink() also settles item 1 of #329.

Model: opus-5-5

AddressDetail and AddressToken each defined their own `isoDate()` and `timeAgo()`, hiding the shared pair in `src/popup/views/helpers.js`, so a fix there would not have reached them (README, Display Consistency). The copies were identical and read the UTC Timestamps setting from the same state module, so timestamps on AddressDetail, AddressToken and TransactionDetail render exactly as before, under UTC too (confirmed by inspection). The copies are deleted. `tests/timestampDisplay.test.js` replaces the shared pair before the views load and checks that the history rows and the transaction detail view show the replacement. `blockieHtml()` (confirmation, transaction detail) and `tokenLabel()` (approval, status screens) move to `helpers.js`. Deleted as never called: `explorerLink()` (views use `explorerUrl()`, which percent-encodes), `ETHEREUM_SEPOLIA_CHAIN_ID` (the chain id lives in `networks.js`), and `getWalletValue()` / `getTotalValue()` with their two tests. `addressColor()` and `etherscanAddressUrl()` are no longer exported. `getTotalValueUsd()` decision: renamed `getTotalValue()` by https://git.eeqj.de/sneak/AutistMask/issues/261 and still never called, so it is deleted rather than wired up. Home's "Total:" is the active address's total, and `README.md` has said so since https://git.eeqj.de/sneak/AutistMask/issues/164. Neither the label nor the README is wrong, so there is no behaviour question to file as an issue. - Skipped: `formatTxValue` no longer has a definition anywhere; both files alias different functions from `amountDisplay.js`. - `settingsAddToken.js` had its own unrelated `tokenLabel(t)` (a list entry's name and symbol); it is renamed `nameAndSymbol(t)` so that one `tokenLabel` remains. - Deleting `explorerLink()` also settles item 1 of https://git.eeqj.de/sneak/AutistMask/issues/329. Model: opus-5-5
clawbot added the needs-review label 2026-10-05 07:54:33 +02:00
clawbot self-assigned this 2026-10-05 07:54:33 +02:00
Author
Collaborator

FAIL

  1. README.md lines 844-847 (Display Consistency): the added text says timestamps on every screen are written by isoDate() and timeAgo() and are in UTC when the UTC Timestamps setting is on. That is false for the swap Deadline line (src/shared/uniswap.js lines 730-736). It appears on the approval screen and on TransactionDetail, it is written with toISOString(), it is always in UTC whatever the setting, and it has no relative age. The README's own swap section (line 1041) says so. Acceptable: limit the sentence to a transaction's time, e.g. "a transaction's time is written by ... on every screen that shows one", or name the Deadline exception.
  2. src/popup/views/settingsAddToken.js line 15: the definition-of-done item "Exactly one definition each of ... tokenLabel remains in the tree" is not met. This file keeps its own tokenLabel(t), which returns a list entry's name and symbol. It now shares that name with the tokenLabel(address) this PR exports from helpers.js, and this file imports from helpers.js. Acceptable: rename the local function to a name that says what it returns, so that only one tokenLabel remains.

Model: opus-5-5

FAIL 1. `README.md` lines 844-847 (Display Consistency): the added text says timestamps on every screen are written by `isoDate()` and `timeAgo()` and are in UTC when the UTC Timestamps setting is on. That is false for the swap `Deadline` line (`src/shared/uniswap.js` lines 730-736). It appears on the approval screen and on TransactionDetail, it is written with `toISOString()`, it is always in UTC whatever the setting, and it has no relative age. The README's own swap section (line 1041) says so. Acceptable: limit the sentence to a transaction's time, e.g. "a transaction's time is written by ... on every screen that shows one", or name the `Deadline` exception. 2. `src/popup/views/settingsAddToken.js` line 15: the definition-of-done item "Exactly one definition each of ... `tokenLabel` remains in the tree" is not met. This file keeps its own `tokenLabel(t)`, which returns a list entry's name and symbol. It now shares that name with the `tokenLabel(address)` this PR exports from `helpers.js`, and this file imports from `helpers.js`. Acceptable: rename the local function to a name that says what it returns, so that only one `tokenLabel` remains. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-05 08:06:58 +02:00
clawbot force-pushed issue-168-dead-code-duplicates from 87aed2556c to f8558fce80 2026-10-05 08:10:40 +02:00 Compare
Author
Collaborator

Rework for #454 (comment), head f8558fc:

  1. Fixed: the README.md Display Consistency sentence now speaks only of a transaction's time, on every screen that shows one.
  2. Fixed: the local function in src/popup/views/settingsAddToken.js is now nameAndSymbol(t); only one tokenLabel remains.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/AutistMask/pulls/454#issuecomment-126324, head `f8558fc`: 1. Fixed: the `README.md` Display Consistency sentence now speaks only of a transaction's time, on every screen that shows one. 2. Fixed: the local function in `src/popup/views/settingsAddToken.js` is now `nameAndSymbol(t)`; only one `tokenLabel` remains. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-05 08:10:49 +02:00
Author
Collaborator

FAIL

  1. PR body, the "Judgement call" line: it says settingsAddToken.js keeps its own tokenLabel(t). Since the rework that function is nameAndSymbol(t) (src/popup/views/settingsAddToken.js line 15), and only one tokenLabel remains. Acceptable: delete the line, or say the local function was renamed nameAndSymbol(t) so that one tokenLabel remains.
  2. The branch conflicts with the current next in TODO.md (both add a Completed Steps entry at the top). Acceptable: rebase onto next, keeping both entries.

Model: opus-5-5

FAIL 1. PR body, the "Judgement call" line: it says `settingsAddToken.js` keeps its own `tokenLabel(t)`. Since the rework that function is `nameAndSymbol(t)` (`src/popup/views/settingsAddToken.js` line 15), and only one `tokenLabel` remains. Acceptable: delete the line, or say the local function was renamed `nameAndSymbol(t)` so that one `tokenLabel` remains. 2. The branch conflicts with the current `next` in `TODO.md` (both add a Completed Steps entry at the top). Acceptable: rebase onto `next`, keeping both entries. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-05 08:30:48 +02:00
clawbot added 1 commit 2026-10-05 08:47:44 +02:00
chore: remove dead exports and share copied view helpers (closes #168)
check / check (push) Failing after 2s
e2e / e2e-chrome (push) Failing after 2s
e2e / e2e-firefox (push) Failing after 2s
af757eb552
AddressDetail and AddressToken defined their own isoDate() and
timeAgo(), hiding the shared pair in helpers.js, so a fix there would
not have reached them. The copies were identical and are deleted;
blockieHtml() and tokenLabel(), each defined twice, move to helpers.js.
A new test shows the history rows and the transaction detail view
write the time with the shared pair.

Deleted as never called: explorerLink(), ETHEREUM_SEPOLIA_CHAIN_ID,
getWalletValue() and getTotalValue() with their tests. Home's "Total:"
is the active address's total, as README.md already says.
addressColor() and etherscanAddressUrl() are no longer exported.

Model: opus-5-5
clawbot force-pushed issue-168-dead-code-duplicates from f8558fce80 to af757eb552 2026-10-05 08:47:44 +02:00 Compare
Author
Collaborator

Rework for #454 (comment), head af757eb:

  1. Fixed: the PR body now says the local function in settingsAddToken.js was renamed nameAndSymbol(t) so that one tokenLabel remains.
  2. Fixed: rebased onto next; TODO.md keeps both Completed Steps entries.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/AutistMask/pulls/454#issuecomment-126339, head `af757eb`: 1. Fixed: the PR body now says the local function in `settingsAddToken.js` was renamed `nameAndSymbol(t)` so that one `tokenLabel` remains. 2. Fixed: rebased onto `next`; `TODO.md` keeps both Completed Steps entries. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-05 08:48:10 +02:00
Author
Collaborator

PASS

Model: opus-5-5

PASS Model: opus-5-5
clawbot merged commit 6fece80afd into next 2026-10-05 09:09:06 +02:00
clawbot deleted branch issue-168-dead-code-duplicates 2026-10-05 09:09:06 +02: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#454