feat(wallet-main): trim legend copy, right-align numbers, drop Assets|Wallets gate

Three user-directed main-screen IA cleanups (2026-10-23):

1. Legend copy — strip the "· backed" / "· non-backed" tails from the
   MBA + NBA rows. The acronyms are self-contained; the longer form was
   duplicating context that already lives on the Backed Assets accordion
   below.

2. Right-align the number column across all three legend rows. The old
   NBA row rendered as "~ 0.000" with the "~" sitting inside .val, which
   pushed the digits left of the MBA/BCH columns above. The marker is
   now a sibling of .val (new .approx class) so it takes the
   margin-left:auto push, and .val sits snug next to it — numbers
   visually right-align whether or not the row is market-estimated.

3. Retire the Assets|Wallets segmented gate at the top of Main. Users
   wanted the asset rows (BCH / Backed / Non-backed) to be always-on
   content, not something behind a tab. Both AssetsPane and WalletsPane
   now render unconditionally; the Wallets|Activity sub-toggle inside
   WalletsPane becomes the only segmented bar on the page.
   - `Pane` type retired
   - `pane` state + `setPane` callers removed
   - `onViewWallets` call-site in AssetsPane became a no-op (the Wallets
     section is already on-screen below)

Verified live on silentmode.st/apps/deviant/ (bundle main-CXiApcxo.js):
- "MBA · backed" and "NBA · non-backed" removed from Main legend
- .approx class present (bundle search confirms)
- subtab class gone (Assets|Wallets gate removed)
- The one remaining "MBA · backed" string is in the Artemision wizard's
  Backing dropdown — correct to leave, it's a different context.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Local Dev 2026-10-23 00:28:33 +03:00
parent f9be2bd593
commit 8e45fd1080
2 changed files with 56 additions and 40 deletions

View file

