KOL count: 29 → 25 across marketing/SEO copy
Backend KOL_FEEDS trimmed from 29 to 25 (dead feeds removed).
Sync all hardcoded count mentions:
- layout.tsx JSON-LD, page.tsx (metric + comparison + copy)
- kol/page.tsx, KolPageClient.tsx ("and 26 more" → "and 22 more")
- glossary/page.tsx, opengraph-image.tsx
- public/llms.txt, llms-full.txt
- drop removed KOLs (Dragonfly Capital, Nic Carter) from named lists
Bundles other in-flight frontend work already in the working tree.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
import Link from 'next/link'
|
||||
import { useState, useEffect, useCallback } from 'react'
|
||||
import { useState, useEffect, useCallback, useRef } from 'react'
|
||||
import { useLocale } from 'next-intl'
|
||||
import { useAccount, useSignMessage } from 'wagmi'
|
||||
import { getUserPublic, setAutoTrade, type UserPublic } from '@/lib/api'
|
||||
@@ -25,8 +25,8 @@ import { confirmSign } from '@/components/wallet/SignConfirmSheet'
|
||||
*/
|
||||
|
||||
const SYS = {
|
||||
trump: { idx: '①', name: 'Trump', accent: '#b45309', soft: 'rgba(180,83,9,0.08)' },
|
||||
btc: { idx: '②', name: 'Macro Vibes', accent: '#16a34a', soft: 'rgba(22,163,74,0.08)' },
|
||||
trump: { idx: '', name: 'Trump Signal', accent: '#b45309', soft: 'rgba(180,83,9,0.08)' },
|
||||
btc: { idx: '', name: 'Macro Vibes', accent: '#16a34a', soft: 'rgba(22,163,74,0.08)' },
|
||||
} as const
|
||||
|
||||
const ROW: React.CSSProperties = {
|
||||
@@ -49,9 +49,18 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
|
||||
useEffect(() => { setMounted(true) }, [])
|
||||
|
||||
// Generation counter: each address change increments it so any in-flight
|
||||
// refresh from the previous address can detect it's stale.
|
||||
// `snap !== address` inside a useCallback is a stale-closure trap — both
|
||||
// refer to the same closed-over value so the check is always false.
|
||||
const genRef = useRef(0)
|
||||
useEffect(() => { genRef.current++ }, [address])
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
if (!address) { setPub(null); return }
|
||||
const gen = genRef.current
|
||||
const p = await getUserPublic(address.toLowerCase()).catch(() => null)
|
||||
if (gen !== genRef.current) return // wallet changed while in-flight
|
||||
setPub(p)
|
||||
}, [address])
|
||||
|
||||
@@ -71,6 +80,14 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
if (busy) return
|
||||
if (!address) { setErr(isZh ? '请先连接右上角的钱包。' : 'Connect your wallet first (top-right).'); return }
|
||||
if (!subscribed) { setErr(isZh ? '钱包尚未订阅,请先去设置页完成订阅。' : 'Wallet not subscribed — subscribe on the Settings page first.'); return }
|
||||
// B51: live users without an HL API key cannot actually execute trades —
|
||||
// block the toggle so the ON state never silently becomes a no-op.
|
||||
if (on && !paper && !pub?.hl_api_key_set) {
|
||||
setErr(isZh
|
||||
? '未绑定 Hyperliquid API Key。请先在设置页保存 API Key,Auto-Trade 才能真实下单。'
|
||||
: 'No Hyperliquid API key saved. Add your HL API key on the Settings page before enabling Auto-Trade.')
|
||||
return
|
||||
}
|
||||
if (autoOn === on) return
|
||||
|
||||
// Claim the busy slot BEFORE awaiting confirmSign — otherwise a rapid
|
||||
@@ -141,38 +158,34 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
// auto-open and (b) be a confusing second copy of the SAME global switch
|
||||
// shown on the Trump page. Show the adopt-only flow instead.
|
||||
if (system === 'btc') {
|
||||
const linkStyle: React.CSSProperties = {
|
||||
display: 'inline-flex', alignItems: 'center', gap: 8, padding: '8px 12px',
|
||||
borderRadius: 999, border: '1px solid var(--line)', background: 'var(--surface)',
|
||||
fontSize: 12, color: 'var(--ink)', textDecoration: 'none', fontWeight: 700,
|
||||
boxShadow: 'var(--shadow-1)',
|
||||
}
|
||||
// Compact inline strip — signal fires → you open → bot manages.
|
||||
// No big card; the data panel is the main content. Settings link stays
|
||||
// for users who want to configure, but the explanation is one line.
|
||||
return (
|
||||
<div className="card" style={{ padding: 0, marginBottom: 16, overflow: 'hidden' }}>
|
||||
<div style={{ padding: '14px 16px', background: s.soft,
|
||||
borderLeft: `4px solid ${s.accent}` }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: s.accent }}>
|
||||
{s.idx} {s.name} — manage-only
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ padding: '16px', fontSize: 13, color: 'var(--ink-2)', lineHeight: 1.6 }}>
|
||||
<p style={{ margin: '0 0 10px' }}>
|
||||
<strong>Macro Vibes does not auto-open trades.</strong> When a bottom-reversal
|
||||
signal fires you get a Telegram alert. You open the position yourself on
|
||||
Hyperliquid, then hand it to the bot with <code>/adopt</code> — the bot then
|
||||
manages the exit (staged stop ladder, de-risk, pyramid, peak-trail).
|
||||
</p>
|
||||
<p style={{ margin: '0 0 12px', color: 'var(--ink-4)', fontSize: 12 }}>
|
||||
The Auto-Trade switch on the Trump page controls Trump (System 1)
|
||||
auto-opens only — it has no effect on Macro Vibes.
|
||||
</p>
|
||||
<Link href={settingsHref} style={linkStyle}>
|
||||
<span style={{ fontSize: 10, letterSpacing: '0.08em', textTransform: 'uppercase',
|
||||
color: 'var(--ink-4)' }}>Settings</span>
|
||||
<span>{settingsLabel}</span>
|
||||
<span aria-hidden="true">↗</span>
|
||||
</Link>
|
||||
</div>
|
||||
<div style={{
|
||||
display: 'flex', alignItems: 'center', justifyContent: 'space-between',
|
||||
gap: 12, flexWrap: 'wrap',
|
||||
padding: '9px 14px', marginBottom: 14,
|
||||
borderRadius: 8,
|
||||
background: s.soft,
|
||||
borderLeft: `3px solid ${s.accent}`,
|
||||
}}>
|
||||
<span style={{ fontSize: 12, color: 'var(--ink-2)', lineHeight: 1.4 }}>
|
||||
<strong style={{ color: s.accent }}>You open · bot manages exit</strong>
|
||||
<span style={{ color: 'var(--ink-4)', marginLeft: 8 }}>
|
||||
Signal → Telegram → open on Hyperliquid → <code style={{ fontSize: 11 }}>/adopt</code>
|
||||
</span>
|
||||
</span>
|
||||
<Link
|
||||
href={settingsHref}
|
||||
style={{
|
||||
fontSize: 11, color: s.accent, textDecoration: 'none',
|
||||
fontWeight: 700, flexShrink: 0,
|
||||
opacity: 0.8,
|
||||
}}
|
||||
>
|
||||
{settingsLabel} settings ↗
|
||||
</Link>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -248,11 +261,18 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
netMsg = isZh
|
||||
? 'Auto-Trade 当前为关闭: Trump 信号仍会显示,但不会自动开仓。'
|
||||
: 'Auto-Trade is OFF — Trump signals are shown in the feed but NOT traded.'
|
||||
} else if (pub?.trump_enabled === false) {
|
||||
// Auto-Trade is ON but the Trump (System-1) gate is OFF, so the backend
|
||||
// skips every Trump signal (bot_engine: trump_enabled OFF → not traded).
|
||||
// Without this branch the UI falsely promised "next signal auto-opens".
|
||||
netMsg = isZh
|
||||
? 'Auto-Trade 已开启,但 Trump 系统①未启用: 在设置页打开 Trump 开关后才会自动开仓。'
|
||||
: 'Auto-Trade is ON, but the Trump system is disabled — enable Trump in Settings before signals will trade.'
|
||||
} else {
|
||||
netOk = true
|
||||
netMsg = isZh
|
||||
? `Auto-Trade 已开启(Trump 系统①): 下一条合格 Trump 信号会自动开出${paper ? '模拟' : '真实'}仓位。`
|
||||
: `Auto-Trade ON (Trump / System 1) — will open a ${paper ? 'PAPER' : 'LIVE'} trade on the next qualifying Trump signal.`
|
||||
: `Auto-Trade ON — will open a ${paper ? 'PAPER' : 'LIVE'} trade on the next qualifying Trump signal.`
|
||||
}
|
||||
|
||||
const Pill = ({ active, onClick, children, tone }: {
|
||||
@@ -278,7 +298,7 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
<div style={{ padding: '14px 16px', background: s.soft,
|
||||
borderLeft: `4px solid ${s.accent}` }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 700, color: s.accent }}>
|
||||
{s.idx} {s.name} {isZh ? '控制面板' : '— control'}
|
||||
{s.name} {isZh ? '控制面板' : '— Auto-Trade'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -288,25 +308,10 @@ export default function SystemControl({ system }: { system: 'trump' | 'btc' }) {
|
||||
<div>
|
||||
<div style={{ fontSize: 14, fontWeight: 700 }}>
|
||||
Auto-Trade <span style={{ fontSize: 10, fontWeight: 600,
|
||||
color: 'var(--ink-4)', marginLeft: 6 }}>{isZh ? '· Trump 系统①' : '· TRUMP (System 1)'}</span>
|
||||
color: 'var(--ink-4)', marginLeft: 6 }}>{isZh ? '· 事件交易' : '· event-driven'}</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--ink-4)', marginTop: 3, maxWidth: 480, lineHeight: 1.5 }}>
|
||||
{isZh ? (
|
||||
<>
|
||||
<strong>控制 Trump 信号是否自动开仓。</strong> 关闭时:信号仍会扫描并显示,但不会自动交易。
|
||||
开启时:满足条件的 Trump 信号会自动开仓。无论开关状态如何,
|
||||
已开仓位的止损和分级降风险都会继续保护持仓。
|
||||
(Macro Vibes 不自动开仓——见 Macro 页的 manage-only 说明。)
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<strong>Controls Trump (System 1) auto-opens.</strong> OFF: signals
|
||||
scanned & shown in the feed, nothing traded. ON: a qualifying
|
||||
Trump signal auto-opens a trade. Stop-loss / staged de-risk always
|
||||
protect open positions either way. (Macro Vibes is manage-only and
|
||||
never auto-opens — see its page.)
|
||||
</>
|
||||
)}
|
||||
<div style={{ fontSize: 11, color: 'var(--ink-4)', marginTop: 3 }}>
|
||||
{isZh ? 'OFF = 只监控信号 · ON = 自动开仓' : 'OFF = monitor only · ON = auto-open on qualifying Trump signals'}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 6 }}>
|
||||
|
||||
Reference in New Issue
Block a user