diff --git a/web/src/App.tsx b/web/src/App.tsx index df4afab2..af5d884d 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -23,7 +23,7 @@ import { AuthProvider, useAuth } from './contexts/AuthContext' import { ConfirmDialogProvider } from './components/common/ConfirmDialog' import { t } from './i18n/translations' import { useSystemConfig } from './hooks/useSystemConfig' -import { getUserMode } from './lib/onboarding' +import { getUserMode, hasCompletedBeginnerOnboarding } from './lib/onboarding' import { OFFICIAL_LINKS } from './constants/branding' import type { @@ -352,7 +352,7 @@ function App() { }, [route]) const showBeginnerOnboarding = - route === '/welcome' && (!!user || hasPersistedAuth) && getUserMode() === 'beginner' + route === '/welcome' && (!!user || hasPersistedAuth) && getUserMode() === 'beginner' && !hasCompletedBeginnerOnboarding() // Show loading spinner while checking auth or config if (isLoading || configLoading) { diff --git a/web/src/components/trader/BeginnerGuideCards.tsx b/web/src/components/trader/BeginnerGuideCards.tsx index cf6e06c0..26f00f6d 100644 --- a/web/src/components/trader/BeginnerGuideCards.tsx +++ b/web/src/components/trader/BeginnerGuideCards.tsx @@ -49,8 +49,12 @@ export function BeginnerGuideCards({ : 'Pay per call with Base USDC', ready: claw402Ready, actionLabel: claw402Ready - ? isZh ? '已配置' : 'Configured' - : isZh ? '一键配置' : 'One-click setup', + ? isZh + ? '已配置' + : 'Configured' + : isZh + ? '一键配置' + : 'One-click setup', onAction: onQuickSetupClaw402, disabled: claw402Ready, }, @@ -62,12 +66,20 @@ export function BeginnerGuideCards({ ? '交易所接好以后,AI 才能真正下单。' : 'Connect an exchange so the AI can actually place trades.', meta: exchangeReady - ? isZh ? '已准备好' : 'Ready' - : isZh ? 'Binance / OKX / Bybit / Hyperliquid' : 'Binance / OKX / Bybit / Hyperliquid', + ? isZh + ? '已准备好' + : 'Ready' + : isZh + ? 'Binance / OKX / Bybit / Hyperliquid' + : 'Binance / OKX / Bybit / Hyperliquid', ready: exchangeReady, actionLabel: exchangeReady - ? isZh ? '继续管理' : 'Manage' - : isZh ? '去配置' : 'Configure', + ? isZh + ? '继续管理' + : 'Manage' + : isZh + ? '去配置' + : 'Configure', onAction: onOpenExchange, disabled: false, }, @@ -79,8 +91,12 @@ export function BeginnerGuideCards({ ? '先用默认策略也可以,后面再慢慢细调。' : 'You can start with a default strategy and fine-tune later.', meta: strategyReady - ? isZh ? '已有策略可用' : 'Strategy ready' - : isZh ? '可选,但建议提前看一眼' : 'Optional, but worth a quick look', + ? isZh + ? '已有策略可用' + : 'Strategy ready' + : isZh + ? '可选,但建议提前看一眼' + : 'Optional, but worth a quick look', ready: strategyReady, actionLabel: isZh ? '打开策略页' : 'Open strategy', onAction: onOpenStrategy, @@ -94,8 +110,12 @@ export function BeginnerGuideCards({ ? '最后一步,把模型和交易所绑在一起,就能开始运行。' : 'Last step: bind your model and exchange, then start running.', meta: canCreateTrader - ? isZh ? '已经可以创建' : 'Ready to create' - : isZh ? '先完成前两步' : 'Finish the first two steps first', + ? isZh + ? '已经可以创建' + : 'Ready to create' + : isZh + ? '先完成前两步' + : 'Finish the first two steps first', ready: canCreateTrader, actionLabel: isZh ? '立即创建' : 'Create now', onAction: onCreateTrader, @@ -111,12 +131,14 @@ export function BeginnerGuideCards({ {isZh ? '新手引导' : 'Quickstart'}
{card.desc}
diff --git a/web/src/components/trader/ModelConfigModal.tsx b/web/src/components/trader/ModelConfigModal.tsx index 5124e69e..51fa370a 100644 --- a/web/src/components/trader/ModelConfigModal.tsx +++ b/web/src/components/trader/ModelConfigModal.tsx @@ -13,7 +13,7 @@ import { AI_PROVIDER_CONFIG, getShortName, } from './model-constants' -import { getBeginnerWalletAddress } from '../../lib/onboarding' +import { getBeginnerWalletAddress, getUserMode } from '../../lib/onboarding' interface ModelConfigModalProps { allModels: AIModel[] @@ -84,6 +84,7 @@ export function ModelConfigModal({ const availableModels = allModels || [] const configuredIds = new Set(configuredModels?.map(m => m.id) || []) const isClaw402Selected = selectedModel?.provider === 'claw402' || selectedModel?.id === 'claw402' + const isBeginnerDefaultModel = isClaw402Selected && getUserMode() === 'beginner' const stepLabels = [ t('modelConfig.selectModel', language), t( @@ -117,7 +118,7 @@ export function ModelConfigModal({