Skip to content

Transaction toaster: copy hash and open-in-explorer actions - #994

Merged
zerts merged 2 commits into
mainfrom
toaster-copy-hash-explorer-actions
Sep 24, 2026
Merged

zerts merged 2 commits into
mainfrom
toaster-copy-hash-explorer-actions

Conversation

@zerts

@zerts zerts commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Extracts the transaction toaster improvement from #980 (intent-based swaps) into its own PR so it can land independently. None of the intent-swap machinery (Order steps, "Still processing" terminal, new queue events) is included.

  • In the success state the pill shows two ghost buttons on the right: copy transaction hash (flips to a check mark on success) and open in explorer. Each renders only when its target exists.
  • The hash comes from the existing step-pending event. The explorer link uses a new optional explorerUrlTemplate on ToasterView and falls back to the explorer URL stored on the local transaction's address action. Send and approve steps use the input chain explorer; swap/bridge steps prefer the quote provider's explorer (quote.contractMetadata.explorer.txUrl, e.g. a bridge tracker) and fall back to the input chain.
  • Hover / focus holds the pill open: the auto-dismiss countdown pauses while the pointer or focus is inside the pill and resumes on leave with a 1s grace period. The hold is released explicitly when the pill exits so the next session still auto-dismisses.
  • The pill is now a div with role="button" / tabIndex={0} since it nests interactive elements. Enter/Space on a nested action activates the action only; pointer-down on an action does not start a drag.

Files

  • Toaster/ToasterActions.tsx (new, verbatim from Intent based swaps #980)
  • Toaster/useToasterTarget.ts (new, simplified: hash-only matching, no Order ids)
  • Toaster/useToasterSession.ts: hash tracking, setHovered with pause/resume
  • Toaster/TransactionToaster.tsx, Toaster/styles.module.css
  • TransactionSigner/types.ts: explorerUrlTemplate? on ToasterView
  • SendForm2.tsx, SwapForm2.tsx, PerpsDeposit.tsx: pass the template

Verification

tsc --noEmit, eslint and prettier pass on the changed files. Manual QA of the success-state buttons is still to be done.

🤖 Generated with Claude Code

Extracted from the intent-based swaps branch (#980) so the toaster
improvement can land on its own.

In the success state the pill now shows two ghost buttons on the right:
copy the transaction hash (with a check-mark confirmation) and open the
transaction in the block explorer. The hash is recorded from the
`step-pending` broadcast event; the explorer link uses the
`explorerUrlTemplate` the step was enqueued with (now set by Send, Swap
and Perps deposit forms) and falls back to the URL stored on the local
transaction's address action.

Hovering or focusing the pill pauses the auto-dismiss countdown so the
actions stay reachable, and resumes with a short grace period on leave.
The pill is a div with role="button" since it now nests interactive
elements; Enter/Space on a nested action no longer also navigates.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

📦 build.zip [updated at Sep 24, 2:13:52 PM UTC]

For swap and bridge steps the explorer template now comes from
`quote.contractMetadata.explorer.txUrl` when the provider supplies one
(a bridge tracker that follows both legs), falling back to the input
chain's explorer. Approve steps keep the input chain explorer since the
provider's tracker wouldn't know the approval hash.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@zerts
zerts merged commit 46684f3 into main Sep 24, 2026
3 checks passed
@zerts
zerts deleted the toaster-copy-hash-explorer-actions branch September 24, 2026 14:18
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.

1 participant