fix: unify address display with shared renderAddressHtml utility #129
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/AutistMask#129
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/issue-97-address-display-consistency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
All address rendering now uses a single
renderAddressHtml()function in helpers.js that produces consistent output everywhere:Changes
Refactored all 9 view files that display addresses to use the shared utility:
Consolidation
EXT_ICONSVG constant: removed 6 duplicates, now in helpers.jscopyableHtml(): removed duplicate, now in helpers.jsetherscanLinkHtml(): removed duplicates, now in helpers.jsattachCopyHandlers(): removed duplicate, now in helpers.jscloses #97
Work Summary
Problem
Addresses were rendered inconsistently across the extension — each view had its own local address rendering function with different features. The approve-tx view specifically lacked click-to-copy affordance (no dashed underline) and was visually different from other views.
Solution
Created a unified
renderAddressHtml()function inhelpers.jsthat all views now use. Every address display now has:underline decoration-dashed cursor-pointerstylingdata-copyattribute for click-to-copyFiles Changed (10)
renderAddressHtml(),copyableHtml(),attachCopyHandlers(),etherscanAddressUrl(),etherscanLinkHtml(),EXT_ICONconstant. UpdatedformatAddressHtml()to delegate torenderAddressHtml().approvalAddressHtmlnow delegates torenderAddressHtml. AddedattachCopyHandlerscalls for approve-tx, approve-sign, and approve-site views. Removed dead code (unusedetherscanTokenLink,tLinkvariable, no-op string replace).confirmAddressHtmluses blockie +renderAddressHtml. Token contract usesrenderAddressHtml.toAddressHtmldelegates torenderAddressHtml.txHashHtml/blockNumberHtmluse sharedcopyableHtml/etherscanLinkHtml.txAddressHtmldelegates torenderAddressHtml. Decoded calldata addresses userenderAddressHtml.renderAddressHtml.renderAddressHtml.formatAddressHtml(which delegates). Etherscan link now included in address output.renderAddressHtml.renderAddressHtml.Consolidated
EXT_ICONSVG constants → 1 in helpers.jscopyableHtml()→ 1 in helpers.jsetherscanLinkHtml()/etherscanAddressLink()→ shared in helpers.jsattachCopyHandlers()Verification
make fmtpassesdocker build .passes (includesmake check)Review: PASS ✅
Reviewed PR #129 closing issue #97.
Summary
This PR creates a unified
renderAddressHtml()function inhelpers.jsand refactors all 10 view files to use it. The result is consistent address display everywhere: color dot, full address with dashed-underline click-to-copy affordance, and etherscan external link.Findings
Correctness:
renderAddressHtml()output matches the README spec (color dot, full untruncated address, etherscan link, click-to-copy with dashed underline)attachCopyHandlers()wired up after DOM insertionformatAddressHtml()properly delegates torenderAddressHtml()for backward compatibilityConsolidation:
EXT_ICONconstants consolidated to 1 in helpers.jscopyableHtml(),etherscanLinkHtml(),attachCopyHandlers()consolidatedNo regressions detected:
addressDotHtmluses in home.js, addressDetail.js, addressToken.js are in transaction list row rendering (truncated counterparty addresses in history lists), which is appropriate per README truncation policydocker build .passes (includesmake check: formatting, linting, tests).Branch is already based on current
main, no rebase needed.Review: PASS ✅
Summary
This PR successfully unifies all address rendering across 9 view files into a single
renderAddressHtml()utility in helpers.js. The consolidation is clean, correct, and achieves the goal of issue #97.What was reviewed
renderAddressHtml,copyableHtml,attachCopyHandlers,etherscanAddressUrl,etherscanLinkHtml,EXT_ICON). Well-structured with clear JSDoc-style comments. The existingformatAddressHtmlnow delegates torenderAddressHtml— good backward compat.EXT_ICONconstants (6 copies),copyableHtml,etherscanLinkHtml, andattachCopyHandlersfunctions removed.address-lineandaddress-token-linewrapper elements exist in index.html — theinnerHTMLreplacement approach is correct.parentElementofexport-privkey-dotto replace both dot and address spans — verified the<p>parent structure is correct.address-enselement and renders ENS insiderenderAddressHtmlinstead — consistent with all other views.Non-blocking notes
etherscanTokenLink()is defined but never called. Minor cleanup opportunity.etherscan.io/token/...and now link toetherscan.io/address/.... Both URLs work on Etherscan, but/token/shows token-specific info (holders, price, transfers). This is a minor UX difference — could be addressed in a follow-up by adding anetherscanTokenUrloption torenderAddressHtml, but not blocking.Checks
make fmt-check— passesmake lint— passesmake test— 15/15 tests passmake build— builds successfullydocker build .— passes@clawbot needs conflict fix
@clawbot no progress? why?
69ab946c82toe0886c97e0Rework: Merge conflicts resolved
Rebased
fix/issue-97-address-display-consistencyonto currentmain.Conflict resolved
src/popup/views/transactionDetail.js— The only conflicting file. PR #118 (confirm-tx warnings) added agetTransactionType()function and a localcopyableHtml()at the top of the file. PR #129 had removed the localcopyableHtml()since it was consolidated intohelpers.js.Resolution: Kept
getTransactionType()from main (PR #118 functionality), removed the localcopyableHtml()duplicate (PR #129 consolidated it into the shared import from helpers.js). Both sets of changes are preserved.approval.jsandconfirmTx.jsauto-merged cleanly.Verification
make fmt— passes (all files unchanged except one trailing blank line fix)docker build .— passesReview: PASS ✅ (post-rebase)
Reviewed PR #129 closing issue #97 after rebase onto current
main.Rebase Correctness
getTransactionType()from PR #118 is present and intact (lines 29–44 oftransactionDetail.js)copyableHtml()duplicate correctly removed — now imported from sharedhelpers.jsCode Review
renderAddressHtml()in helpers.js is well-structured: color dot, optional title/ENS, copyable address with dashed underline, etherscan linkEXT_ICONSVG consolidated from 6+ duplicates into single exportcopyableHtml(),attachCopyHandlers(),etherscanLinkHtml(),etherscanAddressUrl()all properly exported and usedformatAddressHtml()now delegates torenderAddressHtml()for backward compatibilityIntegrity
docker build .passes (includesmake check— formatting, linting, tests)Verdict
Branch is already up-to-date with
main. Clean refactor, no functionality dropped, both PR #118 and #129 features intact. Ready to merge.e0886c97e0to33070cae75Second rebase completed — rebased onto current
main(post PR #133, PR #136, PR #137, PR #138, PR #141).Resolved 9 conflicting files. Key changes during conflict resolution:
renderAddressHtmlapproach (removing per-view localEXT_ICON,etherscanAddressLink,etherscanTokenLinkfunctions)etherscanAddressUrlin helpers.js to usecurrentNetwork().explorerUrlinstead of hardcodedetherscan.io(required for Sepolia testnet support from PR #137)etherscan.ioURLs in txStatus.js (txHashHtml,blockNumberHtml) to usecurrentNetwork().explorerUrlcurrentNetworkimports from addressDetail.js, addressToken.js, home.js, send.jsmake fmt— all formatting cleandocker build .passes: 49/49 tests, linting, formatting, build all greenReview: PASS ✅ (post-second-rebase)
Reviewed PR #129 closing issue #97 after second rebase (post PR #133, PR #136, PR #137, PR #138, PR #141).
Rebase Correctness
getTransactionType()from PR #118 preserved intact intransactionDetail.jsEXT_ICON,etherscanAddressLink,etherscanTokenLink,copyableHtml,attachCopyHandlersremoved — consolidated intohelpers.jsCode Quality
renderAddressHtml()inhelpers.jsis well-structured with clean JSDoc: color dot, optional title/ENS, copyable address with dashed underline, etherscan link. SupportsmaxLen,noLinkoptions.formatAddressHtml()properly delegates torenderAddressHtml()for backward compatibilityetherscanAddressUrl()correctly usescurrentNetwork().explorerUrl— works for both mainnet and SepoliacurrentNetworkimports fromaddressDetail.js,addressToken.js,home.js,send.jsNetwork-Aware URLs
etherscan.ioURLs remain insrc/popup/views/— all view code usescurrentNetwork().explorerUrletherscan.ioreferences are only innetworks.js(defining base URLs),etherscanLabels.js(comment), andphishingBlocklist.json— all appropriatetxStatus.jstxHashHtml()andblockNumberHtml()now use sharedcopyableHtml()+etherscanLinkHtml()with dynamic explorer URLsIntegrity
docker build .passes (includesmake check: formatting, linting, all tests)main(single commit, no rebase needed)Non-blocking Note
etherscanTokenLink()intxStatus.js(line 112) is dead code — defined but never called. Minor cleanup opportunity for a follow-up.Verdict
Clean, well-executed consolidation. All 9 rebase conflicts resolved correctly. Network-aware URLs throughout. Ready to merge.
Labels fixed: applied
merge-ready, removedbot, assigned to sneak. The reviewer posted PASS three times but never completed the state transition (applying the label). SDLC manager should verify label state after reviewer agents complete.33070cae75to8622988a6eRebased onto current main, resolved conflict in addressToken.js (removed local EXT_ICON/etherscanAddressLink/etherscanTokenLink that were moved to helpers.js).
docker build .passes. Ready to merge.8622988a6eto5395fc6edeRebased onto main (resolved conflict in
src/popup/views/addressToken.js— removed oldEXT_ICON/etherscanAddressLink/etherscanTokenLinkfunctions that were replaced by the sharedrenderAddressHtmlutility).docker build .andmake fmtpass clean.