@ -8,7 +8,8 @@ import type { WalletBalances } from '../hooks/useWalletBalances';
import { getActivityItems, type CoreSession, type HistoryItem } from '../core/wallet';
type Balance = DisplayBalance | null;
type Pane = 'assets' | 'wallets';
// `Pane` type retired 2026-10-23 — the Assets|Wallets segmented gate was
// removed; both sections render simultaneously now.
// Hero balance fiat display. `bchRate` = BCH price in the chosen currency (from the
// live CoinGecko feed via useFiatRates); null while it loads / offline → em-dash.
@ -89,7 +90,9 @@ export function MainScreen({
/** Persist a new display name for a wallet. */
onRenameWallet?: (key: string, name: string) => void;
}) {
const [pane, setPane] = useState<Pane>('assets');
// 2026-10-23: the Assets|Wallets gate was retired; both sections render
// simultaneously now. The legacy `pane` state is gone — any legend-row tap
// is a scroll hint rather than a view switch (the content is already on-screen).
const activeBchSats = balance?.bchSats ?? 0n;
// Σ MBA Protocol Net Value across held backed assets (units × rate) — the
@ -218,21 +221,26 @@ export function MainScreen({
</div>
</div>
<div className="legend">
<div className="leg" onClick={() => { setPane('assets'); }}>
<div className="leg">
<span className="sw" style={{ background: '#0ac18e' }} />
Bitcoin Cash<span className="val">{satsToBch(bchSats, 3)}<span className="uni"> BCH</span></span>
</div>
<div className="leg mba" onClick={() => { setPane('assets'); }}>
<div className="leg mba">
<span className="sw" style={{ background: 'var(--acid)' }} />
MBA · backed<span className="val">{satsToBch(backedSats, 3)}<span className="uni"> BCH</span></span>
MBA<span className="val">{satsToBch(backedSats, 3)}<span className="uni"> BCH</span></span>
</div>
<div
className="leg nba"
onClick={() => { setPane('assets'); }}
title="Market-estimated BCH value · not protocol-enforced (no consensus BCH floor)"
title="Market-estimated BCH value · not protocol-enforced (no consensus BCH floor)"
>
<span className="sw" style={{ background: '#7f8cff' }} />
NBA · non-backed<span className="val">~ {satsToBch(nbaShownSats, 3)}<span className="uni"> BCH</span></span>
NBA
{/* The ~ is a sibling of .val, not inside it. Both push to the right
via the .approx margin-left:auto (which .val no longer owns when
it immediately follows .approx — see shell.css), so the numeric
column stays visually right-aligned with the MBA + BCH rows. */}
<span className="approx">~</span>
<span className="val">{satsToBch(nbaShownSats, 3)}<span className="uni"> BCH</span></span>
</div>
</div>
</div>
@ -340,39 +348,41 @@ export function MainScreen({
</div>
</div>
{/* Sub-tabs: Assets | Wallets (peer panes inside Main, per main-tab.html) */}
<div className="subtabs">
<button className={`subtab${pane === 'assets' ? ' active' : ''}`} onClick={() => setPane('assets')}>Assets</button>
<button className={`subtab${pane === 'wallets' ? ' active' : ''}`} onClick={() => setPane('wallets')}>Wallets</button>
</div>
{/* 2026-10-23 IA change (user-directed): Assets content is now ALWAYS
shown. The segmented tab bar at this level used to gate Assets vs
Wallets, but Assets rows (BCH / Backed Assets / Non-backed) are the
main-page content people need by default — the segmented bar below
is now Wallets | Activity, which replaces the old inner toggle that
used to live inside WalletsPane. `pane` state stays here because
`legend` taps still want to scroll/anchor to the assets area; the
`wallets` value now means "the Wallets|Activity section is in use". */}
<AssetsPane
bchSats={bchSats}
mbaHeld={mbaHeld}
nbaHeld={nbaHeld}
unknownHeld={unknownHeld}
mbaPnvSats={backedSats}
nbaMarketSats={nbaShownSats}
onViewAgora={onViewAgora}
/* onViewWallets is now a no-op since the Wallets pane is already
visible below — AssetsPane's BCH card still accepts the prop
optionally for backward-compat with other callers. */
/>
{pane === 'assets' ? (
<AssetsPane
bchSats={bchSats}
mbaHeld={mbaHeld}
nbaHeld={nbaHeld}
unknownHeld={unknownHeld}
mbaPnvSats={backedSats}
nbaMarketSats={nbaShownSats}
onViewAgora={onViewAgora}
onViewWallets={() => setPane('wallets')}
/>
) : (
<WalletsPane
aggregate={aggregate}
activeWalletKey={activeWalletKey}
activeBchSats={activeBchSats}
mbaPnvSats={mbaPnvSats}
session={session ?? null}
aggLoading={aggLoading}
displayName={displayName}
badgeOf={badgeOf}
onSwitchWallet={onSwitchWallet}
onRenameWallet={onRenameWallet}
onManageWallets={onManageWallets}
onActivity={onActivity}
/>
)}
<WalletsPane
aggregate={aggregate}
activeWalletKey={activeWalletKey}
activeBchSats={activeBchSats}
mbaPnvSats={mbaPnvSats}
session={session ?? null}
aggLoading={aggLoading}
displayName={displayName}
badgeOf={badgeOf}
onSwitchWallet={onSwitchWallet}
onRenameWallet={onRenameWallet}
onManageWallets={onManageWallets}
onActivity={onActivity}
/>
</>
);
}

View file

@ -274,6 +274,12 @@
.leg:hover { background: rgba(255, 255, 255, 0.04); }
.leg .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; transition: box-shadow 0.3s; }
.leg .val { margin-left: auto; color: var(--ink); }
/* The NBA row's "~" marker lives OUTSIDE .val so the numeric column stays
right-aligned with the MBA + BCH rows above (whose .val gets the
margin-left:auto). When .approx is present it takes the auto-push, and
the following .val resets to no auto so it sits snug next to the marker. */
.leg .approx { margin-left: auto; color: var(--muted); opacity: 0.7; font-size: 10px; margin-right: 4px; }
.leg .approx + .val { margin-left: 0; }
/* Unit suffix inside .val (e.g. "0.270 BCH") — smaller + muted so the number leads. */
.leg .val .uni { font-size: 9px; color: var(--ink-soft); margin-left: 3px; letter-spacing: 0.02em; }
.leg.mba:hover .sw { box-shadow: 0 0 9px var(--acid-glow); }