diff options
| author | Adam Soltys <[email protected]> | 2026-07-04 07:03:00 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-04 07:03:00 -0700 |
| commit | 035e81375784b766027b403e4f2685105c4b2150 (patch) | |
| tree | 4138c0c6e19a67ae07aee74e38944334076a2fee | |
| parent | ceed0a4e9dcc2c42e71134e6e393b3ea1aea7296 (diff) | |
| download | coinosv3-035e81375784b766027b403e4f2685105c4b2150.tar.gz coinosv3-035e81375784b766027b403e4f2685105c4b2150.zip | |
Ark: boarding success screen with txid link instead of a toast
Broadcasting a board now lands on a checkmark screen showing the amount
that will arrive (after the board fee), a note about the confirmation,
and the funding txid with copy + explorer link; Done returns to the
Receive tab.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
| -rw-r--r-- | src/app.js | 23 | ||||
| -rw-r--r-- | src/i18n.js | 3 | ||||
| -rw-r--r-- | tools/ark/ui-test.js | 6 |
3 files changed, 28 insertions, 4 deletions
@@ -1916,14 +1916,14 @@ async function doArkBoard() { if (!sats) return; ui.arkBusy = 'board'; ui.arkError = ''; render(); try { - const { actionId, fundingAddress } = await ark.startBoard(sats); + const { actionId, fundingAddress, feeSat } = await ark.startBoard(sats); const feeRate = (wallet.feeRates && wallet.feeRates.halfHourFee) || 5; const draft = wallet.buildTx({ recipients: [{ address: fundingAddress, amount: sats }], feeRate, noSort: true }); const hexTx = wallet.sign(draft.tx); const txid = await wallet.broadcast(hexTx); await ark.completeBoard(actionId, txid); ui.arkBoardAmt = ''; - toast(t('arkBoardStarted'), 5000); + ui.arkBoarded = { txid, netSat: sats - feeSat }; wallet.scan().catch(() => {}); } catch (e) { ui.arkError = e.message; @@ -2787,6 +2787,25 @@ function hasRecentIncoming() { // ---------------------------------------------------------------- Receive function receiveTab() { + // A board just broadcast — show its success screen until dismissed. + if (ui.arkBoarded) { + const b = ui.arkBoarded; + const url = wallet.api.explorerTx(b.txid); + return h( + 'div', + { class: 'card col', style: 'align-items:center;text-align:center;gap:14px;padding:40px 20px' }, + h('div', { class: 'check-badge' }, '✓'), + h('h2', { style: 'margin:0' }, t('arkBoardedTitle')), + h('div', { class: 'amount-pos', style: 'font-size:18px' }, '+' + fmtAmount(b.netSat) + ' ' + unitLabel()), + h('p', { class: 'small muted', style: 'margin:0' }, t('arkBoardedNote')), + h('div', { class: 'addr-box', style: 'width:100%' }, b.txid), + h('div', { class: 'row gap6' }, + copyBtn(b.txid, t('copyTxid')), + h('a', { class: 'btn btn-sm', href: url, target: '_blank', rel: 'noopener', onClick: (e) => { e.preventDefault(); openExternal(url); } }, t('viewOnMempool'))), + h('button', { class: 'btn-primary btn-block', onClick: () => { ui.arkBoarded = null; render(); } }, t('done')) + ); + } + // An Ark payment landed — same celebration as an on-chain receive, dismissed // with a tap (the ack persists in the ark state so it shows exactly once). const arkUnseen = ark && ark.state ? ark.unseenReceives() : []; diff --git a/src/i18n.js b/src/i18n.js index 43a32d9..7380661 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -363,7 +363,8 @@ const STR = { arkPendingActions: '{n} operation(s) in progress', arkBoardPlaceholder: 'Board amount (min {n} sats)', arkBoardBtn: 'Board', - arkBoardStarted: 'Boarding — spendable in the Ark after 1 confirmation.', + arkBoardedTitle: 'Boarding!', + arkBoardedNote: 'Spendable in the Ark after 1 confirmation.', arkBoardIntro: 'Or move this wallet\u2019s on-chain funds into Ark:', arkBoardAvailable: '{n} available on-chain', arkBoardNoFunds: 'Needs at least {n} sats of on-chain balance.', diff --git a/tools/ark/ui-test.js b/tools/ark/ui-test.js index 48f2f83..259172f 100644 --- a/tools/ark/ui-test.js +++ b/tools/ark/ui-test.js @@ -159,7 +159,11 @@ try { check('board form on receive/ark', !!(await boardInput.asElement())); await boardInput.asElement().type('30000'); await clickText('button', 'Board'); - check('board started', await waitText('Boarding', 20000)); + check('boarding success screen', await waitText('Boarding!', 20000)); + check('boarding txid link shown', await page.evaluate(() => + !!document.querySelector('.addr-box') && /^[0-9a-f]{64}$/.test(document.querySelector('.addr-box').textContent.trim()))); + await clickText('button.btn-primary', 'Done'); + await sleep(300); mine(2); check('board vtxo lands (+29,670)', await waitLabeledNumber('ark balance', preBoard + 29670, 40000), String(await labeledNumber('ark balance'))); |
