From a30c16fcaac5c89acc1ace58aff8a6746ab45d05 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 9 Oct 2026 14:49:59 -0700 Subject: Amounts: no minus sign on money going out. The word (Sent, Renewal, Exiting…) and the red already say it's a debit — history rows, the transaction details, the sent screens, and on-chain rows (whose negative net printed its own sign). Received keeps its +. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vps2H27rhbG9ZqseGfMrc3 --- src/app.js | 4 ++-- src/features/ark.js | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/app.js b/src/app.js index 6a80f8c..dbda72c 100644 --- a/src/app.js +++ b/src/app.js @@ -5886,7 +5886,7 @@ function txHistoryItem(tx) { ), h('div', { style: 'text-align:right' }, // priced at the moment it happened, not at today's number - h('div', { class: incoming ? 'amount-pos' : 'amount-neg' }, (incoming ? '+' : '') + fmtAmount(tx.net, tx.blockTime)), + h('div', { class: incoming ? 'amount-pos' : 'amount-neg' }, (incoming ? '+' : '') + fmtAmount(Math.abs(tx.net), tx.blockTime)), !incoming && tx.fee ? h('div', { class: 'small faint' }, t('feeShort', { x: fmtAmount(tx.fee, tx.blockTime) })) : null ) ); @@ -6008,7 +6008,7 @@ function txDetailView(tx) { h('span', { class: `tag ${tx.confirmed ? 'conf' : 'pending'}` }, tx.confirmed ? t('confirmedTag') : t('pendingTag')) ), h('div', { class: 'amt', style: 'font-size:30px' }, - h('span', { class: incoming ? 'amount-pos' : 'amount-neg' }, (incoming ? '+' : '') + fmtAmount(tx.net, tx.blockTime)), + h('span', { class: incoming ? 'amount-pos' : 'amount-neg' }, (incoming ? '+' : '') + fmtAmount(Math.abs(tx.net), tx.blockTime)), ' ', unitTag('unit') ), h('div', { class: 'summary col', style: 'gap:0' }, diff --git a/src/features/ark.js b/src/features/ark.js index 39936ac..a9f4487 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -828,7 +828,7 @@ export function arkFeature(ctx) { }, h('div', { class: 'check-badge' }, '✓'), h('h2', { style: 'margin:0' }, t('arkSentTitle')), - h('div', { class: 'amount-neg', style: 'font-size:18px' }, '-' + fmtAmount(ui.arkSent.amountSat) + ' ' + unitLabel()), + h('div', { class: 'amount-neg', style: 'font-size:18px' }, fmtAmount(ui.arkSent.amountSat) + ' ' + unitLabel()), h('div', { class: 'small muted' }, t('tapToProceed')) ); } @@ -1245,7 +1245,7 @@ export function arkFeature(ctx) { }, h('div', { class: 'check-badge autopay-badge' }, '⚡'), meta && meta.name ? h('div', { class: 'small muted' }, meta.name) : null, - h('div', { class: 'amount-neg', style: 'font-size:18px' }, '-' + fmtAmount(amountSat) + ' ' + unitLabel()), + h('div', { class: 'amount-neg', style: 'font-size:18px' }, fmtAmount(amountSat) + ' ' + unitLabel()), h('div', { class: 'small muted autopay-foot' }, paid ? t('tapToProceed') : '')); function arkLnPayView() { @@ -1261,7 +1261,7 @@ export function arkFeature(ctx) { h('div', { class: 'check-badge' }, '⚡'), h('h2', { style: 'margin:0' }, zap && zap.social ? t('arkZapSentTitle') : t('arkLnPaidTitle')), zap && zap.name ? h('div', { class: 'small muted' }, zap.name) : null, - h('div', { class: 'amount-neg', style: 'font-size:18px' }, '-' + fmtAmount(ui.arkLnPaid.amountSat) + u), + h('div', { class: 'amount-neg', style: 'font-size:18px' }, fmtAmount(ui.arkLnPaid.amountSat) + u), h('div', { class: 'small muted' }, t('tapToProceed'))); } const p = ui.arkLnPay; @@ -1390,7 +1390,7 @@ export function arkFeature(ctx) { h('div', { class: 'small faint' }, timeAgo(m.ts / 1000))), h('div', { style: 'text-align:right' }, m.feeSat > 0 - ? h('div', { class: 'amount-neg' }, '-' + fmtAmount(m.feeSat)) + ? h('div', { class: 'amount-neg' }, fmtAmount(m.feeSat)) : h('div', { class: 'small faint' }, t('arkDepthFree')))); } return h( @@ -1422,7 +1422,7 @@ export function arkFeature(ctx) { h('div', { class: 'small faint' }, timeAgo(m.ts / 1000))), h('div', { style: 'text-align:right' }, // in fiat this is what the payment was worth when it was made - h('div', { class: failed ? 'muted' : incoming ? 'amount-pos' : 'amount-neg' }, (failed ? '' : incoming ? '+' : '-') + fmtAmount(m.amountSat, m.ts / 1000))) + h('div', { class: failed ? 'muted' : incoming ? 'amount-pos' : 'amount-neg' }, (failed ? '' : incoming ? '+' : '') + fmtAmount(m.amountSat, m.ts / 1000))) ); } @@ -1453,7 +1453,7 @@ export function arkFeature(ctx) { t('arkRenewingHistory'), h('span', { class: 'tag pending' }, t('arkExitPendingTag'))), h('div', { class: 'small faint' }, timeAgo(exitStartedTs(a) / 1000))), h('div', { style: 'text-align:right' }, - a.feeSat ? h('div', { class: 'amount-neg' }, '-' + fmtAmount(a.feeSat)) : h('div', { class: 'small muted' }, fmtAmount(a.inAmountSat || a.outAmountSat) + ' ' + unitLabel()))); + a.feeSat ? h('div', { class: 'amount-neg' }, fmtAmount(a.feeSat)) : h('div', { class: 'small muted' }, fmtAmount(a.inAmountSat || a.outAmountSat) + ' ' + unitLabel()))); } function arkExitActionItem(a) { @@ -1464,7 +1464,7 @@ export function arkFeature(ctx) { t('arkExitingHistory'), h('span', { class: 'tag pending' }, t('arkExitPendingTag'))), h('div', { class: 'small faint' }, timeAgo(exitStartedTs(a) / 1000))), h('div', { style: 'text-align:right' }, - h('div', { class: 'amount-neg' }, '-' + fmtAmount(a.amountSat)))); + h('div', { class: 'amount-neg' }, fmtAmount(a.amountSat)))); } function arkExitActionDetail(a) { @@ -1486,7 +1486,7 @@ export function arkFeature(ctx) { h('span', { html: ARK_ICON(18) }), h('h3', { style: 'margin:0' }, t('arkExitingHistory')), h('span', { class: 'tag pending' }, t('arkExitPendingTag'))), - h('div', { class: 'amount-neg', style: 'font-size:20px' }, '-' + fmtAmount(a.amountSat) + ' ' + unitLabel()), + h('div', { class: 'amount-neg', style: 'font-size:20px' }, fmtAmount(a.amountSat) + ' ' + unitLabel()), row(t('dateLabel'), new Date(exitStartedTs(a)).toLocaleString()), h('div', { class: 'small muted' }, t('arkExitSummary', { n: fmtSats(a.amountSat), eta })), a.lastError ? h('div', { class: a.actionable ? 'small err' : 'small faint' }, a.actionable ? a.lastError : t('arkExitRetrying')) : null, @@ -1551,9 +1551,9 @@ export function arkFeature(ctx) { m.status !== 'complete' && !failed ? h('span', { class: 'tag pending' }, m.status === 'pending' ? t('arkExitPendingTag') : m.status) : null), m.type === 'refresh' ? h('div', { class: m.feeSat > 0 ? 'amount-neg' : 'small faint', style: 'font-size:20px' }, - m.feeSat > 0 ? '-' + fmtAmount(m.feeSat) + ' ' + unitLabel() : t('arkDepthFree')) + m.feeSat > 0 ? fmtAmount(m.feeSat) + ' ' + unitLabel() : t('arkDepthFree')) : h('div', { class: failed ? 'muted' : incoming ? 'amount-pos' : 'amount-neg', style: 'font-size:20px;display:flex;align-items:baseline;gap:6px' }, - (failed ? '' : incoming ? '+' : '-') + fmtAmount(m.amountSat, m.ts / 1000), unitTag()), // the unit toggles, as on the balance + (failed ? '' : incoming ? '+' : '') + fmtAmount(m.amountSat, m.ts / 1000), unitTag()), // the unit toggles, as on the balance row(t('dateLabel'), new Date(m.ts).toLocaleString()), ctx.worthLine ? ctx.worthLine(m.amountSat, m.ts / 1000, row) : null, // a feature that knows more about this movement (the till: bill and tip) @@ -2002,13 +2002,13 @@ export function arkFeature(ctx) { }, h('div', { class: 'check-badge' }, '⚡'), h('h2', { style: 'margin:0' }, t('arkZapSentTitle')), - h('div', { class: 'amount-neg', style: 'font-size:18px' }, '-' + fmtAmount(ui.arkZapped.amountSat) + ' ' + unitLabel()), + h('div', { class: 'amount-neg', style: 'font-size:18px' }, fmtAmount(ui.arkZapped.amountSat) + ' ' + unitLabel()), h('div', { class: 'small muted' }, t('tapToProceed'))); } return h('div', { class: 'card col', style: 'align-items:center;text-align:center;gap:12px;padding:28px 16px' }, h('div', { class: 'check-badge' }, '⚡'), h('h2', { style: 'margin:0' }, t('arkZapSentTitle')), - h('div', { class: 'amount-neg', style: 'font-size:18px' }, '-' + fmtAmount(ui.arkZapped.amountSat) + ' ' + unitLabel()), + h('div', { class: 'amount-neg', style: 'font-size:18px' }, fmtAmount(ui.arkZapped.amountSat) + ' ' + unitLabel()), h('div', { class: 'notice info', style: 'text-align:left' }, t('giftDmFailed')), h('div', { class: 'addr-box break', style: 'width:100%;font-size:11px' }, gift.url), h('div', { class: 'row gap6 wrap', style: 'justify-content:center' }, -- cgit v1.2.3