feat(ux): risk-tiered approval colors, hex dump + copy, deep-link Chainlist, typed timeouts#58
Merged
BitHighlander merged 2 commits intodevelopfrom Apr 30, 2026
Merged
Conversation
…inlist, typed timeouts
- RequestMethodCard: color tiers encode risk — blue for read-only signMessage/signOffchainMessage, orange for signTransaction (signs, dApp broadcasts), red+warning icon for signAndSendTransaction (signs and broadcasts; irreversible).
- Off-chain message copy rewritten from dev-speak ('signature is over a Solana-defined wrapper') to user-facing guidance.
- ChainNotEnabledCard now shows known chain names (BNB Smart Chain, Polygon, etc.) above the hex/decimal pair, sourced from KNOWN_EVM_CHAINS. Chainlist link deep-links to /?search=<chainId> so the user lands on the right row.
- RequestDetailsCard: hex fallback formatted as a real hex dump (8 bytes per chunk, newline every 32) instead of one unbroken string. Copy-to-clipboard icon next to the message (CopyIcon → CheckIcon for 1.5s on success). Max-height bumped 240→360px for typical SIWS messages.
- New createTimeoutError helper in utils.ts; Solana/TON/Tron timeout sites use it. methods.ts forwards `kind` on the transaction_error message. Transaction.tsx prefers `errorKind === 'timeout'` over the legacy regex (regex retained as fallback for older error sources). Timeout copy clarifies the next step ('Reject the request in the dApp, then try again.').
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first PR pass added createTimeoutError calls in four solanaHandler timeout paths but never updated the import line — the linter retouched the file before that edit landed and it got silently dropped. ReferenceError on every Solana timeout, type-check failures at lines 354/408/469/511. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UX polish on the approval surfaces shipped in #57.
signMessage/signOffchainMessageare blue (read-only, no funds at risk).signTransactionis orange (you sign; the dApp broadcasts).signAndSendTransactionis red with a warning icon (signs and broadcasts immediately — irreversible).chainlist.org/?search=56lands on BSC's row instead of dumping the user on the homepage.KNOWN_EVM_CHAINS. Stranger chainIds still fall back to mono hex.xxd/hexdump -Cconventions instead of one unbroken hex string.createTimeoutErrorhelper setskind: 'timeout'on the thrown error;methods.tsforwards it ontransaction_error;Transaction.tsxkeys offerrorKind === 'timeout'instead of regex-matching the message string. Regex retained as a legacy fallback. Solana, TON, and Tron timeout sites all converted (~10 call sites).Files
chrome-extension/src/background/utils.ts—ProviderErrorKind,createTimeoutErrorchrome-extension/src/background/methods.ts— forwardkindontransaction_errorchrome-extension/src/background/chains/{solana,ton,tron}Handler.ts— usecreateTimeoutErrorat all 9 timeout throw sitespages/side-panel/src/approval/Transaction.tsx—errorKindstate,kind-based timeout detection, clearer copypages/side-panel/src/approval/ChainNotEnabledCard.tsx— known-name lookup, deep-link Chainlistpages/side-panel/src/approval/other/RequestMethodCard.tsx— risk-tiered colors + revised copypages/side-panel/src/approval/other/RequestDetailsCard.tsx— hex dump formatting, copy button, larger boxTest plan
signMessagefrom a Solana site (e.g. SIWS login) — card is blue, message readable, copy button works (icon turns green for ~1.5s)signTransactionfrom a Solana site — card is orangesignAndSendTransaction— card is red with warning icon0xfffffe) — chain-not-enabled card shows the chainId; Chainlist link openschainlist.org/?search=<decimal>KNOWN_EVM_CHAINSbut not yet provisioned — card shows "BNB Smart Chain" above the hex/decimal pair🤖 Generated with Claude Code