Repository navigation
feat(frontend): add a copyable Stellar explorer link on the success toast (#1741) - #1779
Open
amehsamuel200225-sketch wants to merge 1 commit into
Conversation
|
@amehsamuel200225-sketch Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This branch has not been deployed
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
Closes #1741.
After a successful deposit or withdrawal the user had to open the Transaction History page, find the row, and copy the hash by hand. The success toast now carries the hash itself, a copy control, and a direct explorer link.
Acceptance criteria
getStellarExplorerUrl(hash, networkConfig.isTestnet ? "testnet" : "mainnet"), which readsstellarExplorerBaseUrlsfromsrc/config/network— so aVITE_STELLAR_EXPLORER_URLoverride is honouredcopyTextToClipboard()(Clipboard API with theexecCommandfallback) raisingtoast.success/toast.errorthrough the app's toast systemtruncateHash()(aaaaaaaa...aaaa); the clipboard always receives the full 64-character hashVaultDashboard— strategy pages calltriggerDepositIntent(), which routes into the same deposit handlerWhat changed
frontend/src/components/ToastTransactionRow.tsx(new)The hash row: truncated hash (full value in
title+data-tx-hash), a copy button with idle/copied/failed icon + text states andaria-label, and atarget="_blank" rel="noopener noreferrer"explorer link whose accessible name is "View transaction {full hash} on the Stellar explorer".If the hash does not parse as a valid 64-character hash the row renders nothing — there is no explorer page for it and nothing trustworthy to copy.
frontend/src/context/ToastContext.tsxToastOptionsgains an optionaltxHash.pushSonner()now renders the description plus the hash row as one inline group. WithouttxHashthe payload is the plain string, byte-for-byte what it was before, so no existing toast changes.notifyprop rather than the row callinguseToast(). The row is rendered from inside the toast tree, so importing the context from it would create a circularToastContext ↔ ToastTransactionRowimport.frontend/src/components/VaultDashboard.tsx— passestxHash: submittedTxHashto the deposit/withdrawal success toast.frontend/src/i18n/locales/en.ts/es.ts— newtxToastblock (10 keys) in both locales.frontend/src/index.css— styles for the row, mirroring the existing.copy-buttonconventions (including light-theme and:focus-visiblehandling).Design notes
dedupeKey: "tx-hash-copy"), so repeatedly clicking Copy does not queue identical toasts."100.00 USDC has been deposited into the vault.", not instead of it.<span>-based withdisplay: blockwrappers, so the markup stays valid whether sonner nests the description in a<div>or a<p>.Validation
New tests (7):
Covering: network-correct testnet and mainnet hrefs, full-hash-not-truncated on the clipboard, success toast on copy, failure toast when the clipboard rejects,
nullrender for unparseable / wrong-length hashes, and the end-to-end render insideToastProvider.Full frontend suite:
1463 passed | 14 failed (1477).The 14 failures are pre-existing on
origin/mainand unrelated to this change — they sit inNavbar,NotificationBell,TransactionConfirmationModal, andVaultDashboard(missingWithdrawalNotificationProviderin test harnesses, an ambiguous$1,000,000query, etc.).Verified rather than assumed:
git stash→ re-ran those files on a cleanorigin/maincheckout → reproduced the identical4 failed files / 14 failedresult, including the exact same VaultDashboard test:Baseline
origin/main=1470 tests / 1456 passed / 14 failed; this branch =1477 / 1463 / 14— +7 passing, failures unchanged.