Skip to content

feat(web): show transaction note in nonce replacement label - #8179

Merged
Zalens (Zalens) merged 1 commit into
safe-global:devfrom
tenderdeve:feat/7517-tx-builder-nonce-notes
Aug 24, 2026
Merged

Zalens (Zalens) merged 1 commit into
safe-global:devfrom
tenderdeve:feat/7517-tx-builder-nonce-notes

Conversation

@tenderdeve

Copy link
Copy Markdown
Contributor

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, the txLabel derivation now prefers transaction.note (trimmed) when present, then falls back to the existing humanDescription, 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

  1. Create a transaction via Transaction Builder with a note (e.g. "Treasury payout") and queue it for some nonce N.
  2. Start a new transaction and open the nonce selector.
  3. The entry for nonce N should display "Treasury payout" instead of "Transaction Builder transaction".
  4. Remove the note and confirm the label falls back to the previous behavior.

Unit tests in TxNonce.test.tsx cover: note present, note missing (fallback to human description), whitespace-only note, and no queued tx for the nonce.

Affected flows

  • New transaction → nonce selector → "Replace existing nonce" option labels

Blast radius

  • apps/web/src/components/tx-flow/common/TxNonce/index.tsx — purely label-derivation change inside NonceFormOption. No consumers, no API/store/route changes. transaction.note already exists on the TransactionSummary type from @safe-global/safe-gateway-typescript-sdk.

Risks / not checked

  • Did not test on mobile (web-only component).
  • Did not exercise localization of the fallback strings (none added/changed).
  • Did not verify behavior across every txInfo.type variant — only the label string is affected, no behavior changes.

Visual summary

Label resolution order: transaction.note?.trim() → transaction.txInfo.humanDescription → "<type> transaction".

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻
  • I've listed affected flows and blast radius, and named what I did not verify 🎯

@tenderdeve

Copy link
Copy Markdown
Contributor Author

Hi Daniel Dimitrov (@compojoom) — gentle ping when you have a moment. PR resolves #7517 (nonce replacement label now prefers transaction.note). CI green, unit tests included. Happy to adjust scope or reviewer assignment.

@Zalens

Copy link
Copy Markdown
Member

Thanks TenderDeve (@tenderdeve), I've verified locally and reproduced in the browser, code LGTM. One blocker before it can land: the commit is unsigned.

@tenderdeve
TenderDeve (tenderdeve) force-pushed the feat/7517-tx-builder-nonce-notes branch from c46bb57 to ab035b7 Compare August 12, 2026 06:51
@tenderdeve

Copy link
Copy Markdown
Contributor Author

Zalens (@Zalens) signing sorted — re-signed the change with my SSH key in ab035b78e (now shows Verified). Also linearized onto main so it's a single clean commit; diff is unchanged. Ready to land.

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.
@tenderdeve
TenderDeve (tenderdeve) force-pushed the feat/7517-tx-builder-nonce-notes branch from ab035b7 to 7cf1f57 Compare August 12, 2026 06:56
@tenderdeve

Copy link
Copy Markdown
Contributor Author

Rebased onto dev in 7cf1f574f — conflicts resolved (the nonce-dropdown Base UI Combobox refactor landed on dev meanwhile; kept both test describe blocks and aligned my note-label tests to the async userEvent.click + findByRole('listbox') open pattern). Commit is signed/Verified, single clean commit, now mergeable. index.tsx note change is unchanged.

@Zalens

Copy link
Copy Markdown
Member

Please fix the broken tests TenderDeve (@tenderdeve)

@tenderdeve

Copy link
Copy Markdown
Contributor Author

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:

Test Suites: 836 passed, 836 total
Tests:       7170 passed, 7170 total

What turns the job red is the step after Jest — "Annotations and coverage report":

Jest coverage report action failed
HttpError: Resource not accessible by integration
Missing `checks: write` permission

That's the known fork-PR limitation: GitHub only grants the default GITHUB_TOKEN read scope for workflows triggered from a fork, so the coverage action can't write check annotations. It fails regardless of the diff — same reason the smoke/bundle/deploy checks are red here. Nothing in the two changed files (TxNonce/index.tsx + its test) fails.

Re-running the workflow from within the repo (or from a maintainer's workflow_dispatch) should give it the checks: write scope and go green. Let me know if you'd like me to change anything on the code itself — otherwise this is ready from my side.

@Zalens
Zalens (Zalens) merged commit 33bde85 into safe-global:dev Aug 24, 2026
11 of 19 checks passed
@Safe-infra Safe Infra (Safe-infra) mentioned this pull request Sep 9, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TX Builder] Identify existing nonces by Notes, if available

2 participants