Repository navigation
feat(web): show transaction note in nonce replacement label - #8179
Conversation
|
Hi Daniel Dimitrov (@compojoom) — gentle ping when you have a moment. PR resolves #7517 (nonce replacement label now prefers |
|
Thanks TenderDeve (@tenderdeve), I've verified locally and reproduced in the browser, code LGTM. One blocker before it can land: the commit is unsigned. |
c46bb57 to
ab035b7
Compare
|
Zalens (@Zalens) signing sorted — re-signed the change with my SSH key in |
Closes safe-global#7517 When choosing to overwrite an existing nonce, prefer the transaction's note (origin['note']) over the generic transaction type label. Falls back to the human description, then the transaction type when the note is missing or whitespace-only.
ab035b7 to
7cf1f57
Compare
|
Rebased onto |
|
Please fix the broken tests TenderDeve (@tenderdeve) |
|
Zalens (@Zalens) I dug into the red "Web Unit tests" check — the tests themselves aren't broken. The Jest run in that job passes fully: What turns the job red is the step after Jest — "Annotations and coverage report": That's the known fork-PR limitation: GitHub only grants the default Re-running the workflow from within the repo (or from a maintainer's |
What it solves
Resolves: #7517
When the user opens the nonce selector to replace an existing transaction, queued transactions are labeled generically (e.g. "Transaction Builder transaction"). The issue requests preferring the transaction's note (from
origin['note']) so users can identify what they're about to overwrite.How this PR fixes it
In
apps/web/src/components/tx-flow/common/TxNonce/index.tsx, thetxLabelderivation now preferstransaction.note(trimmed) when present, then falls back to the existinghumanDescription, then the transaction-type label. Whitespace-only notes are treated as missing so a stray space doesn't replace a useful label with blanks.How to test it
Unit tests in
TxNonce.test.tsxcover: note present, note missing (fallback to human description), whitespace-only note, and no queued tx for the nonce.Affected flows
Blast radius
apps/web/src/components/tx-flow/common/TxNonce/index.tsx— purely label-derivation change insideNonceFormOption. No consumers, no API/store/route changes.transaction.notealready exists on theTransactionSummarytype from@safe-global/safe-gateway-typescript-sdk.Risks / not checked
txInfo.typevariant — only the label string is affected, no behavior changes.Visual summary
Label resolution order:
transaction.note?.trim()→transaction.txInfo.humanDescription→"<type> transaction".Checklist