Skip to content

Commit ece9e16

Browse files
sktbrdclaude
andcommitted
fix(treasury): BRL-length-proof layout — KPI breakdown and rider columns
pt-BR is the long-string locale ("R$ 177.908,14" vs "$34,414.31") and two spots sized for the English case broke under it, caught on the PT capture: the Total KPI's wallet/DeFi line wrapped INTO the corner noggles, and the rider table's fixed 72px value column let "R$ 12.731,86" bleed into the yield column. The KPI note becomes two deliberate lines (label + tabular value) with right padding clearing the mark in any locale; the rider columns go auto-sized. Anything that fits English exactly will overflow Portuguese — sized for the long case now. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 0e9643f commit ece9e16

4 files changed

Lines changed: 25 additions & 13 deletions

File tree

messages/en/treasury.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"acrossAssets": "across {count} assets",
1212
"auctionsSettled": "{count} auctions settled",
1313
"morpheusClaims": "Morpheus · {count} claims",
14-
"walletVsDefi": "In wallet {wallet} · In DeFi {defi}",
15-
"defiUnavailable": "DeFi positions unreadable — the total shows the wallet only"
14+
"defiUnavailable": "DeFi positions unreadable — the total shows the wallet only",
15+
"inWallet": "In wallet",
16+
"inDefi": "In DeFi"
1617
},
1718
"nftSection": {
1819
"title": "NFT Holdings",

messages/pt-br/treasury.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"acrossAssets": "em {count} ativos",
1212
"auctionsSettled": "{count} leilões concluídos",
1313
"morpheusClaims": "Morpheus · {count} resgates",
14-
"walletVsDefi": "Em carteira {wallet} · Em DeFi {defi}",
15-
"defiUnavailable": "Posições DeFi ilegíveis — o total mostra só a carteira"
14+
"defiUnavailable": "Posições DeFi ilegíveis — o total mostra só a carteira",
15+
"inWallet": "Em carteira",
16+
"inDefi": "Em DeFi"
1617
},
1718
"nftSection": {
1819
"title": "Holdings de NFT",

src/components/treasury/SponsorshipYield.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export function SponsorshipYield({ brlRate = null }: { brlRate?: number | null }
161161
</div>
162162

163163
<div>
164-
<div className="grid grid-cols-[minmax(0,1fr)_72px_66px] gap-2.5 border-b border-border pb-2 text-[11px] font-medium text-muted-foreground">
164+
<div className="grid grid-cols-[minmax(0,1fr)_auto_auto] gap-2.5 border-b border-border pb-2 text-[11px] font-medium text-muted-foreground">
165165
<span>{t("colRider")}</span>
166166
<span className="text-right">{t("colTvl")}</span>
167167
<span className="text-right">{t("colYield")}</span>
@@ -171,7 +171,7 @@ export function SponsorshipYield({ brlRate = null }: { brlRate?: number | null }
171171
{rows.map((r) => (
172172
<li
173173
key={r.id}
174-
className="grid grid-cols-[minmax(0,1fr)_72px_66px] items-center gap-2.5 py-1.5"
174+
className="grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 py-1.5"
175175
>
176176
<span className="flex min-w-0 items-center gap-2">
177177
{/* Cropped to the face the same way the orbit nodes are, so a

src/components/treasury/TreasuryKpiRow.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function TreasuryKpiRow() {
7878
label: string;
7979
accent: string;
8080
value: ReactNode;
81-
note: string | null;
81+
note: ReactNode;
8282
extra?: ReactNode;
8383
mark: ReactNode;
8484
}> = [
@@ -87,13 +87,23 @@ export async function TreasuryKpiRow() {
8787
label: t("totalValue"),
8888
accent: "--chart-5",
8989
value: <KpiValue value={totalUsd} decimals={2} fiat brlRate={brlRate} />,
90+
// Two deliberate lines, not one that wraps: BRL strings run ~30% longer
91+
// than USD ("R$ 177.908,14" vs "$34,414.31") and the single-line form
92+
// broke across the corner noggles on pt-BR. The right padding keeps the
93+
// text clear of the mark in every locale.
9094
note:
91-
walletUsd != null
92-
? t("walletVsDefi", {
93-
wallet: formatFiatUsd(walletUsd, locale, brlRate),
94-
defi: formatFiatUsd(defiKnown, locale, brlRate),
95-
})
96-
: null,
95+
walletUsd != null ? (
96+
<span className="block space-y-0 pr-[88px]">
97+
<span className="flex items-baseline gap-1.5 whitespace-nowrap">
98+
<span>{t("inWallet")}</span>
99+
<span className="tabular-nums">{formatFiatUsd(walletUsd, locale, brlRate)}</span>
100+
</span>
101+
<span className="flex items-baseline gap-1.5 whitespace-nowrap">
102+
<span>{t("inDefi")}</span>
103+
<span className="tabular-nums">{formatFiatUsd(defiKnown, locale, brlRate)}</span>
104+
</span>
105+
</span>
106+
) : null,
97107
extra: (
98108
<>
99109
{!defiHealthy && (

0 commit comments

Comments
 (0)