refactor(settings): redesign BotConfigPanel + fix paper mode + clarify all copy

BotConfigPanel (full rewrite, 1113→858 lines):
- Remove 3-tab layout; replace with two expandable cards (Trump Signal /
  Macro Vibes) + collapsed Advanced block — fewer decisions, less noise
- Fix paper mode bug: UserResponse now returns paper_mode; BotConfigPanel
  tracks it in state; missingItems skips HL key requirement for paper users;
  HL key card shows paper status instead of empty input
- Add "Switch to live →" upgrade path — calls /subscribe with paper_mode=false
  so paper users can promote without re-subscribing from scratch
- Add confirmSign before manual override window (consistent with all other
  mutations); rename "Arm/Disarm" → "Override/Cancel override" throughout
- Fix all ambiguous copy: subscribe card, Macro Vibes description (manual
  /adopt flow, not auto-manage), missingItems strings, TP/SL "Not saved yet"
  → "Required — not saved", "Daily spend cap" → "Daily trading cap",
  "Active schedule" → "Trading schedule", "Get started" confirmSign labels

lib/api.ts:
- Add paper_mode: boolean to UserData interface (was missing)

OpenPositions:
- "Load your settings once…" → "Sign in once to view open positions" (removes
  implementation-detail explanation)
- "Today realised" → "Today's realized"; "banked" → "locked in" throughout
- "The bot will appear here" → "When the bot opens a trade, it will show up here"

SystemControl:
- "Net result" → "Current status"

settings/SettingsClient.tsx:
- id="btc-settings" → id="macro-settings" (stale rename)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
k
2026-05-27 23:10:55 +08:00
parent a1e9ec49ef
commit b76de36af0
5 changed files with 530 additions and 656 deletions
+7 -7
View File
@@ -141,7 +141,7 @@ function PositionRow({ p, onClose, onToggleGrow, growBusy, isZh }: {
</div>
{p.realized_usd != null && p.realized_usd !== 0 && (
<div style={{ fontSize: 10, color: 'var(--ink-3)', marginTop: 1 }}>
banked {fmtMoney(p.realized_usd, { sign: true })}
locked in {fmtMoney(p.realized_usd, { sign: true })}
</div>
)}
</div>
@@ -272,10 +272,10 @@ export default function OpenPositions() {
Open positions
</div>
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--ink)' }}>
Load your settings once to unlock private position data.
Sign in once to view open positions
</div>
<div style={{ fontSize: 12, color: 'var(--ink-3)', marginTop: 4, lineHeight: 1.6 }}>
This panel no longer triggers a wallet signature on its own while you browse. Open the Settings page and load once, then the cached permission will populate positions here.
Go to the <strong>Settings page</strong> and click <em>Sign in to view your settings</em>. After signing, your open positions will appear here automatically.
</div>
</div>
)
@@ -331,7 +331,7 @@ export default function OpenPositions() {
<div>
<div style={{ fontSize: 10, color: 'var(--ink-3)', letterSpacing: '0.06em',
textTransform: 'uppercase', fontWeight: 600, marginBottom: 2 }}>
Today realised
Today&apos;s realized
</div>
<div style={{ fontSize: 18, fontWeight: 700, color: todayColor,
fontVariantNumeric: 'tabular-nums' }}>
@@ -342,7 +342,7 @@ export default function OpenPositions() {
</div>
{today != null && (today.open_realized_usd ?? 0) !== 0 && (
<div style={{ fontSize: 10, color: 'var(--ink-3)', marginTop: 1 }}>
{`incl. ${fmtMoney(today.open_realized_usd, { sign: true })} banked on open`}
{`incl. ${fmtMoney(today.open_realized_usd, { sign: true })} locked in on open trades`}
</div>
)}
</div>
@@ -387,7 +387,7 @@ export default function OpenPositions() {
padding: '20px 18px',
fontSize: 13, color: 'var(--ink-3)', textAlign: 'center',
}}>
No open positions. The bot will appear here as soon as a signal triggers a trade.
No open positions. When the bot opens a trade, it will show up here.
</div>
)}
@@ -432,7 +432,7 @@ export default function OpenPositions() {
</div>
{closing.realized_usd != null && closing.realized_usd !== 0 && (
<div style={{ display: 'flex', justifyContent: 'space-between', fontSize: 12, marginBottom: 6, color: 'var(--ink-3)' }}>
<span>{isZh ? '已锁定(降风险)' : 'Already banked (de-risk)'}</span>
<span>{isZh ? '已锁定(降风险)' : 'Locked in (de-risked)'}</span>
<span className="mono">{fmtMoney(closing.realized_usd, { sign: true })}</span>
</div>
)}
+2 -2
View File
@@ -126,7 +126,7 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
// wagmi state that resolves client-side.
if (!mounted) return null
const settingsHref = `/${locale}/settings#${system === 'trump' ? 'trump-settings-panel' : 'btc-settings-panel'}`
const settingsHref = `/${locale}/settings#bot-config`
const settingsLabel = system === 'trump' ? 'Trump Signal' : 'Macro Vibes'
// Wallet not connected: a previous version showed a giant full-width
@@ -298,7 +298,7 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
}}>
<div style={{ fontSize: 11, fontWeight: 700, letterSpacing: '.06em',
textTransform: 'uppercase', color: 'var(--ink-3)', marginBottom: 4 }}>
{isZh ? '⟹ 当前结果' : '⟹ Net result'}
{isZh ? '⟹ 当前状态' : '⟹ Current status'}
</div>
<div style={{ fontSize: 14, fontWeight: 700,
color: netOk ? 'var(--up)' : 'var(--down)' }}>
File diff suppressed because it is too large Load Diff