From 6054c2e989bcbc2029c8a5cd23de6cc414a6221f Mon Sep 17 00:00:00 2001 From: theborakompanioni Date: Wed, 18 Feb 2026 19:06:59 +0100 Subject: [PATCH] chore: align utxo status tooltip --- src/components/orderbook/OrderbookContent.tsx | 4 +- src/components/ui/jam/StatusBadge.tsx | 19 +++++- src/components/wallet/BranchEntryTable.tsx | 15 ++-- src/components/wallet/JarUtxosTable.tsx | 12 +--- .../wallet/WalletJarsDetailsContent.tsx | 68 +++++++++---------- src/i18n/locales/en/translation.json | 12 ++-- 6 files changed, 70 insertions(+), 60 deletions(-) diff --git a/src/components/orderbook/OrderbookContent.tsx b/src/components/orderbook/OrderbookContent.tsx index a95426c0..11f7862b 100644 --- a/src/components/orderbook/OrderbookContent.tsx +++ b/src/components/orderbook/OrderbookContent.tsx @@ -370,7 +370,9 @@ export const OrderbookContent = ({ enabled, className }: OrderbookContentProps) {marketSummary.medianAbsFee !== null && ( -

{t('orderbook.market_summary_median_abs_fee', { value: marketSummary.medianAbsFee.toLocaleString() })}

+

+ {t('orderbook.market_summary_median_abs_fee', { value: marketSummary.medianAbsFee.toLocaleString() })} +

)} {marketSummary.medianRelFee !== null && (

diff --git a/src/components/ui/jam/StatusBadge.tsx b/src/components/ui/jam/StatusBadge.tsx index 7f7d48e3..48a5acf5 100644 --- a/src/components/ui/jam/StatusBadge.tsx +++ b/src/components/ui/jam/StatusBadge.tsx @@ -2,17 +2,32 @@ import * as React from 'react' import { Slot } from '@radix-ui/react-slot' import type { VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' +import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip' import { statusBadgeVariants } from './StatusBadge-variants' function StatusBadge({ className, variant, asChild = false, + tooltip, ...props -}: React.ComponentProps<'span'> & VariantProps & { asChild?: boolean }) { +}: React.ComponentProps<'span'> & + VariantProps & { + asChild?: boolean + tooltip?: React.ReactNode | string + }) { const Comp = asChild ? Slot : 'span' - return + const element = + + return !tooltip ? ( + element + ) : ( + + {element} + {tooltip} + + ) } export { StatusBadge } diff --git a/src/components/wallet/BranchEntryTable.tsx b/src/components/wallet/BranchEntryTable.tsx index 2cd37783..54f184a3 100644 --- a/src/components/wallet/BranchEntryTable.tsx +++ b/src/components/wallet/BranchEntryTable.tsx @@ -154,11 +154,16 @@ export const BranchEntryTable = ({ header: () => t(/* TODO: i18n keys */ 'jar_details.utxo_list.column_title_label_and_status'), cell: (info) => (

- {info.row.original.tags.map((it, index) => ( - - {it.displayValue} - - ))} + {info.row.original.tags.map((it, index) => { + const tooltipKey = `jar_details.utxo_list.utxo_tag_tooltip_${it.value}` + const tooltip = t(tooltipKey) + const hasTooltip = tooltip !== tooltipKey + return ( + + {it.displayValue} + + ) + })}
), enableSorting: false, diff --git a/src/components/wallet/JarUtxosTable.tsx b/src/components/wallet/JarUtxosTable.tsx index 720c2152..c95b960c 100644 --- a/src/components/wallet/JarUtxosTable.tsx +++ b/src/components/wallet/JarUtxosTable.tsx @@ -39,7 +39,6 @@ import { Balance } from '../ui/jam/Balance' import { CopyButton } from '../ui/jam/CopyButton' import { SortIcon } from '../ui/jam/SortIcon' import { StatusBadge } from '../ui/jam/StatusBadge' -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip' const ITEMS_PER_PAGE = 25 @@ -241,15 +240,8 @@ const utxoTableColumns = (t: TFunction): ColumnDef[] => { const tooltipKey = `jar_details.utxo_list.utxo_tag_tooltip_${it.value}` const tooltip = t(tooltipKey) const hasTooltip = tooltip !== tooltipKey - return hasTooltip ? ( - - - {it.displayValue} - - {tooltip} - - ) : ( - + return ( + {it.displayValue} ) diff --git a/src/components/wallet/WalletJarsDetailsContent.tsx b/src/components/wallet/WalletJarsDetailsContent.tsx index 1110c7d6..e876585a 100644 --- a/src/components/wallet/WalletJarsDetailsContent.tsx +++ b/src/components/wallet/WalletJarsDetailsContent.tsx @@ -187,6 +187,12 @@ export const UtxosContent = ({ enabled, walletFileName, addressSummary, jar }: U return ( <> + {reusedCount > 0 && ( + + + {t('jar_details.utxo_list.alert_reused_address', { count: reusedCount })} + + )}
{t('jar_details.utxo_list.title', { count: jar.utxos.length, jar: jar.name })} @@ -197,37 +203,37 @@ export const UtxosContent = ({ enabled, walletFileName, addressSummary, jar }: U
-
- - +
+
- - -
-
+ + + + +
- {reusedCount > 0 && ( - - - - {t('jar_details.utxo_list.alert_reused_address', { count: reusedCount })} - - - )} ) } diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index f9aea9b2..ae3e9bb4 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -808,17 +808,15 @@ "utxo_tooltip_locktime": "locked until {{ locktime }}", "utxo_tag_frozen": "frozen", "utxo_tag_fb": "bond", - "utxo_tag_tooltip_cj-out": "CoinJoin output — good privacy", - "utxo_tag_tooltip_non-cj-change": "Change from a non-CoinJoin tx — may be linkable to inputs", + "utxo_tag_tooltip_cj-out": "CoinJoin output", + "utxo_tag_tooltip_non-cj-change": "Change from a non-CoinJoin tx", "utxo_tag_tooltip_change-out": "Change from a CoinJoin tx", - "utxo_tag_tooltip_reused": "Address used more than once — bad for privacy", + "utxo_tag_tooltip_reused": "Address used more than once", "utxo_tag_tooltip_deposit": "Received from an external source", "utxo_tag_tooltip_frozen": "Excluded from spending", - "utxo_tag_tooltip_locked": "Excluded from spending — may be reserved for a CoinJoin", + "utxo_tag_tooltip_locked": "Time-locked by the Bitcoin protocol", "utxo_tag_tooltip_pending": "Part of a pending transaction", - "utxo_tag_tooltip_bond": "Locked as a fidelity bond", - "utxo_tag_tooltip_new": "Fresh output that has not yet been used in a transaction", - "utxo_tag_tooltip_used": "Output associated with prior usage or address reuse", + "utxo_tag_tooltip_bond": "Fidelity bond", "column_title_balance": "Value", "column_title_address": "Address", "column_title_confirmations": "Confs.",